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

Re: [libvirt] [PATCH v1 06/37] Adapt to VIR_ALLOC and virAsprintf in src/conf/*



On 07/04/2013 02:06 PM, Michal Privoznik wrote:
> ---
>  src/conf/cpu_conf.c                  |  34 +---
>  src/conf/domain_conf.c               | 328 +++++++++++------------------------
>  src/conf/domain_event.c              |  30 +---
>  src/conf/interface_conf.c            |  35 +---
>  src/conf/netdev_bandwidth_conf.c     |  12 +-
>  src/conf/netdev_vlan_conf.c          |   4 +-
>  src/conf/netdev_vport_profile_conf.c |   4 +-
>  src/conf/network_conf.c              |  86 +++------
>  src/conf/node_device_conf.c          |  29 +---
>  src/conf/nwfilter_conf.c             |  33 +---
>  src/conf/nwfilter_ipaddrmap.c        |   8 +-
>  src/conf/nwfilter_params.c           |  35 +---
>  src/conf/secret_conf.c               |   4 +-
>  src/conf/snapshot_conf.c             |  47 ++---
>  src/conf/storage_conf.c              |  38 +---
>  src/conf/storage_encryption_conf.c   |  12 +-
>  src/conf/virchrdev.c                 |  12 +-
>  17 files changed, 200 insertions(+), 551 deletions(-)
> 

> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 921a4f6..d45c770 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -2031,10 +2023,8 @@ virDomainObjNew(virDomainXMLOptionPtr xmlopt)
>          return NULL;
>  
>      if (xmlopt->privateData.alloc) {
> -        if (!(domain->privateData = (xmlopt->privateData.alloc)())) {
> -            virReportOOMError();
> +        if (!(domain->privateData = (xmlopt->privateData.alloc)()))
>              goto error;
> -        }
>          domain->privateDataFreeFunc = xmlopt->privateData.free;
>      }
>  

It seems qemuDomainObjPrivateAlloc can fail without reporting an error.

> @@ -17690,9 +17563,7 @@ virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t ii, bool force0)
>          def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
>  
>          if (!def->listens && (ii == 0) && force0) {
> -            if (VIR_ALLOC(def->listens) < 0)
> -                virReportOOMError();
> -            else
> +            if (VIR_ALLOC(def->listens) >= 0)
>                  def->nListens = 1;
>          }
>  

Weird, but pre-existing.

ACK

Jan


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