mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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
This commit is contained in:
parent
7383b8cc06
commit
5e06a4f063
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user