|
|
9119d9 |
From bfa70528ef83f6bf596494ebe4bdc34f15648378 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <bfa70528ef83f6bf596494ebe4bdc34f15648378@dist-git>
|
|
|
9119d9 |
From: Shanzhi Yu <shyu@redhat.com>
|
|
|
9119d9 |
Date: Wed, 22 Oct 2014 09:54:38 +0200
|
|
|
9119d9 |
Subject: [PATCH] qemu: save domain status after set domain's numa parameters
|
|
|
9119d9 |
|
|
|
9119d9 |
After set domain's numa parameters for running domain, save the change,
|
|
|
9119d9 |
save the change into live xml is needed to survive restarting the libvirtd,
|
|
|
9119d9 |
same story with bug 1146511; meanwihle add call
|
|
|
9119d9 |
qemuDomainObjBeginJob/qemuDomainObjEndJob in qemuDomainSetNumaParameters
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
|
|
|
9119d9 |
(cherry picked from commit 566d5de7bf9b7218ba0c7025046d4d28f3414e60)
|
|
|
9119d9 |
|
|
|
9119d9 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_driver.c | 30 ++++++++++++++++++++----------
|
|
|
9119d9 |
1 file changed, 20 insertions(+), 10 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
index 90f81a0..3c1d2f5 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_driver.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
@@ -8987,15 +8987,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|
|
9119d9 |
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
|
|
|
9119d9 |
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
|
|
9119d9 |
+ goto cleanup;
|
|
|
9119d9 |
+
|
|
|
9119d9 |
if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
|
|
|
9119d9 |
&persistentDef) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
|
|
9119d9 |
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
|
|
|
9119d9 |
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
|
9119d9 |
_("cgroup cpuset controller is not mounted"));
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
@@ -9008,18 +9011,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|
|
9119d9 |
if (mode < 0 || mode >= VIR_DOMAIN_NUMATUNE_MEM_LAST) {
|
|
|
9119d9 |
virReportError(VIR_ERR_INVALID_ARG,
|
|
|
9119d9 |
_("unsupported numatune mode: '%d'"), mode);
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
} else if (STREQ(param->field, VIR_DOMAIN_NUMA_NODESET)) {
|
|
|
9119d9 |
if (virBitmapParse(param->value.s, 0, &nodeset,
|
|
|
9119d9 |
VIR_DOMAIN_CPUMASK_LEN) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (virBitmapIsAllClear(nodeset)) {
|
|
|
9119d9 |
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
|
9119d9 |
_("Invalid nodeset for numatune"));
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
}
|
|
|
9119d9 |
}
|
|
|
9119d9 |
@@ -9029,18 +9032,21 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|
|
9119d9 |
virDomainNumatuneGetMode(vm->def->numatune, -1) != mode) {
|
|
|
9119d9 |
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
|
9119d9 |
_("can't change numatune mode for running domain"));
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
if (nodeset &&
|
|
|
9119d9 |
qemuDomainSetNumaParamsLive(vm, caps, nodeset) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (virDomainNumatuneSet(&vm->def->numatune,
|
|
|
9119d9 |
vm->def->placement_mode ==
|
|
|
9119d9 |
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,
|
|
|
9119d9 |
-1, mode, nodeset) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
9119d9 |
@@ -9048,14 +9054,18 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|
|
9119d9 |
persistentDef->placement_mode ==
|
|
|
9119d9 |
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,
|
|
|
9119d9 |
-1, mode, nodeset) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (virDomainSaveConfig(cfg->configDir, persistentDef) < 0)
|
|
|
9119d9 |
- goto cleanup;
|
|
|
9119d9 |
+ goto endjob;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
ret = 0;
|
|
|
9119d9 |
|
|
|
9119d9 |
+ endjob:
|
|
|
9119d9 |
+ if (!qemuDomainObjEndJob(driver, vm))
|
|
|
9119d9 |
+ vm = NULL;
|
|
|
9119d9 |
+
|
|
|
9119d9 |
cleanup:
|
|
|
9119d9 |
virBitmapFree(nodeset);
|
|
|
9119d9 |
if (vm)
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.3
|
|
|
9119d9 |
|