[libvirt] [PATCH 0/2] Revert two patches of mine

Basically, this broke vCPU hotplug (as discovered by Peter). While these are fixing a bug, they have lover priority (nobody reported the bug until I tried unusual scenario). So revert these in favour of vCPU hotplug feature available and do the right fix after the release. Michal Privoznik (2): Revert "domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE" Revert "conf: Skip post parse callbacks when creating copy" src/conf/domain_conf.c | 12 ++---------- src/conf/domain_conf.h | 2 -- src/qemu/qemu_domain.c | 3 +-- 3 files changed, 3 insertions(+), 14 deletions(-) -- 2.8.4

This breaks vCPU hotplug, because when starting a domain, we create a copy of domain definition (which becomes live XML) and during the post parse callbacks we might adjust some tunings so that vCPU hotplug is possible. This reverts commit c0f90799bc7fa4b690ead6a592806378a243873c. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/conf/domain_conf.c | 6 ------ src/conf/domain_conf.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 920529a..1e65df1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4430,9 +4430,6 @@ virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, { int ret; - if (flags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE) - return 0; - if (xmlopt->config.devicesPostParseCallback) { ret = xmlopt->config.devicesPostParseCallback(dev, def, caps, flags, xmlopt->config.priv, @@ -4582,9 +4579,6 @@ virDomainDefPostParse(virDomainDefPtr def, .parseOpaque = parseOpaque, }; - if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE) - return 0; - /* this must be done before the hypervisor-specific callback, * in case presence of a controller at a specific index is checked */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index fd3ae8e..a70bc21 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2647,8 +2647,6 @@ typedef enum { VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9, /* skip definition validation checks meant to be executed on define time only */ VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10, - /* skip post parse callback */ - VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE = 1 << 11, } virDomainDefParseFlags; typedef enum { -- 2.8.4

This breaks vCPU hotplug, because when starting a domain, we create a copy of domain definition (which becomes live XML) and during the post parse callbacks we might adjust some tunings so that vCPU hotplug is possible. This reverts commit 581b7756af18dcf84b57d9947978725d2dfbfc18. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/conf/domain_conf.c | 6 ++---- src/qemu/qemu_domain.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1e65df1..7427efb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24684,8 +24684,7 @@ virDomainDefCopy(virDomainDefPtr src, virDomainDefPtr ret; unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | - VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE; + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; if (migratable) format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE; @@ -25172,8 +25171,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, xmlStr = virBufferContentAndReset(&buf); ret = virDomainDeviceDefParse(xmlStr, def, caps, xmlopt, VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | - VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE); + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE); cleanup: VIR_FREE(xmlStr); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9b1a32e..2b24c01 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3380,8 +3380,7 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | - VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE))) + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) goto cleanup; cleanup: -- 2.8.4

On Tue, Oct 04, 2016 at 18:02:36 +0200, Michal Privoznik wrote:
Basically, this broke vCPU hotplug (as discovered by Peter). While these are fixing a bug, they have lover priority (nobody reported the bug until I tried unusual scenario). So revert these in favour of vCPU hotplug feature available and do the right fix after the release.
Michal Privoznik (2): Revert "domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE" Revert "conf: Skip post parse callbacks when creating copy"
src/conf/domain_conf.c | 12 ++---------- src/conf/domain_conf.h | 2 -- src/qemu/qemu_domain.c | 3 +-- 3 files changed, 3 insertions(+), 14 deletions(-)
ACK series, safe for freeze. Peter
participants (2)
-
Michal Privoznik
-
Peter Krempa