[libvirt] [PATCH 0/9] support use of precreated tap devices from unprivileged libvirtd
by Laine Stump
This resolves https://bugzilla.redhat.com/1723367
It has become more popular to run libvirtd in an unprivileged
environment (e.g. inside a container), but until now the only possible
types of network connection for a qemu started by an unprivileged
libvirtd were:
1) a usermode slirp connection
2) a tap device connection to a bridge handled by running
qemu-bridge-helper (a suid-root utility distributed with qemu)
3) a host network card assigned to the guest using VFIO (this requires
special setup by a privileged process though)
This patch series remedies that by making it possible for libvirtd to
use a tap device that has been pre-created (*and* properly setup) by
some other process beforehand.
In order to use this, you must have a standard tap, or macvtap device
that has been set to be owned by the uid that will be running
libvirtd, has its MAC address already set, and has been set online
(IFF_UP). For example, here are the commands to create a standard tap
device named "mytap0", attach it to the host bridge device "br0" and
prepare it for use by a libvirtd that is running as user "laine":
ip tuntap add mode tap user laine group laine name mytap0
ip link set mytap0 up
ip link set mytap0 master br0
(You may want to set a specific MAC address for the tap device, but as
long as it *doesn't* match the MAC address used by the guest emulated
device, it really doesn't matter)
You can now add the following <interface> to a domain definition:
<interface type='ethernet'>
<model type='virtio'/>
<mac address='52:54:00:11:11:11'/>
<target dev='mytap0' managed='no'/>
</interface>
and start up the guest.
A similar set of commands to create a macvtap device named
"mymacvtap0" with MAC addres 52:54:00:11:11:11 connected to the host
device "en2" would be something like this:
ip link add link en2 name mymacvtap0 address 52:54:00:11:11:11 \
type macvtap mode bridge
ip link set mymacvtap0 up
The XML would be identical, except the name of the device
<interface type='ethernet'>
<model type='virtio'/>
<mac address='52:54:00:11:11:11'/>
<target dev='mymacvtap0' managed='no'/>
</interface>
(Note that in the case of macvtap, the precreated device must *match*
the MAC address of the emulated guest device).
If libvirtd is given a precreated device, that device will *not* be
explicitly deleted when qemu is finished with it - the caller must
take care of that.
Laine Stump (9):
util: new function virNetDevMacVLanIsMacvtap()
util: make a couple virNetDevMacVlan*() functions public
qemu: reorganize qemuInterfaceEthernetConnect()
conf: use virXMLFormatElement for interface <target>
conf: new "managed" attribute for target dev of <interface
type='ethernet'>
qemu: support unmanaged target tap dev for <interface type='ethernet'>
qemu: support unmanaged macvtap devices with <interface
type='ethernet'>
qemu: explicitly delete standard tap devices only on platforms that
require it
docs: update news file
docs/formatdomain.html.in | 48 +++++++---
docs/news.xml | 13 +++
docs/schemas/domaincommon.rng | 5 ++
src/conf/domain_conf.c | 55 +++++++++---
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_interface.c | 89 ++++++++++++-------
src/qemu/qemu_process.c | 6 +-
src/util/virnetdev.h | 2 +-
src/util/virnetdevmacvlan.c | 35 ++++++--
src/util/virnetdevmacvlan.h | 12 +++
.../net-eth-unmanaged-tap.args | 32 +++++++
.../net-eth-unmanaged-tap.xml | 35 ++++++++
tests/qemuxml2argvmock.c | 16 +++-
tests/qemuxml2argvtest.c | 1 +
.../net-eth-unmanaged-tap.xml | 40 +++++++++
tests/qemuxml2xmltest.c | 1 +
17 files changed, 329 insertions(+), 65 deletions(-)
create mode 100644 tests/qemuxml2argvdata/net-eth-unmanaged-tap.args
create mode 100644 tests/qemuxml2argvdata/net-eth-unmanaged-tap.xml
create mode 100644 tests/qemuxml2xmloutdata/net-eth-unmanaged-tap.xml
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v2 0/2] news: Update for 5.9.0 release
by Andrea Bolognani
You know the drill.
Andrea Bolognani (2):
news: Document more possible sections
news: Update for 5.9.0 release
docs/news.xml | 103 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 101 insertions(+), 2 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] docs: Fix attribute names in filesystem/driver example
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7619c88514..84257c1bb4 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3847,7 +3847,7 @@
<readonly/>
</filesystem>
<filesystem type='file' accessmode='passthrough'>
- <driver name='loop' type='raw'/>
+ <driver type='loop' format='raw'/>
<driver type='path' wrpolicy='immediate'/>
<source file='/export/to/guest.img'/>
<target dir='/import/from/host'/>
--
2.23.0
5 years, 5 months
[libvirt] [PATCH Rust] api_tests.py: update to use Python 3
by liushuyu@aosc.io
From: liushuyu <liushuyu011(a)gmail.com>
---
tools/api_tests.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/api_tests.py b/tools/api_tests.py
index b26ec34..9e66c92 100644
--- a/tools/api_tests.py
+++ b/tools/api_tests.py
@@ -47,10 +47,10 @@ def main():
else:
missing.add(el)
- print "missing: %s, implemented: %s" % (len(missing), len(implemented))
- print "missing:"
+ print("missing: %s, implemented: %s" % (len(missing), len(implemented)))
+ print("missing:")
for x in missing:
- print x.attrib
+ print(x.attrib)
#print "implemented:"
#for x in implemented:
# print x.attrib
--
2.23.0
5 years, 5 months
[libvirt] [PATCH Rust] api_tests.py: update to use Python 3
by liushuyu@aosc.io
From: liushuyu <liushuyu011(a)gmail.com>
---
tools/api_tests.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/api_tests.py b/tools/api_tests.py
index b26ec34..9e66c92 100644
--- a/tools/api_tests.py
+++ b/tools/api_tests.py
@@ -47,10 +47,10 @@ def main():
else:
missing.add(el)
- print "missing: %s, implemented: %s" % (len(missing), len(implemented))
- print "missing:"
+ print("missing: %s, implemented: %s" % (len(missing), len(implemented)))
+ print("missing:")
for x in missing:
- print x.attrib
+ print(x.attrib)
#print "implemented:"
#for x in implemented:
# print x.attrib
--
2.23.0
5 years, 5 months
[libvirt] [PULL 0/9] Ide patches
by John Snow
The following changes since commit 68d8ef4ec540682c3538d4963e836e43a211dd17:
Merge remote-tracking branch 'remotes/stsquad/tags/pull-tcg-plugins-281019-4' into staging (2019-10-30 14:10:32 +0000)
are available in the Git repository at:
https://github.com/jnsnow/qemu.git tags/ide-pull-request
for you to fetch changes up to c35564caf20e8d3431786dddf0fa513daa7d7f3c:
hd-geo-test: Add tests for lchs override (2019-10-31 06:11:34 -0400)
----------------------------------------------------------------
Pull request
----------------------------------------------------------------
John Snow (1):
IDE: deprecate ide-drive
Sam Eiderman (8):
block: Refactor macros - fix tabbing
block: Support providing LCHS from user
bootdevice: Add interface to gather LCHS
scsi: Propagate unrealize() callback to scsi-hd
bootdevice: Gather LCHS from all relevant devices
bootdevice: Refactor get_boot_devices_list
bootdevice: FW_CFG interface for LCHS values
hd-geo-test: Add tests for lchs override
qemu-deprecated.texi | 5 +
include/hw/block/block.h | 22 +-
include/hw/scsi/scsi.h | 1 +
include/sysemu/sysemu.h | 4 +
bootdevice.c | 147 +++++++--
hw/block/virtio-blk.c | 6 +
hw/ide/qdev.c | 10 +-
hw/nvram/fw_cfg.c | 14 +-
hw/scsi/scsi-bus.c | 16 +
hw/scsi/scsi-disk.c | 12 +
tests/hd-geo-test.c | 551 ++++++++++++++++++++++++++++++++++
tests/Makefile.include | 2 +-
tests/qemu-iotests/051.pc.out | 6 +-
13 files changed, 753 insertions(+), 43 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH 0/2] Doc fix and news entry for Xen ACPI support
by Jim Fehlig
I was jetlagged and not thinking clearly when I pushed Marek's patches that add support for specifying ACPI firmware path in the libxl driver. I pushed them outside of my usual dev setup hence misssed Reviewed-by: tags and forgot to update the docs with s/5.8.0/5.9.0/. There's nothing I can do about the former, but the latter can be fixed with trivial patch 1. Patch 2 adds a news entry.
Jim Fehlig (2):
docs: Fix version that introduced Xen support for ACPI firmware
news: Add entry for ACPI firmware support in Xen
docs/formatdomain.html.in | 2 +-
docs/news.xml | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
--
2.23.0
5 years, 5 months