[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 02/10] nwfilter: use consistent OOM reporting




libvir-list-bounces redhat com wrote on 08/18/2010 07:45:05 PM:


> libvir-list-bounces redhat com

>
> * src/nwfilter/nwfilter_driver.c (nwfilterLog): Delete.
> (nwfilterDriverStartup): Use virReportOOMError instead.
> ---
>
> No point making printf uses harder to audit by hiding them in a macro,
> especially when this file already uses virReportOOMError elsewhere.
>
>  src/nwfilter/nwfilter_driver.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
> index 0e8241e..bda50f9 100644
> --- a/src/nwfilter/nwfilter_driver.c
> +++ b/src/nwfilter/nwfilter_driver.c
> @@ -42,9 +42,6 @@
>
>  #define VIR_FROM_THIS VIR_FROM_NWFILTER
>
> -#define nwfilterLog(msg...) fprintf(stderr, msg)
> -
> -
>  static virNWFilterDriverStatePtr driverState;
>
>  static int nwfilterDriverShutdown(void);
> @@ -95,7 +92,6 @@ nwfilterDriverStartup(int privileged) {
>              goto error;
>
>          if (virAsprintf(&base, "%s/.libvirt", userdir) == -1) {
> -            nwfilterLog("out of memory in virAsprintf");
>              VIR_FREE(userdir);
>              goto out_of_memory;
>          }
> @@ -118,7 +114,7 @@ nwfilterDriverStartup(int privileged) {
>      return 0;
>
>  out_of_memory:
> -    nwfilterLog("virNWFilterStartup: out of memory");
> +    virReportOOMError();
>
>  error:
>      VIR_FREE(base);


ACK.

  Stefan

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]