|
|
9119d9 |
From 0d9504047c2f88a6c6ab176784840170a1ef0707 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <0d9504047c2f88a6c6ab176784840170a1ef0707@dist-git>
|
|
|
9119d9 |
From: John Ferlan <jferlan@redhat.com>
|
|
|
9119d9 |
Date: Tue, 28 Oct 2014 22:28:48 -0400
|
|
|
9119d9 |
Subject: [PATCH] hotplug: Check for alias in net detach
|
|
|
9119d9 |
|
|
|
9119d9 |
https://bugzilla.redhat.com/show_bug.cgi?id=1141621
|
|
|
9119d9 |
|
|
|
9119d9 |
If the QEMU_CAPS_DEVICE is set, then ensure the host device alias has
|
|
|
9119d9 |
been properly set before making the calls to detach the device
|
|
|
9119d9 |
|
|
|
9119d9 |
(cherry picked from commit 96af61ddc1d1297200a497eb73628f0c3b0e3ad3)
|
|
|
9119d9 |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_hotplug.c | 6 ++++++
|
|
|
9119d9 |
1 file changed, 6 insertions(+)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
|
9119d9 |
index f1735d7..fd4a8f2 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_hotplug.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_hotplug.c
|
|
|
9119d9 |
@@ -3540,6 +3540,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
|
|
|
9119d9 |
}
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
|
|
9119d9 |
+ !detach->info.alias) {
|
|
|
9119d9 |
+ if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
|
|
|
9119d9 |
+ goto cleanup;
|
|
|
9119d9 |
+ }
|
|
|
9119d9 |
+
|
|
|
9119d9 |
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
|
|
|
9119d9 |
|
|
|
9119d9 |
qemuDomainObjEnterMonitor(driver, vm);
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.3
|
|
|
9119d9 |
|