[libvirt PATCH 0/9] Support libvirt-managed QEMU domain <interface> backed by a passt process
by Laine Stump
passt (https://passt.top) provides a method for connecting a guest to
the larger network without requiring any elevated privileges. This set
of patches allows libvirt/QEMU users to easily configure a QEMU domain to
use passt for the backend of any emulated network interface.
More details are in the individual patches, but the short explanation is that
you will use:
<interface type='user'>
<backend type='passt'>
...
to select the passt backend. (We decided to do it this way since the
concept is so similar to slirp, which was the original "type='user'")
The following caveats currently apply:
1) passt support requires "-netdev stream" in QEMU, which is only
available starting with qemu-7.2.0. So if you want to test these
patches out, you need the latest upstream release of QEMU.
2) SELinux must be set to "permissive". This is of course
temporary. As I understand it, the remedy to this is a new SELinux
profile for the passt binary, which is outside the control of
libvirt and so not something that can be addressed in this patchset
(or any other patch to libvirt).
3) Although there is a a new option for QEMU's -netdev that will tell
QEMU to attempt to reconnect to a new incarnation of the same
socket if passt unexpectedly exits, and a new QEMU event that will
be put into QEMU to inform libvirt that the passt process has
exited (so that it can start a new, identical passt process), I
think this hasn't been pushed upstream yet (??), and I haven't
implemented any support for it here. So, if the passt process
unexpectedly exits, the guest will be without networking. However,
Stefano (passt author) is emphatic that passt will never
unexpectedly exit :-)
passt has *many* other options that libvirt could support, but the
small subset here are the things that seem most useful (and/or were
specifically requested by prospective users of passt). It is always
easier to add more stuff in the future than to remove "mistakes", so I
tried to no go overboard.
Laine Stump (9):
conf: rename virDomainNetBackend* to virDomainNetDriver*
conf: move anonymous backend struct from virDomainNetDef into its own
struct
conf: put interface <backend> parsing/formatting separate functions
conf: add passt XML additions to schema
conf: parse/format passt-related XML additions
qemu: new capability QEMU_CAPS_NETDEV_STREAM
qemu: add passtStateDir to qemu driver config
qemu: hook up passt config to qemu domains
specfile: require passt for the build if fedora >= 36 or rhel >= 9
docs/formatdomain.rst | 95 +++++-
libvirt.spec.in | 7 +
meson.build | 1 +
po/POTFILES | 1 +
src/conf/domain_conf.c | 303 ++++++++++++++++--
src/conf/domain_conf.h | 64 +++-
src/conf/domain_validate.c | 32 +-
src/conf/schemas/domaincommon.rng | 65 ++++
src/conf/virconftypes.h | 6 +
src/libvirt_private.syms | 1 +
src/qemu/meson.build | 2 +
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 11 +-
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 5 +-
src/qemu/qemu_domain.h | 3 +-
src/qemu/qemu_driver.c | 12 +
src/qemu/qemu_extdevice.c | 25 +-
src/qemu/qemu_hotplug.c | 26 +-
src/qemu/qemu_interface.c | 8 +-
src/qemu/qemu_passt.c | 284 ++++++++++++++++
src/qemu/qemu_passt.h | 38 +++
src/qemu/qemu_process.c | 1 +
src/qemu/qemu_validate.c | 9 +-
src/security/virt-aa-helper.c | 2 +-
.../caps_7.2.0.x86_64.xml | 1 +
tests/qemuxml2argvdata/net-user-passt.args | 34 ++
.../net-user-passt.x86_64-latest.args | 37 +++
tests/qemuxml2argvdata/net-user-passt.xml | 57 ++++
tests/qemuxml2argvtest.c | 2 +
tests/qemuxml2xmloutdata/net-user-passt.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
35 files changed, 1087 insertions(+), 60 deletions(-)
create mode 100644 src/qemu/qemu_passt.c
create mode 100644 src/qemu/qemu_passt.h
create mode 100644 tests/qemuxml2argvdata/net-user-passt.args
create mode 100644 tests/qemuxml2argvdata/net-user-passt.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/net-user-passt.xml
create mode 120000 tests/qemuxml2xmloutdata/net-user-passt.xml
--
2.38.1
1 year, 10 months
[PATCH V7 00/12] spec: Decompose the daemon subpackage
by Jim Fehlig
This is V7 of
https://listman.redhat.com/archives/libvir-list/2023-January/236586.html
The end goal is to remove the libvirt-dameon dependency on the various
libvirt-daemon-driver-foo subpackages, allowing installation of a
modular daemon configuration without the traditional monolithic libvirtd.
Changes from V6:
* Revert to including virtlockd and lockd plugin in the hypervisor subpackages
* Add NEWS entry
Jim Fehlig (12):
spec: Move virtlockd to a new subpackage libvirt-daemon-lock
spec: Move virtlogd to a new subpackage libvirt-daemon-log
spec: Move virtproxyd to a new subpackage libvirt-daemon-proxy
spec: Move lockd plugin to a new subpackage
spec: Rename the libvirt-lock-sanlock subpackage
spec: Move common files and dependencies to libvirt-daemon-common
spec: Add module-init-tools dependency to nodedev and lxc drivers
spec: Add numad dependency to qemu and lxc drivers
spec: Remove libvirt-daemon dependency from drivers
spec: Remove libvirt-daemon dependency from hypervisor subpackages
kbase: Update rpm-deployment.rst with new subpackages
NEWS: Mention split of libvirt-daemon subpackage
NEWS.rst | 6 +
docs/kbase/rpm-deployment.rst | 48 +++--
libvirt.spec.in | 331 ++++++++++++++++++++++++----------
3 files changed, 277 insertions(+), 108 deletions(-)
--
2.38.1
1 year, 10 months
[PATCH] docs: drvqemu: Fix a typo
by Han Han
Fixes: a677ea92
Signed-off-by: Han Han <hhan(a)redhat.com>
---
docs/drvqemu.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/drvqemu.rst b/docs/drvqemu.rst
index fa23912937..22d7e6502b 100644
--- a/docs/drvqemu.rst
+++ b/docs/drvqemu.rst
@@ -295,7 +295,7 @@ to ``system_u:object_r:virt_image_t``. In the case of NFS, there is an
alternative option, of enabling the ``virt_use_nfs`` SELinux boolean.
There are some network filesystems, however, that propagate SELinux labels
-properly, just like a local filesystem (e.g. ceph of CIFS). In such case,
+properly, just like a local filesystem (e.g. ceph or CIFS). In such case,
dynamic labelling (described below) might prevent migration of a virtual
machine as new unique SELinux label is assigned to the virtual machine on the
migration destination side. Users are advised to use static labels (``<seclabel
--
2.39.0
1 year, 10 months
[PATCH v1] qemu: block: fix error when blockcopy target is librbd encrypted
by Or Ozeri
Encryption secrets are considered a format dependency, even
when being used by the storage node itself, as in the case of
using encryption engine=librbd.
Currently, the storage node is created (blockdev-add) before
creating the format dependencies (including encryption secrets).
As a result, when trying to perform a blockcopy when the target
disk uses librbd encryption, an error of this form is returned:
"error: internal error: unable to execute QEMU command 'blockdev-add': No secret with id 'libvirt-5-format-encryption-secret0'"
To overcome this error, we change the order of commands so that
format dependencies are created BEFORE creating the storage node.
Signed-off-by: Or Ozeri <oro(a)il.ibm.com>
---
src/qemu/qemu_block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index e865aa17f9..2aafb2fac7 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1490,9 +1490,9 @@ qemuBlockStorageSourceAttachApply(qemuMonitor *mon,
qemuBlockStorageSourceAttachData *data)
{
if (qemuBlockStorageSourceAttachApplyStorageDeps(mon, data) < 0 ||
+ qemuBlockStorageSourceAttachApplyFormatDeps(mon, data) < 0 ||
qemuBlockStorageSourceAttachApplyStorage(mon, data) < 0 ||
qemuBlockStorageSourceAttachApplyStorageSlice(mon, data) < 0 ||
- qemuBlockStorageSourceAttachApplyFormatDeps(mon, data) < 0 ||
qemuBlockStorageSourceAttachApplyFormat(mon, data) < 0)
return -1;
--
2.25.1
1 year, 10 months
[libvirt PATCH] ci: integration: Set an expiration on logs artifacts
by Erik Skultety
The default expiry time is 30 days. Since the RPM artifacts coming from
the previous pipeline stages are set to expire in 1 day we can set the
failed integration job log artifacts to the same value. The sentiment
here is that if an integration job legitimately failed (i.e. not with
an infrastructure failure) unless it was fixed in the meantime it will
fail the next day with the scheduled pipeline again, meaning, that even
if the older log artifacts are removed, they'll be immediately
replaced with fresh ones.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
If you look at:
- https://gitlab.com/libvirt/libvirt/-/jobs/3563902921
- https://gitlab.com/libvirt/libvirt/-/jobs/3557946738
you can clearly see that the artifacts are still taking up (although small)
some GitLab storage space which is unnecessary since anyone interested in
debugging would opt into getting the latest ones anyway.
ci/integration-template.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/ci/integration-template.yml b/ci/integration-template.yml
index 61cd034009..9141d5cedf 100644
--- a/ci/integration-template.yml
+++ b/ci/integration-template.yml
@@ -94,6 +94,7 @@
SCRATCH_DIR: "/tmp/scratch"
artifacts:
name: logs
+ expire_in: 1 day
paths:
- logs
when: on_failure
--
2.39.0
1 year, 10 months
[libvirt PATCH] NEWS: document external swtpm backend addition
by Ján Tomko
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 768208ed03..8482c49b3c 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -33,6 +33,11 @@ v9.0.0 (unreleased)
<backend type='passt'>
...
+ * QEMU: add external backend for swtpm
+
+ Connecting the VM to a swtpm daemon started outside of libvirt
+ is now possible.
+
* **Improvements**
* qemu: Prefer PNG for domain screenshots
--
2.39.0
1 year, 10 months
[libvirt PATCH] conf: Avoid NULL dereference in virDomainNetPortForwardFree
by Jiri Denemark
In our current code the function is not called with NULL argument, but
we should follow our common practice and make it safe anyway.
Reported by coverity:
/src/conf/domain_conf.c: 2635 in virDomainNetPortForwardFree()
2629 {
2630 size_t i;
2631
2632 if (pf)
2633 g_free(pf->dev);
2634
>>> CID 404359: Null pointer dereferences (FORWARD_NULL)
>>> Dereferencing null pointer "pf".
2635 for (i = 0; i < pf->nRanges; i++)
2636 g_free(pf->ranges[i]);
2637
2638 g_free(pf->ranges);
2639 g_free(pf);
2640 }
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_conf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 598e23b005..e43dee1a60 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2629,8 +2629,10 @@ virDomainNetPortForwardFree(virDomainNetPortForward *pf)
{
size_t i;
- if (pf)
- g_free(pf->dev);
+ if (!pf)
+ return;
+
+ g_free(pf->dev);
for (i = 0; i < pf->nRanges; i++)
g_free(pf->ranges[i]);
--
2.39.0
1 year, 10 months
[PATCH v2] qemu: add append mode config for serial file
by Oleg Vasilev
Serial log file contains lots of useful information for debugging
configuration problems. It makes sense to preserve the log in between
restarts, so that one can later figure out what was going on. Before
that, we could do that on a per-domain basis, now we can configure it
once for all domains.
Signed-off-by: Oleg Vasilev <oleg.vasilev(a)virtuozzo.com>
---
src/qemu/libvirtd_qemu.aug | 3 ++
src/qemu/qemu.conf.in | 9 ++++
src/qemu/qemu_conf.c | 4 ++
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_domain.c | 13 +++++
src/qemu/test_libvirtd_qemu.aug.in | 1 +
tests/qemuxml2argvdata/serial-append.xml | 53 +++++++++++++++++++
.../qemuxml2xmloutdata/serial-append.off.xml | 53 +++++++++++++++++++
tests/qemuxml2xmloutdata/serial-append.on.xml | 53 +++++++++++++++++++
tests/qemuxml2xmloutdata/serial-append.xml | 53 +++++++++++++++++++
tests/qemuxml2xmltest.c | 10 ++++
11 files changed, 254 insertions(+)
create mode 100644 tests/qemuxml2argvdata/serial-append.xml
create mode 100644 tests/qemuxml2xmloutdata/serial-append.off.xml
create mode 100644 tests/qemuxml2xmloutdata/serial-append.on.xml
create mode 100644 tests/qemuxml2xmloutdata/serial-append.xml
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index ed097ea3d9..7f3eec7cfd 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -147,6 +147,8 @@ module Libvirtd_qemu =
let capability_filters_entry = str_array_entry "capability_filters"
+ let serial_file_append_entry = str_entry "serial_file_append"
+
(* Each entry in the config is one of the following ... *)
let entry = default_tls_entry
| vnc_entry
@@ -171,6 +173,7 @@ module Libvirtd_qemu =
| swtpm_entry
| capability_filters_entry
| obsolete_entry
+ | serial_file_append_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 3895d42514..9c9a535e8d 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -968,3 +968,12 @@
# "full" - both QEMU and its helper processes are placed into separate
# scheduling group
#sched_core = "none"
+
+# Default append mode for writing to serial file. QEMU will set the chosen
+# value everytime it processes the config, unless some value is already there.
+#
+# Possible options are:
+# "default" - leave as-is for QEMU to decide.
+# "on" - set append value to "on", meaning file won't be truncated on restart
+# "off" - set append value to "off", file will be cleared on restart
+#serial_file_append = "default"
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index ae5bbcd138..bfd93a168f 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -288,6 +288,7 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
return NULL;
cfg->deprecationBehavior = g_strdup("none");
+ cfg->serialFileAppend = g_strdup("default");
return g_steal_pointer(&cfg);
}
@@ -376,6 +377,7 @@ static void virQEMUDriverConfigDispose(void *obj)
g_strfreev(cfg->capabilityfilters);
g_free(cfg->deprecationBehavior);
+ g_free(cfg->serialFileAppend);
}
@@ -903,6 +905,8 @@ virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfig *cfg,
return -1;
if (virConfGetValueString(conf, "deprecation_behavior", &cfg->deprecationBehavior) < 0)
return -1;
+ if (virConfGetValueString(conf, "serial_file_append", &cfg->serialFileAppend) < 0)
+ return -1;
return 0;
}
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 8cf2dd2ec5..316200f38d 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -229,6 +229,8 @@ struct _virQEMUDriverConfig {
char *deprecationBehavior;
virQEMUSchedCore schedCore;
+
+ char *serialFileAppend;
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDriverConfig, virObjectUnref);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8ae458ae45..0d1fe1ffcc 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -37,6 +37,7 @@
#include "qemu_validate.h"
#include "qemu_namespace.h"
#include "viralloc.h"
+#include "virenum.h"
#include "virlog.h"
#include "virerror.h"
#include "viridentity.h"
@@ -5357,6 +5358,8 @@ qemuDomainChrDefPostParse(virDomainChrDef *chr,
virQEMUDriver *driver,
unsigned int parseFlags)
{
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+
/* Historically, isa-serial and the default matched, so in order to
* maintain backwards compatibility we map them here. The actual default
* will be picked below based on the architecture and machine type. */
@@ -5428,6 +5431,16 @@ qemuDomainChrDefPostParse(virDomainChrDef *chr,
}
}
+
+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
+ chr->source &&
+ chr->source->type == VIR_DOMAIN_CHR_TYPE_FILE &&
+ chr->source->data.file.append == VIR_TRISTATE_SWITCH_ABSENT) {
+
+ chr->source->data.file.append =
+ virTristateSwitchTypeFromString(cfg->serialFileAppend);
+ }
+
return 0;
}
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 1dbd692921..d1ca9c8d3d 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -117,3 +117,4 @@ module Test_libvirtd_qemu =
}
{ "deprecation_behavior" = "none" }
{ "sched_core" = "none" }
+{ "serial_file_append" = "default" }
diff --git a/tests/qemuxml2argvdata/serial-append.xml b/tests/qemuxml2argvdata/serial-append.xml
new file mode 100644
index 0000000000..662a711dd0
--- /dev/null
+++ b/tests/qemuxml2argvdata/serial-append.xml
@@ -0,0 +1,53 @@
+<domain type='qemu'>
+ <name>machine</name>
+ <uuid>2187c512-ff97-47d7-b67c-c02d3bdc219d</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='file'>
+ <source path='/tmp/serial.file'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <serial type='unix'>
+ <source mode='connect' path='/tmp/serial.sock'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='1'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='file'>
+ <source path='/tmp/serial.file'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/serial-append.off.xml b/tests/qemuxml2xmloutdata/serial-append.off.xml
new file mode 100644
index 0000000000..83fd37a0d1
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/serial-append.off.xml
@@ -0,0 +1,53 @@
+<domain type='qemu'>
+ <name>machine</name>
+ <uuid>2187c512-ff97-47d7-b67c-c02d3bdc219d</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='file'>
+ <source path='/tmp/serial.file' append='off'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <serial type='unix'>
+ <source mode='connect' path='/tmp/serial.sock'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='1'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='file'>
+ <source path='/tmp/serial.file' append='off'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/serial-append.on.xml b/tests/qemuxml2xmloutdata/serial-append.on.xml
new file mode 100644
index 0000000000..e54959a725
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/serial-append.on.xml
@@ -0,0 +1,53 @@
+<domain type='qemu'>
+ <name>machine</name>
+ <uuid>2187c512-ff97-47d7-b67c-c02d3bdc219d</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='file'>
+ <source path='/tmp/serial.file' append='on'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <serial type='unix'>
+ <source mode='connect' path='/tmp/serial.sock'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='1'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='file'>
+ <source path='/tmp/serial.file' append='on'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/serial-append.xml b/tests/qemuxml2xmloutdata/serial-append.xml
new file mode 100644
index 0000000000..662a711dd0
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/serial-append.xml
@@ -0,0 +1,53 @@
+<domain type='qemu'>
+ <name>machine</name>
+ <uuid>2187c512-ff97-47d7-b67c-c02d3bdc219d</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='file'>
+ <source path='/tmp/serial.file'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <serial type='unix'>
+ <source mode='connect' path='/tmp/serial.sock'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='isa-serial' port='1'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='file'>
+ <source path='/tmp/serial.file'>
+ <seclabel model='dac' relabel='no'/>
+ </source>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e13da8bd2c..e4ccee0cf7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -915,6 +915,16 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG,
QEMU_CAPS_OBJECT_RNG_EGD);
+ DO_TEST_NOCAPS("serial-append");
+
+ g_free(cfg->serialFileAppend);
+ cfg->serialFileAppend = g_strdup("on");
+ DO_TEST_FULL("serial-append", ".on", WHEN_BOTH, ARG_END);
+
+ g_free(cfg->serialFileAppend);
+ cfg->serialFileAppend = g_strdup("off");
+ DO_TEST_FULL("serial-append", ".off", WHEN_BOTH, ARG_END);
+
DO_TEST_NOCAPS("cpu-numa1");
DO_TEST_NOCAPS("cpu-numa2");
DO_TEST_NOCAPS("cpu-numa-no-memory-element");
--
2.39.0
1 year, 10 months
[PATCH] NEWS: document addition of passt support
by Laine Stump
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
NEWS.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index fecca64344..768208ed03 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -23,6 +23,16 @@ v9.0.0 (unreleased)
``virDomainSnapshotDelete()``. Flags that allow deleting children
or children only are not supported.
+ * QEMU: support passt (https://passt.top)
+
+ passt can be used to connect an emulated network device to the
+ host's network without requiring libvirt to have any sort of
+ elevated privileges. This is configured with::
+
+ <interface type='user'>
+ <backend type='passt'>
+ ...
+
* **Improvements**
* qemu: Prefer PNG for domain screenshots
--
2.38.1
1 year, 10 months