On Thu, Jun 11, 2015 at 12:39:50PM +0100, Frediano Ziglio wrote:
Actually can be a compatiblity problem as heads in the XML configuration
was set by default to '1'.
Yes, this bit is worrying, the old behaviour could be considered as
buggy as the XML contained '1' but the number of heads was not enforced.
Suddenly enforcing the heads='1' (which libvirt will add by default to
domain definitions which don't have it) will cause a change of behaviour
for old guests though.
Something like the patch below changes libvirt so that we don't always
append heads='1' to domain XML, but I don't know if this interacts
correctly with parallels and vmx which force it to be 1 (this probably should
not be an issue, but maybe there are latent bugs). Also this is part of the things
which are checked as part of virDomainVideoDefCheckABIStability() , so I
suspect we'll need to be extra careful there too :(
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 36de844..43067e9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11421,7 +11421,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,
goto error;
}
} else {
- def->heads = 1;
+ def->heads = 0;
}
if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0)
@@ -15507,7 +15507,6 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
}
video->vram = virDomainVideoDefaultRAM(def, video->type);
- video->heads = 1;
if (VIR_ALLOC_N(def->videos, 1) < 0) {
virDomainVideoDefFree(video);
goto error;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2bd63e1..03a0458 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -13411,7 +13411,6 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
vid->ram = 0;
vid->vgamem = 0;
}
- vid->heads = 1;
if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) {
virDomainVideoDefFree(vid);