|
|
acda74 |
From 25de0ead0194159a6d9a769f34ec5b092e9b718c Mon Sep 17 00:00:00 2001
|
|
|
acda74 |
Message-Id: <25de0ead0194159a6d9a769f34ec5b092e9b718c@dist-git>
|
|
|
acda74 |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
Date: Mon, 23 Jan 2023 11:42:18 +0100
|
|
|
acda74 |
Subject: [PATCH] qemu_interface: Fix managed='no' case when creating an
|
|
|
acda74 |
ethernet interface
|
|
|
acda74 |
|
|
|
acda74 |
In a recent commit of v9.0.0-rc1~192 I've tried to forbid case
|
|
|
acda74 |
where a TAP device already exists, but at the same time it's
|
|
|
acda74 |
managed by Libvirt (<interface type='ethernet'>
|
|
|
acda74 |
dev='tap0' managed='yes'/> </interface>). NB, if @managed
|
|
|
acda74 |
attribute is missing then it's assumed to be managed by Libvirt.
|
|
|
acda74 |
|
|
|
acda74 |
Anyway, I've mistakenly put setting of
|
|
|
acda74 |
VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING flag into managed='yes'
|
|
|
acda74 |
branch instead of managed='no' branch in
|
|
|
acda74 |
qemuInterfaceEthernetConnect().
|
|
|
acda74 |
|
|
|
acda74 |
Move the setting of the flag into the correct branch.
|
|
|
acda74 |
|
|
|
acda74 |
Fixes: a2ae3d299cf9c5ada8aa42ec4271748eb479dc27
|
|
|
acda74 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
acda74 |
(cherry picked from commit d6a8b9eef70887e01fa5fd292580e14ca5eab08c)
|
|
|
acda74 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2144738
|
|
|
acda74 |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
acda74 |
---
|
|
|
acda74 |
src/qemu/qemu_interface.c | 5 +++--
|
|
|
acda74 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
acda74 |
|
|
|
acda74 |
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
|
|
|
acda74 |
index b6895cedde..ed2c209167 100644
|
|
|
acda74 |
--- a/src/qemu/qemu_interface.c
|
|
|
acda74 |
+++ b/src/qemu/qemu_interface.c
|
|
|
acda74 |
@@ -443,6 +443,9 @@ qemuInterfaceEthernetConnect(virDomainDef *def,
|
|
|
acda74 |
_("target managed='no' but specified dev doesn't exist"));
|
|
|
acda74 |
goto cleanup;
|
|
|
acda74 |
}
|
|
|
acda74 |
+
|
|
|
acda74 |
+ tap_create_flags |= VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING;
|
|
|
acda74 |
+
|
|
|
acda74 |
if (virNetDevMacVLanIsMacvtap(net->ifname)) {
|
|
|
acda74 |
auditdev = net->ifname;
|
|
|
acda74 |
if (virNetDevMacVLanTapOpen(net->ifname, tapfd, tapfdSize) < 0)
|
|
|
acda74 |
@@ -461,8 +464,6 @@ qemuInterfaceEthernetConnect(virDomainDef *def,
|
|
|
acda74 |
if (!net->ifname)
|
|
|
acda74 |
template_ifname = true;
|
|
|
acda74 |
|
|
|
acda74 |
- tap_create_flags |= VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING;
|
|
|
acda74 |
-
|
|
|
acda74 |
if (virNetDevTapCreate(&net->ifname, tunpath, tapfd, tapfdSize,
|
|
|
acda74 |
tap_create_flags) < 0) {
|
|
|
acda74 |
goto cleanup;
|
|
|
acda74 |
--
|
|
|
acda74 |
2.39.1
|
|
|
acda74 |
|