static int
virDomainDeviceBootParseXML(xmlNodePtr node,
- virDomainDeviceInfoPtr info,
- virHashTablePtr bootHash)
+ virDomainDeviceInfoPtr info)
{
char *order;
char *loadparm = NULL;
goto cleanup;
}
- if (bootHash) {
- if (virHashLookup(bootHash, order)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("boot order '%s' used for more than one device"),
- order);
- goto cleanup;
- }
-
- if (virHashAddEntry(bootHash, order, (void *) 1) < 0)
- goto cleanup;
- }
-
loadparm = virXMLPropString(node, "loadparm");
if (loadparm) {
if (virStringToUpper(&info->loadparm, loadparm) != 1) {
static int
virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED,
xmlNodePtr node,
- virHashTablePtr bootHash,
virDomainDeviceInfoPtr info,
unsigned int flags)
{
}
if (boot) {
- if (virDomainDeviceBootParseXML(boot, info, bootHash))
+ if (virDomainDeviceBootParseXML(boot, info))
goto cleanup;
}
virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
- virHashTablePtr bootHash,
virSecurityLabelDefPtr* vmSeclabels,
int nvmSeclabels,
unsigned int flags)
}
def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
} else {
- if (virDomainDeviceInfoParseXML(xmlopt, node, bootHash, &def->info,
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info,
flags | VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT) < 0)
goto error;
}
if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
VIR_DEBUG("Ignoring device address for none model usb controller");
- } else if (virDomainDeviceInfoParseXML(xmlopt, node, NULL,
+ } else if (virDomainDeviceInfoParseXML(xmlopt, node,
&def->info, flags) < 0) {
goto error;
}
def->dst = target;
target = NULL;
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
cleanup:
virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
- virHashTablePtr bootHash,
char *prefix,
unsigned int flags)
{
}
def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
} else {
- if (virDomainDeviceInfoParseXML(xmlopt, node, bootHash, &def->info,
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info,
flags | VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT
| VIR_DOMAIN_DEF_PARSE_ALLOW_ROM) < 0)
goto error;
if (def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
def->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD) {
VIR_DEBUG("Ignoring device address for gustfwd channel");
- } else if (virDomainDeviceInfoParseXML(xmlopt, node, NULL,
+ } else if (virDomainDeviceInfoParseXML(xmlopt, node,
&def->info, flags) < 0) {
goto error;
}
goto error;
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) {
goto error;
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
cleanup:
if (VIR_ALLOC(panic) < 0)
return NULL;
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL,
+ if (virDomainDeviceInfoParseXML(xmlopt, node,
&panic->info, flags) < 0)
goto error;
}
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
if (def->bus == VIR_DOMAIN_INPUT_BUS_USB &&
goto error;
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
cleanup:
}
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
cleanup:
}
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
cleanup:
break;
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
if (virDomainVirtioOptionsParseXML(virXPathNode("./driver", ctxt),
if (def->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE)
VIR_DEBUG("Ignoring device address for none model Memballoon");
- else if (virDomainDeviceInfoParseXML(xmlopt, node, NULL,
+ else if (virDomainDeviceInfoParseXML(xmlopt, node,
&def->info, flags) < 0)
goto error;
if (VIR_ALLOC(def) < 0)
return NULL;
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
return def;
goto cleanup;
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto cleanup;
}
}
- if (virDomainDeviceInfoParseXML(xmlopt, node, NULL, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
goto error;
def->driver = virDomainVideoDriverDefParseXML(node);
virDomainHostdevDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
- virHashTablePtr bootHash,
unsigned int flags)
{
virDomainHostdevDefPtr def;
}
if (def->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
- if (virDomainDeviceInfoParseXML(xmlopt, node, bootHash, def->info,
+ if (virDomainDeviceInfoParseXML(xmlopt, node, def->info,
flags | VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT
| VIR_DOMAIN_DEF_PARSE_ALLOW_ROM) < 0)
goto error;
virDomainRedirdevDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
- virHashTablePtr bootHash,
unsigned int flags)
{
xmlNodePtr cur;
if (def->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC)
def->source->data.spicevmc = VIR_DOMAIN_CHR_SPICEVMC_USBREDIR;
- if (virDomainDeviceInfoParseXML(xmlopt, node, bootHash, &def->info,
+ if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info,
flags | VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT) < 0)
goto error;
goto error;
if (virDomainDeviceInfoParseXML(xmlopt, memdevNode,
- NULL, &def->info, flags) < 0)
+ &def->info, flags) < 0)
goto error;
ctxt->node = save;
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
if (!(dev->data.disk = virDomainDiskDefParseXML(xmlopt, node, ctxt,
- NULL, def->seclabels,
+ def->seclabels,
def->nseclabels,
flags)))
goto error;
case VIR_DOMAIN_DEVICE_NET:
netprefix = caps->host.netprefix;
if (!(dev->data.net = virDomainNetDefParseXML(xmlopt, node, ctxt,
- NULL, netprefix, flags)))
+ netprefix, flags)))
goto error;
break;
case VIR_DOMAIN_DEVICE_INPUT:
break;
case VIR_DOMAIN_DEVICE_HOSTDEV:
if (!(dev->data.hostdev = virDomainHostdevDefParseXML(xmlopt, node,
- ctxt, NULL,
+ ctxt,
flags)))
goto error;
break;
break;
case VIR_DOMAIN_DEVICE_REDIRDEV:
if (!(dev->data.redirdev = virDomainRedirdevDefParseXML(xmlopt, node,
- ctxt, NULL, flags)))
+ ctxt, flags)))
goto error;
break;
case VIR_DOMAIN_DEVICE_RNG:
}
disk = virDomainDiskDefParseXML(xmlopt, ctxt->node, ctxt,
- NULL, seclabels, nseclabels, flags);
+ seclabels, nseclabels, flags);
cleanup:
xmlFreeDoc(xml);
static int
virDomainDefParseBootOptions(virDomainDefPtr def,
- xmlXPathContextPtr ctxt,
- virHashTablePtr *bootHash)
+ xmlXPathContextPtr ctxt)
{
xmlNodePtr *nodes = NULL;
char *tmp = NULL;
if (virDomainDefParseBootXML(ctxt, def) < 0)
goto error;
- if (!(*bootHash = virHashCreate(5, NULL)))
- goto error;
}
ret = 0;
long id = -1;
virDomainDefPtr def;
bool uuid_generated = false;
- virHashTablePtr bootHash = NULL;
bool usb_none = false;
bool usb_other = false;
bool usb_master = false;
}
VIR_FREE(nodes);
- if (virDomainDefParseBootOptions(def, ctxt, &bootHash) < 0)
+ if (virDomainDefParseBootOptions(def, ctxt) < 0)
goto error;
/* analysis of the disk devices */
virDomainDiskDefPtr disk = virDomainDiskDefParseXML(xmlopt,
nodes[i],
ctxt,
- bootHash,
def->seclabels,
def->nseclabels,
flags);
virDomainNetDefPtr net = virDomainNetDefParseXML(xmlopt,
nodes[i],
ctxt,
- bootHash,
netprefix,
flags);
if (!net)
virDomainHostdevDefPtr hostdev;
hostdev = virDomainHostdevDefParseXML(xmlopt, nodes[i], ctxt,
- bootHash, flags);
+ flags);
if (!hostdev)
goto error;
goto error;
for (i = 0; i < n; i++) {
virDomainRedirdevDefPtr redirdev =
- virDomainRedirdevDefParseXML(xmlopt, nodes[i], ctxt, bootHash, flags);
+ virDomainRedirdevDefParseXML(xmlopt, nodes[i], ctxt, flags);
if (!redirdev)
goto error;
if (virDomainDefValidate(def, caps, flags, xmlopt) < 0)
goto error;
- virHashFree(bootHash);
-
return def;
error:
VIR_FREE(tmp);
VIR_FREE(nodes);
- virHashFree(bootHash);
virDomainDefFree(def);
return NULL;
}