Pass flags to the function rather than just whether we have incoming
migration. This also enforces correct startup policy for USB devices
when reverting from a snapshot.
---
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_process.c | 8 ++++----
src/qemu/qemu_process.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 078da1dfd..dd60071bf 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2687,7 +2687,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
if (qemuProcessPrepareDomain(dconn, driver, vm, startFlags) < 0)
goto stopjob;
- if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0)
+ if (qemuProcessPrepareHost(driver, vm, startFlags) < 0)
goto stopjob;
rv = qemuProcessLaunch(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7f0ef2664..dfaacbcb9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5411,7 +5411,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
* qemuProcessPrepareHost:
* @driver: qemu driver
* @vm: domain object
- * @incoming: true if we are preparing an incomming migration
+ * @flags: qemuProcessStartFlags
*
* This function groups all code that modifies host system (which also may
* update live XML) to prepare environment for a domain which is about to start
@@ -5422,7 +5422,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
int
qemuProcessPrepareHost(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- bool incoming)
+ unsigned int flags)
{
int ret = -1;
unsigned int hostdev_flags = 0;
@@ -5444,7 +5444,7 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver,
VIR_DEBUG("Preparing host devices");
if (!cfg->relaxedACS)
hostdev_flags |= VIR_HOSTDEV_STRICT_ACS_CHECK;
- if (!incoming)
+ if (flags & VIR_QEMU_PROCESS_START_NEW)
hostdev_flags |= VIR_HOSTDEV_COLD_BOOT;
if (qemuHostdevPrepareDomainDevices(driver, vm->def, priv->qemuCaps,
hostdev_flags) < 0)
@@ -5960,7 +5960,7 @@ qemuProcessStart(virConnectPtr conn,
if (qemuProcessPrepareDomain(conn, driver, vm, flags) < 0)
goto stop;
- if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0)
+ if (qemuProcessPrepareHost(driver, vm, flags) < 0)
goto stop;
if ((rv = qemuProcessLaunch(conn, driver, vm, asyncJob, incoming,
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 667d5c53d..814b86d8a 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -111,7 +111,7 @@ int qemuProcessPrepareDomain(virConnectPtr conn,
int qemuProcessPrepareHost(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- bool incoming);
+ unsigned int flags);
int qemuProcessLaunch(virConnectPtr conn,
virQEMUDriverPtr driver,
--
2.14.1