From: John Ferlan Date: Mon, 2 May 2016 17:20:55 +0000 (-0400) Subject: qemu: Move qemuDomainSecretPrepare to qemuProcessPrepareDomain X-Git-Tag: v1.3.5-rc1~361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3619be49718319443790bae1daeb2af361c87126;p=thirdparty%2Flibvirt.git qemu: Move qemuDomainSecretPrepare to qemuProcessPrepareDomain Commit id '40d8e2ba3' added the function to qemuProcessStart because in order to set up some secrets in the future we will need the master key. However, since the previous patch split the master key creation into two parts (create just the key and create the file), we can now call qemuDomainSecretPrepare from qemuProcessPrepareDomain since the file is not necessary. Signed-off-by: John Ferlan --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 972bc571e5..ba6c93f267 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5150,6 +5150,10 @@ qemuProcessPrepareDomain(virConnectPtr conn, if (qemuDomainMasterKeyCreate(vm) < 0) goto cleanup; + VIR_DEBUG("Add secrets to disks and hostdevs"); + if (qemuDomainSecretPrepare(conn, vm) < 0) + goto cleanup; + if (VIR_ALLOC(priv->monConfig) < 0) goto cleanup; @@ -5708,9 +5712,6 @@ qemuProcessStart(virConnectPtr conn, if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0) goto stop; - if (qemuDomainSecretPrepare(conn, vm) < 0) - goto cleanup; - if ((rv = qemuProcessLaunch(conn, driver, vm, asyncJob, incoming, snapshot, vmop, flags)) < 0) { if (rv == -2) @@ -5782,9 +5783,6 @@ qemuProcessCreatePretendCmd(virConnectPtr conn, if (qemuProcessPrepareDomain(conn, driver, vm, flags) < 0) goto cleanup; - if (qemuDomainSecretPrepare(conn, vm) < 0) - goto cleanup; - VIR_DEBUG("Building emulator command line"); cmd = qemuBuildCommandLine(driver, NULL,