提交 879c13d6 编写于 作者: L Laine Stump

qemu: always call qemuInterfaceStartDevices() when starting CPUs

The patch that added qemuInterfaceStartDevices() (upstream commit
82977058) had an extra conditional to
prevent calling it if the reason for starting the CPUs was
VIR_DOMAIN_RUNNING_UNPAUSED or VIR_DOMAIN_RUNNING_SAVE_CANCELED.  This
was put in by the author as the result of a reviewer asking if it was
necessary to ifup the interfaces in *all* occasions (because these
were the two cases where the CPU would have already been started (and
stopped) once, so the interface would already be ifup'ed).

It turns out that, as long as there is no corresponding
qemuInterfaceStopDevices() to ifdown the interfaces anytime the CPUs
are stopped, neglecting to ifup when reason is RUNNING_UNPAUSED or
RUNNING_SAVE_CANCELED doesn't cause any problems (because it just
happens that the interface will have already been ifup'ed by a prior
call when the CPU was previously started for some other reason).

However, it also doesn't *help*, and there will soon be a
qemuInterfaceStopDevices() function which *will* ifdown these
interfaces when the guest CPUs are stopped, and once that is done, the
interfaces will be left down in some cases when they should be up (for
example, if a domain is paused and then unpaused).

So, this patch is removing the condition in favor of always calling
qemuInterfaeStartDevices() when the guest CPUs are started.

This patch (and the aforementioned patch) resolve:

  https://bugzilla.redhat.com/show_bug.cgi?id=1081461
上级 c7d1c139
......@@ -3126,9 +3126,7 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
/* Bring up netdevs before starting CPUs */
if (reason != VIR_DOMAIN_RUNNING_UNPAUSED &&
reason != VIR_DOMAIN_RUNNING_SAVE_CANCELED &&
qemuInterfaceStartDevices(vm->def) < 0)
if (qemuInterfaceStartDevices(vm->def) < 0)
goto cleanup;
VIR_DEBUG("Using lock state '%s'", NULLSTR(priv->lockState));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册