Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/files/, app-emulation/libvirt/
Date: Fri, 23 Mar 2018 14:06:16
Message-Id: 1521813958.68fdb138b9730d532c38cdf6fcef2a36f37a92cb.tamiko@gentoo
1 commit: 68fdb138b9730d532c38cdf6fcef2a36f37a92cb
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 23 14:00:39 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 23 14:05:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68fdb138
7
8 app-emulation/libvirt: 4.1.0-r2: Apply upstream patch for bridge support
9
10 Apply an upstream patch to reenable bridge support even if
11 USE=-virt-network and automatic network support is compiled out of
12 libvirt
13
14 Thanks to Agostino Sarubbo for upstream report and mentioning the
15 upstream patch.
16
17 Patch: https://www.redhat.com/archives/libvir-list/2018-March/msg01461.html
18 Bug: https://bugs.gentoo.org/650660
19 Bug: https://bugs.gentoo.org/650872
20 Package-Manager: Portage-2.3.24, Repoman-2.3.6
21
22 .../files/libvirt-4.1.0-unbreak_my_bridge.patch | 78 ++++++++++++++++++++++
23 ...irt-4.1.0-r1.ebuild => libvirt-4.1.0-r2.ebuild} | 10 +--
24 2 files changed, 80 insertions(+), 8 deletions(-)
25
26 diff --git a/app-emulation/libvirt/files/libvirt-4.1.0-unbreak_my_bridge.patch b/app-emulation/libvirt/files/libvirt-4.1.0-unbreak_my_bridge.patch
27 new file mode 100644
28 index 00000000000..c4d24ec020b
29 --- /dev/null
30 +++ b/app-emulation/libvirt/files/libvirt-4.1.0-unbreak_my_bridge.patch
31 @@ -0,0 +1,78 @@
32 +[PATCH] conf: avoid reporting errors when network driver is disabled
33 +
34 +In previous releases all these methods were a no-op if the network
35 +driver is disabled. These helper methods are called unconditionally for
36 +all types of network interface, so must be no-ops if missing. Other code
37 +will already generate an error if the network driver is disabled and a
38 +NIC with type=network is used.
39 +
40 +Signed-off-by: Daniel P. Berrangé <berrange redhat com>
41 +---
42 + src/conf/domain_conf.c | 23 +++++++++--------------
43 + 1 file changed, 9 insertions(+), 14 deletions(-)
44 +
45 +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
46 +index c8d051fa9f..79d6bd378e 100644
47 +--- a/src/conf/domain_conf.c
48 ++++ b/src/conf/domain_conf.c
49 +@@ -28979,10 +28979,13 @@ int
50 + virDomainNetAllocateActualDevice(virDomainDefPtr dom,
51 + virDomainNetDefPtr iface)
52 + {
53 ++ /* Just silently ignore if network driver isn't present. If something
54 ++ * has tried to use a NIC with type=network, other code will already
55 ++ * cause an error. This ensures type=bridge doesn't break when
56 ++ * network driver is compiled out.
57 ++ */
58 + if (!netAllocate) {
59 +- virReportError(VIR_ERR_NO_SUPPORT, "%s",
60 +- _("Network device allocation not available"));
61 +- return -1;
62 ++ return 0;
63 + }
64 +
65 + return netAllocate(dom, iface);
66 +@@ -28993,8 +28996,6 @@ virDomainNetNotifyActualDevice(virDomainDefPtr dom,
67 + virDomainNetDefPtr iface)
68 + {
69 + if (!netNotify) {
70 +- virReportError(VIR_ERR_NO_SUPPORT, "%s",
71 +- _("Network device notification not available"));
72 + return;
73 + }
74 +
75 +@@ -29007,9 +29008,7 @@ virDomainNetReleaseActualDevice(virDomainDefPtr dom,
76 + virDomainNetDefPtr iface)
77 + {
78 + if (!netRelease) {
79 +- virReportError(VIR_ERR_NO_SUPPORT, "%s",
80 +- _("Network device release not available"));
81 +- return -1;
82 ++ return 0;
83 + }
84 +
85 + return netRelease(dom, iface);
86 +@@ -29020,9 +29019,7 @@ virDomainNetBandwidthChangeAllowed(virDomainNetDefPtr iface,
87 + virNetDevBandwidthPtr newBandwidth)
88 + {
89 + if (!netBandwidthChangeAllowed) {
90 +- virReportError(VIR_ERR_NO_SUPPORT, "%s",
91 +- _("Network device bandwidth change query not available"));
92 +- return -1;
93 ++ return 0;
94 + }
95 +
96 + return netBandwidthChangeAllowed(iface, newBandwidth);
97 +@@ -29033,9 +29030,7 @@ virDomainNetBandwidthUpdate(virDomainNetDefPtr iface,
98 + virNetDevBandwidthPtr newBandwidth)
99 + {
100 + if (!netBandwidthUpdate) {
101 +- virReportError(VIR_ERR_NO_SUPPORT, "%s",
102 +- _("Network device bandwidth update not available"));
103 +- return -1;
104 ++ return 0;
105 + }
106 +
107 + return netBandwidthUpdate(iface, newBandwidth);
108 +--
109 +2.14.3
110
111 diff --git a/app-emulation/libvirt/libvirt-4.1.0-r1.ebuild b/app-emulation/libvirt/libvirt-4.1.0-r2.ebuild
112 similarity index 97%
113 rename from app-emulation/libvirt/libvirt-4.1.0-r1.ebuild
114 rename to app-emulation/libvirt/libvirt-4.1.0-r2.ebuild
115 index d8baa074cc5..f5fdca4ddcd 100644
116 --- a/app-emulation/libvirt/libvirt-4.1.0-r1.ebuild
117 +++ b/app-emulation/libvirt/libvirt-4.1.0-r2.ebuild
118 @@ -126,6 +126,7 @@ PATCHES=(
119 "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch
120 "${FILESDIR}"/${PN}-3.10.0-r2-fix_paths_for_apparmor.patch
121 "${FILESDIR}"/${PN}-3.1.0-musl-fix-includes.patch # bug #609488
122 + "${FILESDIR}"/${P}-unbreak_my_bridge.patch # bug 650660
123 )
124
125 pkg_setup() {
126 @@ -238,12 +239,6 @@ src_prepare() {
127 }
128
129 src_configure() {
130 - #
131 - # With 4.1.0 we should always enable networking support - otherwise not
132 - # even minimal networking is available. Yes, this degrades
133 - # USE=virt-network to a mere runtime-dep USE flag. But let's keep it
134 - # for compatibility and convenience.
135 - #
136 local myeconfargs=(
137 $(use_with apparmor)
138 $(use_with apparmor apparmor-profiles)
139 @@ -277,6 +272,7 @@ src_configure() {
140 $(use_with udev)
141 $(use_with uml)
142 $(use_with vepa virtualport)
143 + $(use_with virt-network network)
144 $(use_with wireshark-plugins wireshark-dissector)
145 $(use_with xen)
146 $(use_with xen xen-inotify)
147 @@ -284,8 +280,6 @@ src_configure() {
148 $(use_with zeroconf avahi)
149 $(use_with zfs storage-zfs)
150
151 - --with-network
152 -
153 --without-hal
154 --without-netcf
155 --without-sanlock