Blame SOURCES/libvirt-qemu-always-call-qemuInterfaceStartDevices-when-starting-CPUs.patch

9119d9
From d901bf4a3f8da16ab50ddf2dc955e6d40cbe451f Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <d901bf4a3f8da16ab50ddf2dc955e6d40cbe451f@dist-git>
9119d9
From: Laine Stump <laine@laine.org>
9119d9
Date: Sun, 14 Dec 2014 23:44:50 -0500
9119d9
Subject: [PATCH] qemu: always call qemuInterfaceStartDevices() when starting
9119d9
 CPUs
9119d9
9119d9
The patch that added qemuInterfaceStartDevices() (upstream commit
9119d9
82977058f5b1d143a355079900029e9cbfee2fe4) had an extra conditional to
9119d9
prevent calling it if the reason for starting the CPUs was
9119d9
VIR_DOMAIN_RUNNING_UNPAUSED or VIR_DOMAIN_RUNNING_SAVE_CANCELED.  This
9119d9
was put in by the author as the result of a reviewer asking if it was
9119d9
necessary to ifup the interfaces in *all* occasions (because these
9119d9
were the two cases where the CPU would have already been started (and
9119d9
stopped) once, so the interface would already be ifup'ed).
9119d9
9119d9
It turns out that, as long as there is no corresponding
9119d9
qemuInterfaceStopDevices() to ifdown the interfaces anytime the CPUs
9119d9
are stopped, neglecting to ifup when reason is RUNNING_UNPAUSED or
9119d9
RUNNING_SAVE_CANCELED doesn't cause any problems (because it just
9119d9
happens that the interface will have already been ifup'ed by a prior
9119d9
call when the CPU was previously started for some other reason).
9119d9
9119d9
However, it also doesn't *help*, and there will soon be a
9119d9
qemuInterfaceStopDevices() function which *will* ifdown these
9119d9
interfaces when the guest CPUs are stopped, and once that is done, the
9119d9
interfaces will be left down in some cases when they should be up (for
9119d9
example, if a domain is paused and then unpaused).
9119d9
9119d9
So, this patch is removing the condition in favor of always calling
9119d9
qemuInterfaeStartDevices() when the guest CPUs are started.
9119d9
9119d9
This patch (and the aforementioned patch) resolve:
9119d9
9119d9
  https://bugzilla.redhat.com/show_bug.cgi?id=1081461
9119d9
9119d9
(cherry picked from commit 879c13d6cc92b6c3d97168e822201e5d00c4a1bc)
9119d9
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_process.c | 4 +---
9119d9
 1 file changed, 1 insertion(+), 3 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9119d9
index dd74432..627755d 100644
9119d9
--- a/src/qemu/qemu_process.c
9119d9
+++ b/src/qemu/qemu_process.c
9119d9
@@ -3114,9 +3114,7 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
9119d9
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
9119d9
 
9119d9
     /* Bring up netdevs before starting CPUs */
9119d9
-    if (reason != VIR_DOMAIN_RUNNING_UNPAUSED &&
9119d9
-        reason != VIR_DOMAIN_RUNNING_SAVE_CANCELED &&
9119d9
-        qemuInterfaceStartDevices(vm->def) < 0)
9119d9
+    if (qemuInterfaceStartDevices(vm->def) < 0)
9119d9
        goto cleanup;
9119d9
 
9119d9
     VIR_DEBUG("Using lock state '%s'", NULLSTR(priv->lockState));
9119d9
-- 
9119d9
2.2.0
9119d9