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

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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);
-- 
1.7.10.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]