mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Call per-device post-parse callback even on implicit video
Commit6879be48
moved adding of an implicit video device after XML parsing. As a result, libxlDomainDeviceDefPostParse() is no longer called to set the default vram when adding an implicit device. Commit6879be48
assumes virDomainVideoDefaultRAM() will set the default vram, but it returns 0 if the domain virtType is VIR_DOMAIN_VIRT_XEN. Attempting to start an HVM domain with vram=0 results in error: unsupported configuration: videoram must be at least 4MB for CIRRUS The default vram setting for Xen HVM domains depends on the device model used (qemu-xen vs qemu-traditional), hence setting the default is deferred to libxlDomainDeviceDefPostParse(). Call the device post-parse callback even for implicit video, to fill out the default vram even for VIR_DOMAIN_VIRT_XEN. https://bugzilla.redhat.com/show_bug.cgi?id=1334557 Most-of-commit-message-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
e4d131b8cb
commit
3e42867032
@ -4362,8 +4362,7 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
virDomainDefPostParseInternal(virDomainDefPtr def,
|
virDomainDefPostParseInternal(virDomainDefPtr def,
|
||||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
struct virDomainDefPostParseDeviceIteratorData *data)
|
||||||
unsigned int parseFlags)
|
|
||||||
{
|
{
|
||||||
/* verify init path for container based domains */
|
/* verify init path for container based domains */
|
||||||
if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
|
if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
|
||||||
@ -4372,7 +4371,7 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefPostParseMemory(def, parseFlags) < 0)
|
if (virDomainDefPostParseMemory(def, data->parseFlags) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
||||||
@ -4387,11 +4386,22 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
|
|||||||
if (virDomainDefAddImplicitDevices(def) < 0)
|
if (virDomainDefAddImplicitDevices(def) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Mark the first video as primary. If the user specified primary="yes",
|
if (def->nvideos != 0) {
|
||||||
* the parser already inserted the device at def->videos[0] */
|
virDomainDeviceDef device = {
|
||||||
if (def->nvideos != 0)
|
.type = VIR_DOMAIN_DEVICE_VIDEO,
|
||||||
|
.data.video = def->videos[0],
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Mark the first video as primary. If the user specified primary="yes",
|
||||||
|
* the parser already inserted the device at def->videos[0] */
|
||||||
def->videos[0]->primary = true;
|
def->videos[0]->primary = true;
|
||||||
|
|
||||||
|
/* videos[0] might have been added in AddImplicitDevices, after we've
|
||||||
|
* done the per-device post-parse */
|
||||||
|
if (virDomainDefPostParseDeviceIterator(NULL, &device, NULL, data) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* clean up possibly duplicated metadata entries */
|
/* clean up possibly duplicated metadata entries */
|
||||||
virDomainDefMetadataSanitize(def);
|
virDomainDefMetadataSanitize(def);
|
||||||
|
|
||||||
@ -4429,7 +4439,7 @@ virDomainDefPostParse(virDomainDefPtr def,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
if ((ret = virDomainDefPostParseInternal(def, caps, parseFlags)) < 0)
|
if ((ret = virDomainDefPostParseInternal(def, &data)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (virDomainDefPostParseCheckFeatures(def, xmlopt) < 0)
|
if (virDomainDefPostParseCheckFeatures(def, xmlopt) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user