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

Christophe Fergeau cfergeau at redhat.com
Mon Jun 18 10:27:51 UTC 2012


On Mon, Jun 18, 2012 at 11:05:35AM +0100, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120618/88b8c3fa/attachment-0001.sig>


More information about the libvir-list mailing list