[PATCH] news: document `virsh console --resume` and `virsh (start|create) --console`
by Marc Hartmayer
Document the following changes:
+ added `virsh console --resume` subcommand option
+ improved `virsh start --console` behavior
+ improved `virsh create --console` behavior
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
---
NEWS.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index fbdd9674a329..9d00616cd9b1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -25,8 +25,23 @@ v9.9.0 (unreleased)
guest features to see if the current libvirt supports both deleting
and reverting external snapshots.
+ * virsh: add ``console --resume`` support
+
+ The ``virsh console`` subcommand now accepts a ``--resume`` option. This
+ will resume a paused guest after connecting to the console.
+
* **Improvements**
+ * virsh: Improve ``virsh start --console`` behavior
+
+ The ``virsh start --console`` now tries to connect to the guest console
+ before starting the vCPUs.
+
+ * virsh: Improve ``virsh create --console`` behavior
+
+ The ``virsh create --console`` now tries to connect to the guest console
+ before starting the vCPUs.
+
* **Bug fixes**
--
2.34.1
1 year, 1 month
[PATCH libvirt v1 0/3] Ensure full early console access with libvirt
by Marc Hartmayer
Currently, early console output may be lost, e.g. if starting a guest with
`virsh start --console` guest, which can make debugging of early failures very
difficult
(like zipl messages or disabled wait conditions happening early). This is
because QEMU may emit serial console output before the libvirt console client
starts to consume data from the pts. This can be prevented by starting the guest
in paused state, connect to the console and then resume the guest.
Note: There is still a problem in QEMU itself, see QEMU patch series `[PATCH]
chardev/char-pty: Avoid losing bytes when the other side just (re-)connected`
[1]
Changelog:
RFCv1->v1:
+ rebased on current master
+ worked in comments from Daniel
[1] https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg02725.html
Marc Hartmayer (3):
virsh: add `console --resume` support
Improve `virsh start --console` behavior
Improve `virsh create --console` behavior
tools/virsh-console.c | 8 ++++
tools/virsh-console.h | 1 +
tools/virsh-domain.c | 94 ++++++++++++++++++++++++++++++++-----------
3 files changed, 80 insertions(+), 23 deletions(-)
base-commit: dd403f8873cf8de7675b89ed757a4228af7bc05e
--
2.34.1
1 year, 1 month
[libvirt PATCH 00/11] systemd: Further improvements
by Andrea Bolognani
This series addresses two pieces of feedback from my recent systemd
changes: that some settings, such as LimitNOFILE, where still being
repeated verbatim in multiple locations, and that only having the
foo.{service,socket}.extra.in files for some services and not others
could be confusing.
Andrea Bolognani (11):
systemd: libvirtd doesn't need @sockprefix@
systemd: Support merging multiple units
systemd: Accept multiple files for service_extra_in/socket_extra_in
systemd: Introduce systemd_service_limitnofile_extra
systemd: Introduce systemd_service_taskmax_extra
systemd: Introduce systemd_service_limitmemlock_extra
systemd: Introduce systemd_service_oomscoreadjust_extra
systemd: Allow comments at the top of units
systemd: Set service_extra_in/socket_extra_in everywhere
systemd: Make service_extra_in/socket_extra_in required
systemd: Tweak service definitions
scripts/merge-systemd-units.py | 20 +++++++---
src/ch/meson.build | 10 ++++-
src/ch/virtchd.service.extra.in | 18 ++-------
src/ch/virtchd.socket.extra.in | 2 +
src/interface/meson.build | 6 +++
src/interface/virtinterfaced.service.extra.in | 2 +
src/interface/virtinterfaced.socket.extra.in | 2 +
src/libxl/meson.build | 8 +++-
src/libxl/virtxend.service.extra.in | 3 ++
src/libxl/virtxend.socket.extra.in | 3 ++
src/locking/meson.build | 10 ++++-
src/locking/virtlockd.service.extra.in | 2 +
src/locking/virtlockd.service.in | 8 ----
src/locking/virtlockd.socket.extra.in | 2 +
src/logging/meson.build | 10 ++++-
src/logging/virtlogd.service.extra.in | 2 +
src/logging/virtlogd.service.in | 8 ----
src/logging/virtlogd.socket.extra.in | 2 +
src/lxc/meson.build | 10 ++++-
src/lxc/virtlxcd.service.extra.in | 18 ++-------
src/lxc/virtlxcd.socket.extra.in | 2 +
src/meson.build | 40 ++++++++++---------
src/network/meson.build | 7 +++-
src/network/virtnetworkd.service.extra.in | 3 ++
src/network/virtnetworkd.socket.extra.in | 2 +
src/node_device/meson.build | 6 +++
src/node_device/virtnodedevd.service.extra.in | 2 +
src/node_device/virtnodedevd.socket.extra.in | 2 +
src/nwfilter/meson.build | 6 +++
src/nwfilter/virtnwfilterd.service.extra.in | 2 +
src/nwfilter/virtnwfilterd.socket.extra.in | 2 +
src/qemu/meson.build | 10 ++++-
src/qemu/virtqemud.service.extra.in | 18 ++-------
src/qemu/virtqemud.socket.extra.in | 2 +
src/remote/libvirtd.service.extra.in | 2 +
src/remote/libvirtd.service.in | 15 -------
src/remote/libvirtd.socket.extra.in | 2 +
src/remote/meson.build | 18 ++++++++-
src/remote/virtproxyd.service.extra.in | 2 +
src/remote/virtproxyd.socket.extra.in | 2 +
src/secret/meson.build | 6 +++
src/secret/virtsecretd.service.extra.in | 2 +
src/secret/virtsecretd.socket.extra.in | 2 +
src/storage/meson.build | 7 +++-
src/storage/virtstoraged.service.extra.in | 3 ++
src/storage/virtstoraged.socket.extra.in | 2 +
src/vbox/meson.build | 7 +++-
src/vbox/virtvboxd.service.extra.in | 3 ++
src/vbox/virtvboxd.socket.extra.in | 2 +
src/virtd.service.limitmemlock.extra.in | 7 ++++
src/virtd.service.limitnofile.extra.in | 5 +++
src/virtd.service.oomscoreadjust.extra.in | 5 +++
src/virtd.service.tasksmax.extra.in | 6 +++
src/vz/meson.build | 7 +++-
src/vz/virtvzd.service.extra.in | 3 ++
src/vz/virtvzd.socket.extra.in | 2 +
56 files changed, 248 insertions(+), 112 deletions(-)
create mode 100644 src/ch/virtchd.socket.extra.in
create mode 100644 src/interface/virtinterfaced.service.extra.in
create mode 100644 src/interface/virtinterfaced.socket.extra.in
create mode 100644 src/locking/virtlockd.service.extra.in
create mode 100644 src/locking/virtlockd.socket.extra.in
create mode 100644 src/logging/virtlogd.service.extra.in
create mode 100644 src/logging/virtlogd.socket.extra.in
create mode 100644 src/lxc/virtlxcd.socket.extra.in
create mode 100644 src/network/virtnetworkd.socket.extra.in
create mode 100644 src/node_device/virtnodedevd.service.extra.in
create mode 100644 src/node_device/virtnodedevd.socket.extra.in
create mode 100644 src/nwfilter/virtnwfilterd.service.extra.in
create mode 100644 src/nwfilter/virtnwfilterd.socket.extra.in
create mode 100644 src/qemu/virtqemud.socket.extra.in
create mode 100644 src/remote/libvirtd.service.extra.in
create mode 100644 src/remote/libvirtd.socket.extra.in
create mode 100644 src/remote/virtproxyd.service.extra.in
create mode 100644 src/remote/virtproxyd.socket.extra.in
create mode 100644 src/secret/virtsecretd.service.extra.in
create mode 100644 src/secret/virtsecretd.socket.extra.in
create mode 100644 src/storage/virtstoraged.socket.extra.in
create mode 100644 src/vbox/virtvboxd.socket.extra.in
create mode 100644 src/virtd.service.limitmemlock.extra.in
create mode 100644 src/virtd.service.limitnofile.extra.in
create mode 100644 src/virtd.service.oomscoreadjust.extra.in
create mode 100644 src/virtd.service.tasksmax.extra.in
create mode 100644 src/vz/virtvzd.socket.extra.in
--
2.41.0
1 year, 1 month
[PATCH v8 0/5] Migration deprecated parts
by Juan Quintela
Based on: Message-ID: <20231018100651.32674-1-quintela(a)redhat.com>
[PULL 00/11] Migration 20231018 patches
v8 now:
- drop changes to 183.out
- create _filter_migration_block_deprecated
And now it passes the iotests.
Please review patch 1.
Rest are unchanged from v6.
Later, Juan.
And here we are, at v7:
- drop black line at the end of deprecated.rst
- change qemu-iotest output due to warnings for deprecation.
The only real change is the output of the qemu-iotest. That is the
reason why I maintained the reviewed-by. But will be happy if anyone
of the block people ack the changes.
Thanks, Juan.
On this v6:
- Fixed Markus comments
- 1st patch is reviewed
- dropped the RFC ones.
Later, Juan.
On this v5:
- Rebased on top of last migration pull requesnt:
- address markus comments. Basically we recommend always
blockdev-mirror + NBD. In deprecated.rst we also put the posiblity
of using block-incremental and block, but we state that they are
also deprecated.
I know, I know, I deprecated them in the following patch.
- Dropped the removal of block-migration and block-incremental I am
only interested in showing why I want to remove the -b/-i options.
Please review.
Later, Juan.
On this v4:
- addressed all markus comments.
- rebased on latest.
- improve formatting of migration.json
- print block migration status when needed.
- patches 7-10 are not mean to merge, they just show why we want to
deprecate block migration and remove its support.
- Patch 7 just drop support for -i/-b and qmp equivalents.
- Patch 8 shows all the helpers and convolutions we need to have to
support that -i and -d.
- patch 9 drops block-incremental migration support.
- patch 9 drops block migration support.
Please review.
Thanks, Juan.
On this v3:
- Rebase on top of upstream.
- Changed v8.1 to 8.2 (I left the reviewed by anyways)
- missing the block deprecation code, please.
Please, review.
Later, Juan.
On this v2:
- dropped -incoming <uri> deprecation
Paolo came with a better solution using keyvalues.
- skipped field is already ready for next pull request, so dropped.
- dropped the RFC bits, nermal PATCH.
- Assessed all the review comments.
- Added indentation of migration.json.
- Used the documentation pointer to substitute block migration.
Please review.
[v1]
Hi this series describe the migration parts that have to be deprecated.
- It is an rfc because I doubt that I did the deprecation process right. Hello Markus O:-)
- skipped field: It is older than me, I have never know what it stands
for. As far as I know it has always been zero.
- inc/blk migrate command options. They are only used by block
migration (that I deprecate on the following patch). And they are really bad.
grep must_remove_block_options.
- block migration. block jobs, whatever they are called this week are
way more flexible. Current code works, but we broke it here and
there, and really nobody has stand up to maintain it. It is quite
contained and can be left there. Is anyone really using it?
- old compression method. It don't work. See last try from Lukas to
make a test that works reliabely. I failed with the same task years
ago. It is really slow, and if compression is good for you, multifd
+ zlib is going to perform/compress way more.
I don't know what to do with this code, really.
* Remove it for this release? It don't work, and haven't work
reliabely in quite a few time.
* Deprecate it and remove in another couple of releases, i.e. normal
deprecation.
* Ideas?
- -incoming <uri>
if you need to set parameters (multifd cames to mind, and preempt has
the same problem), you really needs to use defer. So what should we do here?
This part is not urget, because management apps have a working
option that are already using "defer", and the code simplifacation
if we remove it is not so big. So we can leave it until 9.0 or
whatever we think fit.
What do you think?
Later, Juan.
Juan Quintela (5):
qemu-iotests: Filter warnings about block migration being deprecated
migration: migrate 'inc' command option is deprecated.
migration: migrate 'blk' command option is deprecated.
migration: Deprecate block migration
migration: Deprecate old compression method
docs/about/deprecated.rst | 35 ++++++++++++
qapi/migration.json | 93 ++++++++++++++++++++++++--------
migration/block.c | 3 ++
migration/migration-hmp-cmds.c | 10 ++++
migration/migration.c | 10 ++++
migration/options.c | 22 +++++++-
tests/qemu-iotests/183 | 2 +-
tests/qemu-iotests/common.filter | 7 +++
8 files changed, 158 insertions(+), 24 deletions(-)
--
2.41.0
1 year, 1 month
[PATCH v4 5/6] docs/about/deprecated: Document RISC-V "pmu-num" deprecation
by Rob Bradford
This has been replaced by a "pmu-mask" property that provides much more
flexibility.
Signed-off-by: Rob Bradford <rbradford(a)rivosinc.com>
Acked-by: LIU Zhiwei <zhiwei_liu(a)linux.alibaba.com>
---
docs/about/deprecated.rst | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 2febd2d12f..857b5d4fc4 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -405,6 +405,18 @@ Specifying the iSCSI password in plain text on the command line using the
used instead, to refer to a ``--object secret...`` instance that provides
a password via a file, or encrypted.
+CPU device properties
+'''''''''''''''''''''
+
+``pmu-num=n`` on RISC-V CPUs (since 8.2)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In order to support more flexible counter configurations this has been replaced
+by a ``pmu-mask`` property. If set of counters is continuous then the mask can
+be calculated with ``((2 ^ n) - 1) << 3``. The least significant three bits
+must be left clear.
+
+
Backwards compatibility
-----------------------
--
2.41.0
1 year, 1 month
[libvirt PATCH 0/2] ch: Use payload api
by Praveen K Paladugu
Introduced virCHCapsInitCHVersionCaps to check and cache capabilities of
cloud-hypervisor based on its version. Modified ch driver to use "payload" api
to pass kernel, initramfs and cmdline options to cloud-hypervisor.
Cloud-hypervisor currently has a single LTS release, v28, that will be supported
until May 24. All versions older than v28 have reached EOL. Can I bump up the
min version of cloud-hypervisor to v28 in ch driver? If I can bump up the min
supported version in ch driver, I can drop a check in this commit related to
supporting serial and console devices in parallel.
Praveen K Paladugu (2):
ch: use payload api to send kernel details
ch: support serial and console devices in parallel
src/ch/ch_capabilities.c | 55 ++++++++++++++++++++++++++++++++++++++++
src/ch/ch_capabilities.h | 34 +++++++++++++++++++++++++
src/ch/ch_conf.h | 6 +++++
src/ch/ch_domain.c | 28 ++++++++++++--------
src/ch/ch_driver.c | 3 +++
src/ch/ch_monitor.c | 48 +++++++++++++++++++++++++++++++----
src/ch/ch_monitor.h | 4 ++-
src/ch/ch_process.c | 2 +-
src/ch/meson.build | 2 ++
9 files changed, 165 insertions(+), 17 deletions(-)
create mode 100644 src/ch/ch_capabilities.c
create mode 100644 src/ch/ch_capabilities.h
--
2.41.0
1 year, 1 month
[libvirt RFCv11 00/33] multifd save restore prototype
by Claudio Fontana
This is v11 of the multifd save prototype, which focuses on saving
to a single file instead of requiring multiple separate files for
multifd channels.
This series demonstrates a way to save and restore from a single file
by using interleaved channels of a size equal to the transfer buffer
size (1MB), and relying on UNIX holes to avoid wasting physical disk
space due to channels of different size.
KNOWN ISSUES:
a) still applies only to save/restore (no managed save etc)
b) this is not not done in QEMU, where it could be possible to teach
QEMU to migrate directly to a file or block device in a
block-aligned way by altering the migration stream code and the
state migration code of all devices.
changes from v10:
* virfile: add new API virFileDiskCopyChannel, which extends the
existing virFileDiskCopy to work with parallel channels in the file.
* drop use of virthread API, use GLIB for threads.
* pass only a single FD to the multifd-helper, which will then open
additional FDs as required for the multithreaded I/O.
* simplify virQEMUSaveFd API, separating the initialization from the
addition of extra channels.
* adapt all documentation to mention a single file instead of multiple.
* remove the "Lim" versions of virFileDirectRead and Write, they are
not needed.
---
changes from v9:
* exposed virFileDirectAlign
* separated the >= 2 QEMU_SAVE_VERSION change in own patch
* reworked the write code to add the alignment padding to the
data_len, making the on disk format compatible when loaded
from an older libvirt.
* reworked the read code to use direct I/O APIs only for actual
direct I/O file descriptors, so as to make old images work
with newer libvirt.
---
changes from v8:
* rebased on master
* reordered patches to add more upstreamable content at the start
* split introduction of virQEMUSaveFd, so the first part is multifd-free
* new virQEMUSaveDataRead as a mirror of virQEMUSaveDataWrite
* introduced virFileDirect API, using it in virFileDisk operations and
for virQEMUSaveRead and virQEMUSaveWrite
---
changes from v7:
* [ base params API and iohelper refactoring upstreamed ]
* extended the QEMU save image format more, to record the nr
of multifd channels on save. Made the data header struct packed.
* removed --parallel-connections from the restore command, as now
it is useless due to QEMU save image format extension.
* separate out patches to expose migration_params APIs to saveimage,
including qemuMigrationParamsSetString, SetCap, SetInt.
* fixed bugs in the ImageOpen patch (missing saveFd init), removed
some whitespace, and fixed some convoluted code paths for return
value -3.
---
changes from v6:
* improved error path handling, with error messages and especially
cancellation of qemu process on error during restore.
* split patches more and reordered them to keep general refactoring
at the beginning before the --parallel stuff is introduced.
* improved multifd compression support, including adding an enum
and extending the QEMU save image format to record the compression
used on save, and pick it up automatically on restore.
---
changes from v4:
* runIO renamed to virFileDiskCopy and rethought arguments
* renamed new APIs from ...ParametersFlags to ...Params
* introduce the new virDomainSaveParams and virDomainRestoreParams
without any additional parameters, so they can be upstreamed first.
* solved the issue in the gendispatch.pl script generating code that
was missing the conn parameter.
---
changes from v3:
* reordered series to have all helper-related change at the start
* solved all reported issues from ninja test, including documentation
* fixed most broken migration capabilities code (still imperfect likely)
* added G_GNUC_UNUSED as needed
* after multifd restore, added what I think were the missing operations:
qemuProcessRefreshState(),
qemuProcessStartCPUs() - most importantly,
virDomainObjSave()
The domain now starts running after restore without further encouragement
* removed the sleep(10) from the multifd-helper
---
changes from v2:
* added ability to restore the VM from disk using multifd
* fixed the multifd-helper to work in both directions,
assuming the need to listen for save, and connect for restore.
* fixed a large number of bugs, and probably introduced some :-)
---
Claudio Fontana (33):
virfile: introduce virFileDirect APIs
virfile: use virFileDirect API in runIOCopy
qemu: saveimage: rework image read/write to be O_DIRECT friendly
qemu: saveimage: assume future formats will also support compression
virfile: virFileDiskCopy: prepare for O_DIRECT files without wrapper
qemu: saveimage: introduce virQEMUSaveFd
qemu: saveimage: convert qemuSaveImageCreate to use virQEMUSaveFd
qemu: saveimage: convert qemuSaveImageOpen to use virQEMUSaveFd
tools: prepare doSave to use parameters
tools: prepare cmdRestore to use parameters
libvirt: add new VIR_DOMAIN_SAVE_PARALLEL flag and parameter
qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in save
qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in restore
virfile: add new API virFileDiskCopyChannel
multifd-helper: new helper for parallel save/restore
qemu: saveimage: update virQEMUSaveFd struct for parallel save
qemu: saveimage: wire up saveimage code with the multifd helper
qemu: capabilities: add multifd to the probed migration capabilities
qemu: saveimage: add multifd related fields to save format
qemu: migration_params: add APIs to set Int and Cap
qemu: migration: implement qemuMigrationSrcToFilesMultiFd for save
qemu: add parameter to qemuMigrationDstRun to skip waiting
qemu: implement qemuSaveImageLoadMultiFd for restore
tools: add parallel parameter to virsh save command
tools: add parallel parameter to virsh restore command
qemu: add migration parameter multifd-compression
libvirt: add new VIR_DOMAIN_SAVE_PARAM_PARALLEL_COMPRESSION
qemu: saveimage: add parallel compression argument to ImageCreate
qemu: saveimage: add stub support for multifd compression parameter
qemu: migration: expose qemuMigrationParamsSetString
qemu: saveimage: implement multifd-compression in parallel save
qemu: saveimage: restore compressed parallel images
tools: add parallel-compression parameter to virsh save command
docs/manpages/virsh.rst | 26 +-
include/libvirt/libvirt-domain.h | 24 +
po/POTFILES | 1 +
src/libvirt_private.syms | 6 +
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_driver.c | 146 ++--
src/qemu/qemu_migration.c | 160 ++--
src/qemu/qemu_migration.h | 16 +-
src/qemu/qemu_migration_params.c | 71 +-
src/qemu/qemu_migration_params.h | 15 +
src/qemu/qemu_process.c | 3 +-
src/qemu/qemu_process.h | 5 +-
src/qemu/qemu_saveimage.c | 703 +++++++++++++-----
src/qemu/qemu_saveimage.h | 69 +-
src/qemu/qemu_snapshot.c | 6 +-
src/util/iohelper.c | 3 +
src/util/meson.build | 16 +
src/util/multifd-helper.c | 359 +++++++++
src/util/virfile.c | 391 +++++++---
src/util/virfile.h | 11 +
.../caps_4.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
.../caps_4.1.0.x86_64.xml | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 2 +
.../caps_5.0.0.riscv64.xml | 2 +
.../caps_5.0.0.x86_64.xml | 2 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 2 +
.../caps_5.1.0.x86_64.xml | 2 +
.../caps_5.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 2 +
.../caps_5.2.0.riscv64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 2 +
.../caps_5.2.0.x86_64.xml | 2 +
.../caps_6.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 2 +
.../caps_6.0.0.x86_64.xml | 2 +
.../caps_6.1.0.x86_64.xml | 2 +
.../caps_6.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
.../caps_6.2.0.x86_64.xml | 2 +
.../caps_7.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
.../caps_7.0.0.x86_64.xml | 2 +
.../caps_7.1.0.x86_64.xml | 2 +
tools/virsh-domain.c | 101 ++-
55 files changed, 1748 insertions(+), 445 deletions(-)
create mode 100644 src/util/multifd-helper.c
--
2.26.2
1 year, 1 month
[libvirt PATCH 00/15] Support for VFIO variant drivers, Part 2
by Laine Stump
Part 1 (which simply made it possible to use virsh nodedev-detach to
bind a device to a manually-specified variant driver, and at guest
runtime allowed libvirt to ignore the fact that the driver found to
the device was something other than exactly "vfio-pci") was here:
https://listman.redhat.com/archives/libvir-list/2023-August/241338.html
and pushed upstream as of commit v9.6.0-153-g24beaffec3
Part 2 adds two new pieces of functionality:
1) It is possible to manually specify a VFIO variant driver (or force
the generic vfio-pci driver) for a device in the domain XML with,
e.g.:
<driver name='mlx5_vfio_pci'/>
(for the former) or:
<driver name='vfio-pci'/>
(for the latter).
2) By default libvirt will now find the "best match" VFIO or VFIO
variant driver by comparing the device's modalias file contents (in
sysfs) with vfio drivers found in the running kernel's
modules.alias file. This means that "virsh nodedev-detach" of a
host device will bind it to its appropriate VFIO variant driver (if
one is available), and also if a <hostdev> decice in a domain
config has "managed='yes'", libvirt will bind it to a variant
driver if possible (in order to force binding to the basic vfio-pci
driver instead, you just need to add the <driver> element mentioned
above).
The first 12 patches are all just getting (1) going (a lot of it is
refactoring code to use common code for the four places that use the
hostdev <driver> element), and the final 3 patches implement (2).
More details are spread along the way.
Laine Stump (15):
util: properly deal with module vs. driver when binding device to
driver
schema: consolidate RNG for all hostdev <driver> elements
conf: move/rename hostdev PCI driver type enum to device_conf.h
conf: normalize hostdev <driver> parsing to simplify adding new attr
conf: put hostdev PCI backend into a struct
conf: use virDeviceHostdevPCIDriverInfo in network and networkport
objects
conf: split out hostdev <driver> parse/format to their own functions
conf: use new common parser/formatter for hostdev driver in network
XML
tests: remove explicit <driver name='vfio'/> from hostdev test cases
xen: explicitly set hostdev driver.type at runtime, not in postparse
conf: replace virHostdevIsVFIODevice with virHostdevIsPCIDevice
conf: support manually specifying VFIO variant driver in <hostdev> XML
util: new function virStringSkipToSpace()
util: new function virPCIDeviceFindBestVFIOVariant()
qemu: automatically bind to a vfio variant driver, if available
src/conf/device_conf.c | 75 +++
src/conf/device_conf.h | 27 ++
src/conf/domain_capabilities.c | 2 +-
src/conf/domain_capabilities.h | 2 +-
src/conf/domain_conf.c | 98 +---
src/conf/domain_conf.h | 18 +-
src/conf/network_conf.c | 44 +-
src/conf/network_conf.h | 17 +-
src/conf/schemas/basictypes.rng | 20 +
src/conf/schemas/domaincommon.rng | 173 ++++---
src/conf/schemas/network.rng | 10 +-
src/conf/schemas/networkport.rng | 10 +-
src/conf/virconftypes.h | 2 +
src/conf/virnetworkportdef.c | 23 +-
src/conf/virnetworkportdef.h | 4 +-
src/hypervisor/virhostdev.c | 16 +-
src/hypervisor/virhostdev.h | 2 -
src/libvirt_private.syms | 8 +-
src/libxl/libxl_capabilities.c | 2 +-
src/libxl/libxl_domain.c | 65 ++-
src/libxl/libxl_driver.c | 25 +-
src/network/bridge_driver.c | 2 +-
src/qemu/qemu_capabilities.c | 4 +-
src/qemu/qemu_command.c | 14 +-
src/qemu/qemu_domain.c | 29 +-
src/qemu/qemu_hostdev.c | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_validate.c | 6 +-
src/security/security_apparmor.c | 2 +-
src/security/security_dac.c | 4 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 8 +-
src/util/virpci.c | 434 ++++++++++++++++--
src/util/virpci.h | 2 +
src/util/virstring.c | 17 +
src/util/virstring.h | 1 +
tests/domaincapstest.c | 4 +-
tests/libxlxml2domconfigdata/moredevs-hvm.xml | 1 -
tests/networkxml2xmlin/hostdev-pf-old.xml | 8 +
tests/networkxml2xmlin/hostdev-pf.xml | 2 +-
tests/networkxml2xmlout/hostdev-pf-old.xml | 8 +
tests/networkxml2xmlout/hostdev-pf.xml | 2 +-
tests/networkxml2xmltest.c | 6 +
.../qemuhotplug-hostdev-pci.xml | 1 -
.../qemuhotplug-base-live+hostdev-pci.xml | 2 +-
...uhotplug-pseries-base-live+hostdev-pci.xml | 2 +-
tests/qemustatusxml2xmldata/modern-in.xml | 2 +-
.../hostdev-pci-address-unassigned.xml | 4 -
.../hostdev-pci-multifunction.xml | 7 -
.../hostdev-vfio-multidomain.xml | 1 -
.../hostdev-vfio-zpci-autogenerate-fids.xml | 2 -
.../hostdev-vfio-zpci-autogenerate-uids.xml | 2 -
.../hostdev-vfio-zpci-autogenerate.xml | 1 -
.../hostdev-vfio-zpci-boundaries.xml | 2 -
.../hostdev-vfio-zpci-ccw-memballoon.xml | 1 -
.../hostdev-vfio-zpci-duplicate.xml | 2 -
...ostdev-vfio-zpci-invalid-uid-valid-fid.xml | 1 -
.../hostdev-vfio-zpci-multidomain-many.xml | 8 -
.../hostdev-vfio-zpci-set-zero.xml | 1 -
.../hostdev-vfio-zpci-uid-set-zero.xml | 1 -
.../hostdev-vfio-zpci-wrong-arch.xml | 1 -
tests/qemuxml2argvdata/hostdev-vfio-zpci.xml | 1 -
.../hostdev-vfio.x86_64-latest.args | 5 +-
tests/qemuxml2argvdata/hostdev-vfio.xml | 19 +-
.../net-hostdev-vfio-multidomain.xml | 1 -
tests/qemuxml2argvdata/net-hostdev-vfio.xml | 1 -
tests/qemuxml2argvdata/pseries-hostdevs-1.xml | 3 -
tests/qemuxml2argvdata/pseries-hostdevs-2.xml | 2 -
tests/qemuxml2argvdata/pseries-hostdevs-3.xml | 2 -
...v-pci-address-unassigned.x86_64-latest.xml | 4 -
...ostdev-pci-multifunction.x86_64-latest.xml | 7 -
...io-zpci-autogenerate-fids.s390x-latest.xml | 2 -
...io-zpci-autogenerate-uids.s390x-latest.xml | 2 -
...ev-vfio-zpci-autogenerate.s390x-latest.xml | 1 -
...tdev-vfio-zpci-boundaries.s390x-latest.xml | 2 -
...-vfio-zpci-ccw-memballoon.s390x-latest.xml | 1 -
...fio-zpci-multidomain-many.s390x-latest.xml | 8 -
.../hostdev-vfio-zpci.s390x-latest.xml | 1 -
.../hostdev-vfio.x86_64-latest.xml | 24 +-
.../net-hostdev-vfio.x86_64-latest.xml | 1 -
.../pseries-hostdevs-1.ppc64-latest.xml | 3 -
.../pseries-hostdevs-2.ppc64-latest.xml | 2 -
.../pseries-hostdevs-3.ppc64-latest.xml | 2 -
tests/virhostdevtest.c | 2 +-
.../plug-hostdev-pci-unmanaged.xml | 2 +-
.../plug-hostdev-pci.xml | 2 +-
tests/xlconfigdata/test-fullvirt-pci.xml | 2 -
tests/xmconfigdata/test-pci-dev-syntax.xml | 2 -
tests/xmconfigdata/test-pci-devs.xml | 2 -
tools/virsh-completer-nodedev.c | 4 +-
90 files changed, 875 insertions(+), 481 deletions(-)
create mode 100644 tests/networkxml2xmlin/hostdev-pf-old.xml
create mode 100644 tests/networkxml2xmlout/hostdev-pf-old.xml
--
2.41.0
1 year, 1 month
[PATCH] specfile: use correct option for nbdkit in mingw build
by Laine Stump
commit v9.8.0-40-g7cbd8c4230 changed the name of the option that
enables/disables nbdkit support in the build from "libnbd" to
"nbdkit", but one use of "-Dlibnbd=disabled" was missed in
libvirt.specfile.in - the meson commandline for mingw, causing the
build to fail.
This patch changes that line to "-Dnbdkit=disabled", thus unbreaking
the rpm build.
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
This patch does fix a build-breaker, but I didn't want to push it in
case my comment was incorrect (I won't pretend that I've paid
attention to nbdkit)
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index fe54c45c5c..262c59eb5b 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1356,7 +1356,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Dglusterfs=disabled \
-Dhost_validate=disabled \
-Dlibiscsi=disabled \
- -Dlibnbd=disabled \
+ -Dnbdkit=disabled \
-Dlibnl=disabled \
-Dlibpcap=disabled \
-Dlibssh2=disabled \
--
2.41.0
1 year, 1 month