提交 2e78c588 编写于 作者: P Peter Krempa

qemu: process: Pass flags to qemuProcessPrepareHost

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.
上级 b8c0262e
...@@ -2687,7 +2687,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, ...@@ -2687,7 +2687,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
if (qemuProcessPrepareDomain(dconn, driver, vm, startFlags) < 0) if (qemuProcessPrepareDomain(dconn, driver, vm, startFlags) < 0)
goto stopjob; goto stopjob;
if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0) if (qemuProcessPrepareHost(driver, vm, startFlags) < 0)
goto stopjob; goto stopjob;
rv = qemuProcessLaunch(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, rv = qemuProcessLaunch(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
......
...@@ -5420,7 +5420,7 @@ qemuProcessPrepareDomain(virConnectPtr conn, ...@@ -5420,7 +5420,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
* qemuProcessPrepareHost: * qemuProcessPrepareHost:
* @driver: qemu driver * @driver: qemu driver
* @vm: domain object * @vm: domain object
* @incoming: true if we are preparing an incoming migration * @flags: qemuProcessStartFlags
* *
* This function groups all code that modifies host system (which also may * 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 * update live XML) to prepare environment for a domain which is about to start
...@@ -5431,7 +5431,7 @@ qemuProcessPrepareDomain(virConnectPtr conn, ...@@ -5431,7 +5431,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
int int
qemuProcessPrepareHost(virQEMUDriverPtr driver, qemuProcessPrepareHost(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
bool incoming) unsigned int flags)
{ {
int ret = -1; int ret = -1;
unsigned int hostdev_flags = 0; unsigned int hostdev_flags = 0;
...@@ -5453,7 +5453,7 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver, ...@@ -5453,7 +5453,7 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver,
VIR_DEBUG("Preparing host devices"); VIR_DEBUG("Preparing host devices");
if (!cfg->relaxedACS) if (!cfg->relaxedACS)
hostdev_flags |= VIR_HOSTDEV_STRICT_ACS_CHECK; hostdev_flags |= VIR_HOSTDEV_STRICT_ACS_CHECK;
if (!incoming) if (flags & VIR_QEMU_PROCESS_START_NEW)
hostdev_flags |= VIR_HOSTDEV_COLD_BOOT; hostdev_flags |= VIR_HOSTDEV_COLD_BOOT;
if (qemuHostdevPrepareDomainDevices(driver, vm->def, priv->qemuCaps, if (qemuHostdevPrepareDomainDevices(driver, vm->def, priv->qemuCaps,
hostdev_flags) < 0) hostdev_flags) < 0)
...@@ -5969,7 +5969,7 @@ qemuProcessStart(virConnectPtr conn, ...@@ -5969,7 +5969,7 @@ qemuProcessStart(virConnectPtr conn,
if (qemuProcessPrepareDomain(conn, driver, vm, flags) < 0) if (qemuProcessPrepareDomain(conn, driver, vm, flags) < 0)
goto stop; goto stop;
if (qemuProcessPrepareHost(driver, vm, !!incoming) < 0) if (qemuProcessPrepareHost(driver, vm, flags) < 0)
goto stop; goto stop;
if ((rv = qemuProcessLaunch(conn, driver, vm, asyncJob, incoming, if ((rv = qemuProcessLaunch(conn, driver, vm, asyncJob, incoming,
......
...@@ -111,7 +111,7 @@ int qemuProcessPrepareDomain(virConnectPtr conn, ...@@ -111,7 +111,7 @@ int qemuProcessPrepareDomain(virConnectPtr conn,
int qemuProcessPrepareHost(virQEMUDriverPtr driver, int qemuProcessPrepareHost(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
bool incoming); unsigned int flags);
int qemuProcessLaunch(virConnectPtr conn, int qemuProcessLaunch(virConnectPtr conn,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册