|
|
9119d9 |
From de4f1874ef3fc1e2f63559441d7c63a5e0ae9048 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <de4f1874ef3fc1e2f63559441d7c63a5e0ae9048@dist-git>
|
|
|
9119d9 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
9119d9 |
Date: Wed, 19 Nov 2014 09:37:01 +0100
|
|
|
9119d9 |
Subject: [PATCH] qemuPrepareNVRAM: Save domain conf only if domain's
|
|
|
9119d9 |
persistent
|
|
|
9119d9 |
|
|
|
9119d9 |
https://bugzilla.redhat.com/show_bug.cgi?id=1026772
|
|
|
9119d9 |
|
|
|
9119d9 |
In one of my previous patches (3a3c3780b) I've tried to fix the
|
|
|
9119d9 |
problem of nvram path disappearing on a domain that's been
|
|
|
9119d9 |
started and shut down again. I fixed this by explicitly saving
|
|
|
9119d9 |
domain's config file. However, I did a bit of clumsy without
|
|
|
9119d9 |
realizing we have a transient domains for which we don't save the
|
|
|
9119d9 |
config file. Hence, any domain using UEFI became persistent.
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
9119d9 |
(cherry picked from commit 54ddc08ddb3d86e90b48b655a51577761e20ac34)
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_process.c | 11 ++++++-----
|
|
|
9119d9 |
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
9119d9 |
index 3eb1036..d6e10e3 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_process.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_process.c
|
|
|
9119d9 |
@@ -3898,13 +3898,13 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver,
|
|
|
9119d9 |
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg,
|
|
|
9119d9 |
- virDomainDefPtr def,
|
|
|
9119d9 |
+ virDomainObjPtr vm,
|
|
|
9119d9 |
bool migrated)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
int ret = -1;
|
|
|
9119d9 |
int srcFD = -1;
|
|
|
9119d9 |
int dstFD = -1;
|
|
|
9119d9 |
- virDomainLoaderDefPtr loader = def->os.loader;
|
|
|
9119d9 |
+ virDomainLoaderDefPtr loader = vm->def->os.loader;
|
|
|
9119d9 |
bool generated = false;
|
|
|
9119d9 |
bool created = false;
|
|
|
9119d9 |
|
|
|
9119d9 |
@@ -3931,12 +3931,13 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg,
|
|
|
9119d9 |
if (!loader->nvram) {
|
|
|
9119d9 |
if (virAsprintf(&loader->nvram,
|
|
|
9119d9 |
"%s/lib/libvirt/qemu/nvram/%s_VARS.fd",
|
|
|
9119d9 |
- LOCALSTATEDIR, def->name) < 0)
|
|
|
9119d9 |
+ LOCALSTATEDIR, vm->def->name) < 0)
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
|
|
|
9119d9 |
generated = true;
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (virDomainSaveConfig(cfg->configDir, def) < 0)
|
|
|
9119d9 |
+ if (vm->persistent &&
|
|
|
9119d9 |
+ virDomainSaveConfig(cfg->configDir, vm->def) < 0)
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
@@ -4101,7 +4102,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|
|
9119d9 |
* Fill them in prior to setting the domain def as transient. */
|
|
|
9119d9 |
VIR_DEBUG("Generating paths");
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (qemuPrepareNVRAM(cfg, vm->def, migrateFrom) < 0)
|
|
|
9119d9 |
+ if (qemuPrepareNVRAM(cfg, vm, migrateFrom) < 0)
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
|
|
|
9119d9 |
/* Do this upfront, so any part of the startup process can add
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.3
|
|
|
9119d9 |
|