提交 5e06a4f0 编写于 作者: J John Ferlan

conf: Fix virtType check

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
上级 7383b8cc
...@@ -14640,7 +14640,7 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -14640,7 +14640,7 @@ virDomainDefParseXML(xmlDocPtr xml,
xmlNodePtr *nodes = NULL, node = NULL; xmlNodePtr *nodes = NULL, node = NULL;
char *tmp = NULL; char *tmp = NULL;
size_t i, j; size_t i, j;
int n; int n, virtType;
long id = -1; long id = -1;
virDomainDefPtr def; virDomainDefPtr def;
bool uuid_generated = false; bool uuid_generated = false;
...@@ -14678,11 +14678,12 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -14678,11 +14678,12 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error; goto error;
} }
if ((def->virtType = virDomainVirtTypeFromString(tmp)) < 0) { if ((virtType = virDomainVirtTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("invalid domain type %s"), tmp); _("invalid domain type %s"), tmp);
goto error; goto error;
} }
def->virtType = virtType;
VIR_FREE(tmp); VIR_FREE(tmp);
def->os.bootloader = virXPathString("string(./bootloader)", ctxt); def->os.bootloader = virXPathString("string(./bootloader)", ctxt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册