[PATCH 0/4] Xen: Add support for qemu commandline passthrough
by Jim Fehlig
This patch series introduces support for qemu commandline passthrough to
the xen driver. ATM it uses the same schema extension as the qemu driver,
but it could be changed to something like
xmlns:xen='http://libvirt.org/schemas/domain/xen/1.0' if desired. I didn't
see an immediate benefit to that, other than following the pattern used
by qemu, bhyve, and lxc. Using the same namespace and schema could be
a bit confusing to users, but on the other hand it is just qemu under the
covers. Since Xen does not support passing environment vars or adjusting
qemu's capabilities, the parser will flag attempts at setting those as
errors.
The patch to NEWS.rst is just a reminder for me to create a news entry
and will need rebased once 6.6.0 is out.
Thanks in advance for your comments!
Regards,
Jim
Jim Fehlig (4):
Expose virStringListCopy in libvirt_private.syms
Xen: Add support for qemu command-line passthrough
Xen: Add support for qemu commandline passthrough to config converter
news: Mention support for qemu commandline passthrough in Xen
NEWS.rst | 6 ++
docs/drvxen.html.in | 35 +++++++
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 11 ++-
src/libxl/libxl_conf.h | 8 ++
src/libxl/libxl_domain.c | 99 ++++++++++++++++++++
src/libxl/libxl_domain.h | 1 +
src/libxl/xen_xl.c | 88 +++++++++++++++++
tests/xlconfigdata/test-qemu-passthrough.cfg | 26 +++++
tests/xlconfigdata/test-qemu-passthrough.xml | 53 +++++++++++
tests/xlconfigtest.c | 4 +
11 files changed, 331 insertions(+), 1 deletion(-)
create mode 100644 tests/xlconfigdata/test-qemu-passthrough.cfg
create mode 100644 tests/xlconfigdata/test-qemu-passthrough.xml
--
2.26.2
4 years, 3 months
[PATCH] mdev: fix daemon crash on reattach mdevs
by Binfeng Wu
Causing a crash when virMediatedDeviceListFindIndex because of
some pointers in mgr->activeMediatedHostdevs become dangling
pointers if goto cleanup label in virMediatedDeviceListMarkDevices.
Reproduction scenario:
1. start vm1 with mdev1
2. start vm2 with mdev2, mdev1 (the order cannot be changed)
Backtrace:
#0 0x0000ffffb8c36250 in strcmp
#1 0x0000ffffb9b80754 in virMediatedDeviceListFindIndex
#2 0x0000ffffb9b80870 in virMediatedDeviceListFind
#3 0x0000ffffb9c9e168 in virHostdevReAttachMediatedDevices
#4 0x0000ffff9949f724 in qemuHostdevReAttachMediatedDevices
#5 0x0000ffff9949f7f8 in qemuHostdevReAttachDomainDevices
#6 0x0000ffff994bcd70 in qemuProcessStop
#7 0x0000ffff994bf4e0 in qemuProcessStart
.....
Signed-off-by: Binfeng Wu <wubinfeng(a)huawei.com>
---
src/util/virmdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index b8023dd991..26cb8300ff 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -439,7 +439,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
if (virMediatedDeviceIsUsed(mdev, dst) ||
virMediatedDeviceSetUsedBy(mdev, drvname, domname) < 0)
- goto cleanup;
+ goto rollback;
/* Copy mdev references to the driver list:
* - caller is responsible for NOT freeing devices in @src on success
--
2.26.2.windows.1
4 years, 3 months
[libvirt PATCH v2] port libvirt to Meson build system
by Pavel Hrdina
The second time around I will not post the complete series as it doesn't
make that much sense. Instead I'll post a diff between the two series to
provide the changes between these series together with links to both
versions pushed to gitlab repository.
Patches for v2 are available from my gitlab repository:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to gitlab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/172042918
Patches for v1 are available from different branch 'meson-v1' in the
same repository. You can get the attached diff by running:
git diff meson-v1 meson
During review we discovered some areas that should be improved once the
meson rewrite is merged into libvirt master:
- As of June 2020 we can drop library check for yal2 and use pkg-confg
only check because openSUSE Leap 42.3 is no longer supported by
libvirt and latest SLES 15 was released on 2018-07-16.
- It was suggested to drop README file which is just a link to
README.rst and with meson no longer required as it was with autotools.
- There is a warning while building libvirt:
../tests/qemuxml2xmltest.c: In function ‘mymain’:
../tests/qemuxml2xmltest.c:132:1: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
132 | mymain(void)
| ^~~~~~
- Review discovered that with meson we no longer link with
libnl-route-3. Meson links only with libraries that are actually
required and we never used any symbol from this library so it can
be dropped.
- During review it was pointed out that we can refactor how meson
generates html files by removing meson-html-gen.py and moving the
logic directly to meson.
- There was a question why we install augeas test files so we should
figure out if we need to install them or it can be dropped.
Here is the list of main changes done in v2, I will not list all of them
as it can be easily checked in the diff:
- I've reordered and changed the patches to not break git bisect. Now
patch 'meson: remove automake specific directives' doesn't remove
BUILD_SOURCES because that would break running 'autogen.sh'.
Patch 'meson: m4: drop not relevant m4 files' was renamed to
'meson: drop remaining m4 helper files' and moved at the end of the
series as it would again break running 'autogen.sh'.
Patch 'meson: tests: remove '.libs' from all relevant paths' was moved
in the middle of the series before adding 'src' directory into meson
because it would break running 'make check'.
To not break git bisect we agreed that meson will fail with error
until the whole rewrite is done and we will have a temporary option
'force_incomplete_build' that will skip the error and force to run
meson setup.
I've added a new patch 'meson: add driver_remote option only into meson_options.txt'
to break circular dependency between driver_remote and libssh,
libssh2, sasl and xdr options to make
meson build -Dforce_incomplete_build work properly.
- We started running tests on FreeBSD which discovered an issue with
meson build. Meson defines _FILE_OFFSET_BITS=64 all the time so I had
to introduce a patch that handles this issue:
'meson: tests: virmockstathelpers: replace check for _FILE_OFFSET_BITS'
- All scripts except for meson-python.sh wrapper which sets environment
variables were converted from shell to python.
- Removed autoconf options debug_logs, default_editor and test_suite as
we will not convert them to meson.
- Introduced git_werror meson option to copy the behavior of --werror
option from autotools. It's not the same as with autotools but it is
a close compromise.
- Fixed virt-aa-helper-test which had hard-coded path to compiled
virt-aa-helper binary and that failed with meson.
- Correctly replace all SYSCONFDIR and RUNSTATEDIR in man pages files.
- Changed the way how we run syntax-check. Instead of having single
target it is now part of meson test with suite label 'syntax-checl'.
We will not define sytax-check tests if building from tarball, only
if we are building from git. We use git to get list of files.
- Fixed all issues discovered during review with linking binaries,
missing docs and cpu_map files, typos, etc.
- Meson cross compile configuration files were moved to libvirt-ci.
Pavel
4 years, 3 months
[PATCH v3 0/2] qemu: support shmem device migration
by Wang Xin
Shmem device support property role with 'master'(master=on) or
'peer'(master=off, default mode), which controls to copy the
shared memory on migration to the destination host or not. see
https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/system/ivshmem.rst;h...
The 1st patch add attribute 'role', it based on Martin's old patch
https://www.redhat.com/archives/libvir-list/2016-September/msg00536.html
The 2nd patch remove shmem name check in migraiton, which
allows user change shared memory path on destination host.
v3 -> v2:
1. Correct description of shmem ���role��� attribute. If there is any
mistake in the description, please show me. Sorry for my poor
English :)
2. Remove the inappropriate suggestion in migration log.
3. allow shmem name change in migration, instead add a new
'mem-path' attribute.
v2 -> v1:
Fix ivshmem testcases failure.
Wang Xin (2):
qemu: add support for shmem-{plain, doorbell} role
conf: allow shmem name change in migration
docs/formatdomain.html.in | 13 ++++++-
docs/schemas/domaincommon.rng | 8 ++++
src/conf/domain_conf.c | 37 +++++++++++++++++--
src/conf/domain_conf.h | 10 +++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_command.c | 17 ++++++++-
src/qemu/qemu_migration.c | 20 ++++++++--
.../qemuhotplug-ivshmem-plain-detach.xml | 2 +-
.../qemuhotplug-ivshmem-plain.xml | 2 +-
...qemuhotplug-base-live+ivshmem-doorbell.xml | 2 +-
.../qemuhotplug-base-live+ivshmem-plain.xml | 2 +-
.../shmem-plain-doorbell.args | 6 ++-
.../qemuxml2argvdata/shmem-plain-doorbell.xml | 4 +-
.../shmem-plain-doorbell.xml | 4 +-
tests/qemuxml2xmltest.c | 3 +-
15 files changed, 110 insertions(+), 22 deletions(-)
--
2.23.0
4 years, 3 months
[libvirt PATCH 0/6] ci: clang on linux and more parallelism
by Ján Tomko
Run clang tests on Fedora Rawhide, Centos 8 and Debian 10.
Specify needs: for everything to prevent pointless waiting.
https://gitlab.com/jano.tomko/libvirt/-/pipelines/173023075
Ján Tomko (6):
ci: refresh Dockerfiles
ci: refresh Dockerfiles
ci: add clang jobs
ci: run Cirrus-based builds sooner
ci: specify containter dependencies for all the jobs
ci: run container jobs right away
.gitlab-ci.yml | 76 +++++++++++++++++++
ci/containers/libvirt-centos-7.Dockerfile | 2 +-
ci/containers/libvirt-centos-8.Dockerfile | 2 +-
.../libvirt-centos-stream.Dockerfile | 2 +-
...libvirt-debian-10-cross-aarch64.Dockerfile | 2 +-
.../libvirt-debian-10-cross-armv6l.Dockerfile | 3 +-
.../libvirt-debian-10-cross-armv7l.Dockerfile | 3 +-
.../libvirt-debian-10-cross-i686.Dockerfile | 2 +-
.../libvirt-debian-10-cross-mips.Dockerfile | 2 +-
...ibvirt-debian-10-cross-mips64el.Dockerfile | 2 +-
.../libvirt-debian-10-cross-mipsel.Dockerfile | 2 +-
...libvirt-debian-10-cross-ppc64le.Dockerfile | 2 +-
.../libvirt-debian-10-cross-s390x.Dockerfile | 2 +-
ci/containers/libvirt-debian-10.Dockerfile | 2 +-
...ibvirt-debian-sid-cross-aarch64.Dockerfile | 2 +-
...libvirt-debian-sid-cross-armv6l.Dockerfile | 3 +-
...libvirt-debian-sid-cross-armv7l.Dockerfile | 3 +-
.../libvirt-debian-sid-cross-i686.Dockerfile | 2 +-
...bvirt-debian-sid-cross-mips64el.Dockerfile | 2 +-
...libvirt-debian-sid-cross-mipsel.Dockerfile | 3 +-
...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 2 +-
.../libvirt-debian-sid-cross-s390x.Dockerfile | 2 +-
ci/containers/libvirt-debian-sid.Dockerfile | 2 +-
ci/containers/libvirt-fedora-31.Dockerfile | 2 +-
ci/containers/libvirt-fedora-32.Dockerfile | 2 +-
...rt-fedora-rawhide-cross-mingw32.Dockerfile | 1 +
...rt-fedora-rawhide-cross-mingw64.Dockerfile | 1 +
.../libvirt-fedora-rawhide.Dockerfile | 2 +-
ci/containers/libvirt-opensuse-151.Dockerfile | 2 +-
ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 +-
ci/containers/libvirt-ubuntu-2004.Dockerfile | 2 +-
31 files changed, 111 insertions(+), 28 deletions(-)
--
2.26.2
4 years, 3 months
[PATCH for 6.6.0] NEWS: Document changes for upcoming release
by Michal Privoznik
In contrast with other releases, this time NEWS is pretty much
updated. I've identified only a couple of features/bug fixes
worth mentioning that were not mentioned yet.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
NEWS.rst | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 1314f3e698..d97ca501dc 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -24,6 +24,12 @@ v6.6.0 (unreleased)
MAC addresses that would generate a new one if they were in its OUI
(00:0c:29).
+ * conf: add control over COW for storage pool directories
+
+ The storage pool code now attempts to disable COW by default on btrfs, but
+ management applications may wish to override this behaviour. This is now
+ possible via new ``cow`` element.
+
* **Improvements**
* esx: Change the NIC limit for recent virtualHW versions
@@ -41,6 +47,14 @@ v6.6.0 (unreleased)
The event can now be used also for block copy destinations by using the
index of the ``<mirror>`` image.
+ * qemu: consider available CPUs in ``vcpupin/emulatorpin`` output
+
+ This patch changes the default bitmap of ``vcpupin`` and ``emulatorpin``,
+ in the case of domains with static vcpu placement, all available CPUs
+ instead of all possible CPUs are returned making these APIs consistent with
+ the behavior of ``vcpuinfo``.
+
+
* **Bug fixes**
* virdevmapper: Don't use libdevmapper to obtain dependencies
@@ -61,6 +75,24 @@ v6.6.0 (unreleased)
Starting from libvirt-6.5 an active layer block commit or a block copy could
fail if the same destination was used more than once.
+ * qemu: Don't change ownership of restore file
+
+ When restoring a domain from a file, Libvirt no longer changes its ownership.
+
+ * qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
+
+ The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so prevent
+ the choice of TPM 1.2 when the SPAPR device model is chosen and use a
+ default of '2.0' (TPM 2) for the backend.
+
+ * qemu: Do not set ``//cpu/@migratable`` for running domains
+
+ Libvirt release of 6.4.0 started to fill the default value for
+ ``//cpu/@migratable`` attribute according to QEMU support. However, active
+ domains either have the migratable attribute already set or they were
+ started with older Libvirt which doesn't support the attribute.
+
+
v6.5.0 (2020-07-03)
===================
--
2.26.2
4 years, 3 months
[PATCH] Ignore clangd-related files and folders
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
.gitignore | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.gitignore b/.gitignore
index 6c167e423b18..edc25cb8d0e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,7 @@ Makefile.in
/build/
/ci/scratch/
tags
+
+# clangd related ignores
+.clangd
+compile_commands.json
--
2.28.0
4 years, 3 months
[PATCH] qemu: snapshot: Collect 'query-named-block-nodes' prior to memory migration
by Peter Krempa
When doing an external snapshot we migrate memory to a file as a form of
taking the memory state. This creates a problem as qemu deactivates all
active bitmaps after a successful migration. This means that calling
'query-named-block-nodes' will return an empty list of bitmaps for
devices. We use the bitmap list to propagate the active bitmaps into the
overlay files being created which is required for backups to work after
a snapshot. Since we wouldn't propagate anythign a subsequent backup
will fail with:
invalid argument: missing or broken bitmap 'testchck' for disk 'vda'
To fix this, we can simply collect the bitmap list prior to the
migration.
https://bugzilla.redhat.com/show_bug.cgi?id=1862472
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Note that with current qemu the above steps will still fail as qemu
fails to 'cont' after a migration if backing images contain bitmaps
which is the case here.
See: https://lists.nongnu.org/archive/html/qemu-block/2020-07/msg01833.html
src/qemu/qemu_driver.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0ad6359102..b655df8c98 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15365,6 +15365,7 @@ static int
qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainMomentObjPtr snap,
+ virHashTablePtr blockNamedNodeData,
unsigned int flags,
virQEMUDriverConfigPtr cfg,
qemuDomainAsyncJob asyncJob)
@@ -15378,17 +15379,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
qemuDomainSnapshotDiskDataPtr diskdata = NULL;
size_t ndiskdata = 0;
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
- g_autoptr(virHashTable) blockNamedNodeData = NULL;
if (virDomainObjCheckActive(vm) < 0)
return -1;
actions = virJSONValueNewArray();
- if (blockdev &&
- !(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob)))
- return -1;
-
/* prepare a list of objects to use in the vm definition so that we don't
* have to roll back later */
if (qemuDomainSnapshotDiskPrepare(driver, vm, snap, cfg, reuse, blockdev,
@@ -15455,6 +15451,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
int compressed;
g_autoptr(virCommand) compressor = NULL;
virQEMUSaveDataPtr data = NULL;
+ g_autoptr(virHashTable) blockNamedNodeData = NULL;
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command when it is actually sent to agent.
@@ -15509,6 +15506,13 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
}
}
+ /* We need to collect reply from 'query-named-block-nodes' prior to the
+ * migration step as qemu deactivates bitmaps after migration so the result
+ * would be wrong */
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
+ !(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, QEMU_ASYNC_JOB_SNAPSHOT)))
+ goto cleanup;
+
/* do the memory snapshot if necessary */
if (memory) {
/* check if migration is possible */
@@ -15553,7 +15557,8 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
/* the domain is now paused if a memory snapshot was requested */
- if ((ret = qemuDomainSnapshotCreateDiskActive(driver, vm, snap, flags, cfg,
+ if ((ret = qemuDomainSnapshotCreateDiskActive(driver, vm, snap,
+ blockNamedNodeData, flags, cfg,
QEMU_ASYNC_JOB_SNAPSHOT)) < 0)
goto cleanup;
--
2.26.2
4 years, 3 months
[PATCH] NEWS: Mention fixes and improvements of BLOCK_THRESHOLD and TLS key tencryption
by Peter Krempa
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
NEWS.rst | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 8b53d21b8a..1e4c4df1d6 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -31,6 +31,16 @@ v6.6.0 (unreleased)
Specifying a virtualHW version greater or equal to 7 (ESXi 4.0) will allow
you to use up to 10 NICs instead of 4 as it was previously.
+ * qemu: Support encrypted TLS keys for NBD disks
+
+ The secret key used for disks can now be encrypted similarly to TLS keys
+ used for migration, chardev and others.
+
+ * qemu: VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD can now be registered for <mirror>
+
+ The event can now be used also for block copy destinations by using the
+ index of the <mirror> image.
+
* **Bug fixes**
* virdevmapper: Don't use libdevmapper to obtain dependencies
@@ -40,6 +50,16 @@ v6.6.0 (unreleased)
meant that libdevmapper opened ``/dev/mapper/control`` which wasn't closed
and was leaked to QEMU. CVE-2020-14339
+ * qemu: Report correct index in VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
+
+ Starting from libvirt-5.10 with qemu-4.2 the
+ VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event would report incorrect device
+ index when reported for an image from the backing chain of a disk.
+
+ * qemu: Don't fail active layer block commit or block copy in certain cases
+
+ Starting from libvirt-6.5 an active layer block commit or a block copy could
+ fail if the same destination was used more than once.
v6.5.0 (2020-07-03)
===================
--
2.26.2
4 years, 3 months
[PATCH v2 0/4] bhyve: implement sound device support
by Roman Bogorodskiy
Changes from v1:
Main change is the addition of the "<audio>" element that
allows to map the "<sound>" device to the host audio backend.
Would appreciate initial feedback on this one, and then I'll proceed
with adding more validation.
Roman Bogorodskiy (4):
bhyve: implement sound device support
conf: allow to map sound device to host device
bhyve: allow to specify host sound device
tests: schema: test bhyvexml2xmloutdata schemas
docs/schemas/domaincommon.rng | 36 ++++
src/bhyve/bhyve_capabilities.c | 14 ++
src/bhyve/bhyve_capabilities.h | 1 +
src/bhyve/bhyve_command.c | 64 +++++++
src/bhyve/bhyve_device.c | 9 +
src/conf/domain_capabilities.c | 4 +
src/conf/domain_conf.c | 156 +++++++++++++++++-
src/conf/domain_conf.h | 24 +++
src/conf/virconftypes.h | 3 +
src/libvirt_private.syms | 2 +
src/qemu/qemu_command.c | 1 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain_address.c | 2 +
src/qemu/qemu_driver.c | 5 +
src/qemu/qemu_hotplug.c | 3 +
src/qemu/qemu_validate.c | 1 +
.../bhyvexml2argv-sound.args | 10 ++
.../bhyvexml2argv-sound.ldargs | 3 +
.../bhyvexml2argvdata/bhyvexml2argv-sound.xml | 30 ++++
tests/bhyvexml2argvtest.c | 6 +-
.../bhyvexml2xmlout-sound.xml | 41 +++++
tests/bhyvexml2xmltest.c | 1 +
tests/virschematest.c | 3 +-
23 files changed, 416 insertions(+), 4 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-sound.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-sound.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-sound.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-sound.xml
--
2.27.0
4 years, 3 months