qemu: parse: Use virControllerDefNew

Rather than reimplement it. This will be needed in upcoming patches
This commit is contained in:
Cole Robinson 2016-04-24 11:05:31 -04:00
parent e2ac519cd2
commit 345d2ab488
4 changed files with 7 additions and 6 deletions

View File

@ -1638,7 +1638,7 @@ virDomainDiskSetFormat(virDomainDiskDefPtr def, int format)
} }
static virDomainControllerDefPtr virDomainControllerDefPtr
virDomainControllerDefNew(virDomainControllerType type) virDomainControllerDefNew(virDomainControllerType type)
{ {
virDomainControllerDefPtr def; virDomainControllerDefPtr def;

View File

@ -2563,6 +2563,8 @@ virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def,
int bus, int bus,
char *dst); char *dst);
void virDomainControllerDefFree(virDomainControllerDefPtr def); void virDomainControllerDefFree(virDomainControllerDefPtr def);
virDomainControllerDefPtr
virDomainControllerDefNew(virDomainControllerType type);
void virDomainFSDefFree(virDomainFSDefPtr def); void virDomainFSDefFree(virDomainFSDefPtr def);
void virDomainActualNetDefFree(virDomainActualNetDefPtr def); void virDomainActualNetDefFree(virDomainActualNetDefPtr def);
void virDomainNetDefFree(virDomainNetDefPtr def); void virDomainNetDefFree(virDomainNetDefPtr def);

View File

@ -186,6 +186,7 @@ virDomainClockOffsetTypeToString;
virDomainConfigFile; virDomainConfigFile;
virDomainControllerAliasFind; virDomainControllerAliasFind;
virDomainControllerDefFree; virDomainControllerDefFree;
virDomainControllerDefNew;
virDomainControllerFind; virDomainControllerFind;
virDomainControllerFindByType; virDomainControllerFindByType;
virDomainControllerInsert; virDomainControllerInsert;

View File

@ -2351,13 +2351,11 @@ qemuParseCommandLine(virCapsPtr caps,
/* ignore, generted on the fly */ /* ignore, generted on the fly */
} else if (STREQ(arg, "-usb")) { } else if (STREQ(arg, "-usb")) {
virDomainControllerDefPtr ctldef; virDomainControllerDefPtr ctldef;
if (VIR_ALLOC(ctldef) < 0) ctldef = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB);
if (!ctldef)
goto error; goto error;
ctldef->type = VIR_DOMAIN_CONTROLLER_TYPE_USB;
ctldef->idx = 0;
ctldef->model = -1;
if (virDomainControllerInsert(def, ctldef) < 0) { if (virDomainControllerInsert(def, ctldef) < 0) {
VIR_FREE(ctldef); virDomainControllerDefFree(ctldef);
goto error; goto error;
} }
} else if (STREQ(arg, "-pidfile")) { } else if (STREQ(arg, "-pidfile")) {