]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Fix virtType check
authorJohn Ferlan <jferlan@redhat.com>
Fri, 25 Sep 2015 21:33:05 +0000 (17:33 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 25 Sep 2015 21:33:05 +0000 (17:33 -0400)
Commit id '7383b8cc' changed virDomainDef 'virtType' to an enum, that
caused a build failure on some archs due to comparing an unsigned value
to < 0.  Adjust the fetch of 'type' to be into temporary 'int virtType'
and then assign that virtType to the def->virtType

src/conf/domain_conf.c

index cdafb1422a4e7ea542bc24c6ae262cc8ed19d92d..393ece7a4daeb6ad38f3d6e9a7f74bd15b933a2a 100644 (file)
@@ -14640,7 +14640,7 @@ virDomainDefParseXML(xmlDocPtr xml,
     xmlNodePtr *nodes = NULL, node = NULL;
     char *tmp = NULL;
     size_t i, j;
-    int n;
+    int n, virtType;
     long id = -1;
     virDomainDefPtr def;
     bool uuid_generated = false;
@@ -14678,11 +14678,12 @@ virDomainDefParseXML(xmlDocPtr xml,
         goto error;
     }
 
-    if ((def->virtType = virDomainVirtTypeFromString(tmp)) < 0) {
+    if ((virtType = virDomainVirtTypeFromString(tmp)) < 0) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("invalid domain type %s"), tmp);
         goto error;
     }
+    def->virtType = virtType;
     VIR_FREE(tmp);
 
     def->os.bootloader = virXPathString("string(./bootloader)", ctxt);