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

Re: [libvirt] [PATCH libvirt-gconfig] Remove bogus check against -1 of gvir_config_genum_get_value return value



On Mon, Jun 18, 2012 at 11:05:35AM +0100, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange redhat com>
> 
> The gvir_config_domain_disk class was checking the return value
> of gvir_config_genum_get_value against -1. This is impossible,
> since this method will return the default enum value
> ---
>  libvirt-gconfig/libvirt-gconfig-domain-disk.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain-disk.c b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
> index a29ea47..5041393 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain-disk.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-disk.c
> @@ -85,8 +85,6 @@ gvir_config_domain_disk_new_from_tree(GVirConfigXmlDoc *doc,
>      type = gvir_config_genum_get_value(GVIR_CONFIG_TYPE_DOMAIN_DISK_TYPE,
>                                         type_str,
>                                         GVIR_CONFIG_DOMAIN_DISK_FILE);
> -    if (type == -1)
> -        return NULL;
>  
>      object = gvir_config_object_new_from_tree(GVIR_CONFIG_TYPE_DOMAIN_DISK,
>                                                doc, NULL, tree);

ACK

Christophe

Attachment: pgpylq8Ft4fiW.pgp
Description: PGP signature


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