[PATCH] spec: Do not disable some systemd units of newly split package
by Martin Kletzander
Since virtproxyd was split into libvirt-daemon-proxy package it can
happen that, in case a distribution has such systemd preset, when
installing this package, already pre-enabled and configured units like
-tls.socket and -tcp.socket will get disabled.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2210058
Fixes: 5358618b1cd0afc126aed313249bf2134731665f
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
This is more like an RFC as I would really like to know what to really do in
this case. What happens, basically, is that if you have libvirt-daemon-9.0.0
and set up virtproxyd-tls.socket for example and then upgrade to anything newer,
then the package libvirt-daemon-proxy will get installed. The %post action
calls "%libvirt_daemon_systemd_post_inet virtproxyd" which calls "%systemd_post
with all virtproxyd units. What %systemd_post is supposed to do is reset units
to a preset state in the case of package installation, but not during upgrade.
However the libvirt-daemon-proxy package did not exist on the system before, so
this action is not an update, but an installation.
If no preset is mentioned for a unit then `systemctl preset` does not change
anything. However some distros might have a catch-all preset "disable *" for
some reason, I guess based on an example in the documentation, and there is no
way to override an already configured preset, you can only enable or disable a
unit in a preset.
That all means than it can happen that you enable virtproxyd-tcp.socket, for
example, then update your system and find that it is disabled. There are
various ways to deal with this, but I don't see any one that would 100% satisfy
me with regards to all the issues and at the same time could be implemented
"soon enough" given libvirt already had three releases with the
libvirt-daemon-proxy split.
libvirt.spec.in | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 1f77cd90b772..50f521b7ce88 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1592,7 +1592,13 @@ fi
%post daemon-proxy
%if %{with_modular_daemons}
-%libvirt_daemon_systemd_post_inet virtproxyd
+# Since this was split into a different package, a transparent update for the
+# virtproxyd units could actually disable an already configured ones
+# (e.g. virtproxyd-tls.socket) as %systemd_post runs `systemctl preset` if this
+# is an installation (and is skipped on update). So skip this step for those
+# that need an extra setup to work since they will most likely not be preset to
+# enabled, but that is up to the point of the distribution.
+%libvirt_daemon_systemd_post virtproxyd
%endif
%preun daemon-proxy
--
2.41.0
1 year, 5 months
[PATCH] qemu: Support removable for scsi disk
by Han Han
Allow //disk/target@removable for scsi disk devices, since QEMU has support
the removable attribute for scsi-hd device from v0.14.0[1].
[1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit
Signed-off-by: Han Han <hhan(a)redhat.com>
---
docs/formatdomain.rst | 2 +-
src/conf/domain_validate.c | 5 +++--
src/qemu/qemu_command.c | 6 ++++--
...gs => disk-device-removable.x86_64-latest.args} | 14 +++++++++-----
...ice-removable.xml => disk-device-removable.xml} | 5 +++++
tests/qemuxml2argvtest.c | 2 +-
6 files changed, 23 insertions(+), 11 deletions(-)
rename tests/qemuxml2argvdata/{disk-usb-device-removable.x86_64-latest.args => disk-device-removable.x86_64-latest.args} (70%)
rename tests/qemuxml2argvdata/{disk-usb-device-removable.xml => disk-device-removable.xml} (80%)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index c3526439bf..676e4b9fd3 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3094,7 +3094,7 @@ paravirtualized driver is specified via the ``disk`` element.
CDROM or Floppy disk), the value can be either "open" or "closed", defaults
to "closed". NB, the value of ``tray`` could be updated while the domain is
running. The optional attribute ``removable`` sets the removable flag for USB
- disks, and its value can be either "on" or "off", defaulting to "off".
+ or SCSI disks, and its value can be either "on" or "off", defaulting to "off".
The optional attribute ``rotation_rate`` sets the rotation rate of the
storage for disks on a SCSI, IDE, or SATA bus. Values in the range 1025 to
65534 are used to indicate rotational media speed in revolutions per minute.
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 80d6a2ffd9..e7122f6297 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -881,9 +881,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
if (disk->removable != VIR_TRISTATE_SWITCH_ABSENT &&
- disk->bus != VIR_DOMAIN_DISK_BUS_USB) {
+ disk->bus != VIR_DOMAIN_DISK_BUS_USB &&
+ !(disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)) {
virReportError(VIR_ERR_XML_ERROR, "%s",
- _("removable is only valid for usb disks"));
+ _("removable is only valid for usb or scsi disks"));
return -1;
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 72363238b8..5ec912ddee 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1781,10 +1781,12 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
driver = "scsi-block";
} else {
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
driver = "scsi-cd";
- else
+ } else {
driver = "scsi-hd";
+ removable = disk->removable;
+ }
/* qemu historically used the name of -drive as one of the device
* ids in the Vital Product Data Device Identification page if
diff --git a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
similarity index 70%
rename from tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
rename to tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
index c5bfd8e8e0..106f7b9ce2 100644
--- a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
@@ -27,13 +27,17 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-no-shutdown \
-boot strict=on \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x2"}' \
+-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw","file":"libvirt-3-storage"}' \
+-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-format","id":"ide0-0-0","bootindex":1}' \
+-blockdev '{"driver":"file","filename":"/tmp/usbdisk.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}' \
--device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-format","id":"ide0-0-0","bootindex":1}' \
--blockdev '{"driver":"file","filename":"/tmp/usbdisk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
+-device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt-2-format","id":"usb-disk0","removable":true}' \
+-blockdev '{"driver":"file","filename":"/tmp/scsidisk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt-1-format","id":"usb-disk0","removable":true}' \
+-device '{"driver":"scsi-hd","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":1,"device_id":"drive-scsi0-0-0-1","drive":"libvirt-1-format","id":"scsi0-0-0-1","removable":true}' \
-audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-usb-device-removable.xml b/tests/qemuxml2argvdata/disk-device-removable.xml
similarity index 80%
rename from tests/qemuxml2argvdata/disk-usb-device-removable.xml
rename to tests/qemuxml2argvdata/disk-device-removable.xml
index 927a8e8b3e..9400c84863 100644
--- a/tests/qemuxml2argvdata/disk-usb-device-removable.xml
+++ b/tests/qemuxml2argvdata/disk-device-removable.xml
@@ -22,6 +22,11 @@
<source file='/tmp/usbdisk.img'/>
<target dev='sda' bus='usb' removable='on'/>
</disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/scsidisk.img'/>
+ <target dev='sdb' bus='scsi' removable='on'/>
+ </disk>
+ <controller type='scsi' index='0' model='virtio-scsi'/>
<memballoon model='virtio'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d914d8cbea..d6a9ab865d 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1227,7 +1227,7 @@ mymain(void)
DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-device-lun-type-invalid");
DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-attaching-partition-nosupport");
DO_TEST_CAPS_LATEST("disk-usb-device");
- DO_TEST_CAPS_LATEST("disk-usb-device-removable");
+ DO_TEST_CAPS_LATEST("disk-device-removable");
DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-usb-pci");
DO_TEST_CAPS_LATEST("disk-scsi");
DO_TEST_CAPS_LATEST("disk-scsi-device-auto");
--
2.40.1
1 year, 5 months
[PATCH v2 0/5] Migration deprecated parts
by Juan Quintela
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):
migration: Use proper indentation for migration.json
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 | 32 ++++++
qapi/migration.json | 203 ++++++++++++++++++++++++--------------
migration/block.c | 3 +
migration/migration.c | 11 +++
migration/options.c | 22 ++++-
5 files changed, 198 insertions(+), 73 deletions(-)
base-commit: 5f9dd6a8ce3961db4ce47411ed2097ad88bdf5fc
prerequisite-patch-id: 99c8bffa9428838925e330eb2881bab476122579
prerequisite-patch-id: 77ba427fd916aeb395e95aa0e7190f84e98e96ab
prerequisite-patch-id: 9983d46fa438d7075a37be883529e37ae41e4228
prerequisite-patch-id: 207f7529924b12dcb57f6557d6db6f79ceb2d682
prerequisite-patch-id: 5ad1799a13845dbf893a28a202b51a6b50d95d90
prerequisite-patch-id: c51959aacd6d65ee84fcd4f1b2aed3dd6f6af879
prerequisite-patch-id: da9dbb6799b2da002c0896574334920097e4c50a
prerequisite-patch-id: c1110ffafbaf5465fb277a20db809372291f7846
prerequisite-patch-id: 8307c92bedd07446214b35b40206eb6793a7384d
prerequisite-patch-id: 0a6106cd4a508d5e700a7ff6c25edfdd03c8ca3d
prerequisite-patch-id: 83205051de22382e75bf4acdf69e59315801fa0d
prerequisite-patch-id: 8c9b3cba89d555c071a410041e6da41806106a7e
prerequisite-patch-id: 0ff62a33b9a242226ccc1f5424a516de803c9fe5
prerequisite-patch-id: 25b8ae1ebe09ace14457c454cfcb23077c37346c
prerequisite-patch-id: 466ea91d5be41fe345dacd4d17bbbe5ce13118c2
prerequisite-patch-id: d1045858f9729ac62eccf2e83ebf95cfebae2cb5
prerequisite-patch-id: 0276ec02073bda5426de39e2f2e81eef080b4f54
prerequisite-patch-id: 7afb4450a163cc1a63ea23831c50214966969131
prerequisite-patch-id: 06c053ce4f41db9675bd1778ae8f6a483641fcef
prerequisite-patch-id: 13ea05d54d741ed08b3bfefa1fc8bedb9c81c782
prerequisite-patch-id: 99c4e2b7101bc8c4b9515129a1bbe6f068053dbf
prerequisite-patch-id: 1e393a196dc7a1ee75f3cc3cebbb591c5422102f
prerequisite-patch-id: 2cf497b41f5024ede0a224b1f5b172226067a534
prerequisite-patch-id: 2a70276ed61d33fc4f3b52560753c05d1cd413be
prerequisite-patch-id: 17ec40f4388b62ba8bf3ac1546c6913f5d1f6079
prerequisite-patch-id: dba969ce9d6cf69c1319661a7d81b1c1c719804d
prerequisite-patch-id: 8d800cda87167314f07320bdb3df936c323e4a40
prerequisite-patch-id: 25d4aaf54ea66f30e426fa38bdd4e0f47303c513
prerequisite-patch-id: 082c9d8584c1daff1e827e44ee3047178e7004a7
prerequisite-patch-id: 0ef73900899425ae2f00751347afdce3739aa954
prerequisite-patch-id: e7db4730b791b71aaf417ee0f65fb6304566aaf8
prerequisite-patch-id: 62d7f28f8196039507ffe362f97723395d7bb704
prerequisite-patch-id: ea8de47bcb54e33bcc67e59e9ed752a4d1fad703
prerequisite-patch-id: 497893ef92e1ea56bd8605e6990a05cb4c7f9293
prerequisite-patch-id: 3dc869c80ee568449bbfa2a9bc427524d0e8970b
prerequisite-patch-id: 52c14b6fb14ed4ccd685385a9fbc6297b762c0ef
prerequisite-patch-id: 23de8371e9e3277c374a47f9bd10de209a22fdd5
prerequisite-patch-id: d21f036dd106af3375fb920bf0a557fe2b86d98e
prerequisite-patch-id: ca717076e9de83d6ce370f7374c4729a9f586fae
prerequisite-patch-id: a235b6ab3237155f2b39e8e10d47ddd250f6b6cc
prerequisite-patch-id: 6db2aa3d8a5804c85dd171864f5140fadf5f72da
prerequisite-patch-id: a799b883f4cb41c34ad074220293f372c6e0a9c7
prerequisite-patch-id: 5e012c426aef7b2f07513cec68e7efa1cf85fe52
prerequisite-patch-id: 4e614e7e3395dda7bae5f9fa21257c57cce45a39
prerequisite-patch-id: 67f8e68622c9698280ff5c5dc7469f36daf9a012
prerequisite-patch-id: d86078331449a21499e3f955e27bc87294969346
prerequisite-patch-id: 3f30d10e0ac7f53307f6b462eaf5b47151b73631
prerequisite-patch-id: a5d84769b776873697b1eb18b6b170a168e68133
prerequisite-patch-id: e5058b3e0ca9f80886bd2c1667349bffc6949da6
prerequisite-patch-id: 669d7e2ef30468034acfa33d4da0404caae526a9
prerequisite-patch-id: 3276a659cbe45efca6a6d3a4579af3cf7ceda992
prerequisite-patch-id: 624657b1f538edfb852b09889d6583970665cad9
prerequisite-patch-id: d7d70d557970f203c288f153361c6782245ba9f9
prerequisite-patch-id: fcbab0e48ac1385d2de1be7852b2adb74f04acfc
prerequisite-patch-id: 88e76e8dc51b054c84c497344424f24e877e325b
prerequisite-patch-id: dc4c193c8571ae5969a6c498edc7cec8ef438bc1
prerequisite-patch-id: 39c1ee32082f6ce1dd088d5a8340ca9b3e2434a4
prerequisite-patch-id: 28deb0caf0f5eac3fc0a866d2901667a56870f6d
prerequisite-patch-id: 53b48b35c9b8217b2da5212d7ed48320d355a943
prerequisite-patch-id: 4469f3663714a65a06b7c472ce9c92ab7502a00f
prerequisite-patch-id: a75f08b401d251fc3465b65f94a8db8d32d8900a
prerequisite-patch-id: 4b7ac86af078a260f656914089da8f43cdaab8ff
prerequisite-patch-id: 398f62abad95f55181d2cf8a383f69000de97af4
prerequisite-patch-id: e102cdc3834018fa88f9fe98a78afb46ff316124
prerequisite-patch-id: 1c30c139ef694b9fd8314bffb4b9b2a02c6c9233
prerequisite-patch-id: d96c304f1c63fa840440508f5b3be70a922b2210
prerequisite-patch-id: a8be25a6b6834ac542d40eaec47a60caf2fe545c
prerequisite-patch-id: d29aa52f7a6c5e61cf793addbbc7d7ea5f383725
prerequisite-patch-id: c7a6d171e568f4aba6f94126abc6a9a64caefcc2
prerequisite-patch-id: dcbf2e0e9b3b3cd985423993bdd411fc0cdf4646
prerequisite-patch-id: d5f1a450785cb6e8d74e152b7026621cd4077d04
prerequisite-patch-id: 6179fd2a7c7d6866906365b564fcef05428318b3
prerequisite-patch-id: 3f0e5189f1046e8fd37b2f104a5ee6c306438bed
prerequisite-patch-id: 9b8f5520663a347e1981c46d1d72f6b7efeef222
prerequisite-patch-id: 6171b4310abc56d03a21f95848beff3f04c04333
prerequisite-patch-id: 93336ba3fd1e3875b644ec6007ef22480df750a2
prerequisite-patch-id: 9a76b6408f38b96af9ad91269a0fac8d1893bdef
prerequisite-patch-id: 74c166a9a1ccafef04f3894085a3b3ed5215df7a
prerequisite-patch-id: 71833e48cfa5875247770ac8b94ab957e4eab4fe
prerequisite-patch-id: 9a14e6755e7d7605267abaeab62d70e651d622e3
prerequisite-patch-id: e0b2ce3211263007de8e2a2b60402cfea4a2f1c2
prerequisite-patch-id: bacccbe583a69dd0f081aa74822e92c23f344a64
prerequisite-patch-id: bee3183ab6c76123bc8795dfd5dd6eb19d417832
prerequisite-patch-id: eee73769e563ea8ad64f82473c235a4fef18ce83
prerequisite-patch-id: 5c2c95e068dc614a7708fe830d773e03e8cde4ec
prerequisite-patch-id: deae58b435dc10d80f1ea754613e9ed3e7bd4fe1
prerequisite-patch-id: 1e6e138aeb18a51b6496a265f84f5df1b98471b6
prerequisite-patch-id: 15865988ed0b88b1e28f0e16c50222f61db5ac35
prerequisite-patch-id: 7884031de035d910c1bddee4331a765c6a266243
prerequisite-patch-id: a2deb3751dec34448ab776b455a7b29bd6d8217f
prerequisite-patch-id: d24167f841efc3b8fd8afe06ae02da4d4a594fdc
prerequisite-patch-id: 4f23aea0e73aa0933a53db59ed716a19dcbd575c
prerequisite-patch-id: f54b42bfeb4241cb96b2490e1261e2bc44e7cc07
prerequisite-patch-id: 7e3f3e34be720b25f3db15d2a878bce23b99353c
prerequisite-patch-id: fc91b48c6593c862aa17b221663d2bbed9261f16
prerequisite-patch-id: f20dbadd1962f16e7f4fc4a2b8747443ada94f80
prerequisite-patch-id: 78de9ba010ec43b9ebbc998f4d3afb38fed6be8e
prerequisite-patch-id: 013c99f721a9a0a4af86772cb8d1d40f6942f16f
prerequisite-patch-id: 7ee4a5b056b343ba2d7491158965023af84f56ad
prerequisite-patch-id: d489b42dc81bf9dd7a51381c06182ddffb2230e5
prerequisite-patch-id: fcf1400a8d8b417801baf1450c8c10efa06f4481
prerequisite-patch-id: e475e1e9cd7ce746410ef9839d02ba242cb72090
prerequisite-patch-id: 68d24ec2081c2224a1c133f2c07544177e693a53
prerequisite-patch-id: 6e70864f4065b79db49a206523bcc8b4afded934
prerequisite-patch-id: 0d259c5d3ebb259d36c5d059a82df3b0ffbf1429
prerequisite-patch-id: 392a9fa483070625cad85778e4742c4fc5a2ac5d
prerequisite-patch-id: 62804c908c4abe71d644f18303780084a4c224e8
prerequisite-patch-id: 3f3f1eed1a6150df53aba846237329cf24bb9548
prerequisite-patch-id: 4d1387c6e00b9c62e638ce955cd5d9681754bfb5
prerequisite-patch-id: 3382e00119d0ecd997ae6f99855c74e3eed9237c
prerequisite-patch-id: 95fcef043070fc902f1cad42ef47a94744624530
prerequisite-patch-id: 5b6737d17f3ef9a4ae5d33343125bc597ad2fa62
prerequisite-patch-id: acc0a1e809cb0639e16d4b05cccfd809f8e299b5
prerequisite-patch-id: aa5c2db287402596e20ef0f935aea67007484f58
prerequisite-patch-id: a0318b66bb3f1f096f7d77c3f03e2018f68430b4
prerequisite-patch-id: 4d709e0d8ac627462de259723ac4fcb8efcc5342
prerequisite-patch-id: 811deca81c0cbdc5a3e977dd282f46427e79dbe2
prerequisite-patch-id: 8f66923ad1790ee9e567b9b1d155c7836c3e7cb8
prerequisite-patch-id: c0f2a71d9835e66a216af2ff3b3d434eec44ab0d
prerequisite-patch-id: 5e1a47e077d7bd22b1af9439e1cf1ae38830f763
prerequisite-patch-id: 04bd404d9e3268cbc399458be5bd69190852884a
prerequisite-patch-id: 6d630be7173e6e8da9a14739d32701f76bdf32a3
prerequisite-patch-id: 463c4f52f60b2c8fbf165caedbbc1bfa3bd2a265
prerequisite-patch-id: 67403a8553d60ec8938906f28319176f2ef0ecc4
prerequisite-patch-id: 18443a910e260eed010a2d4cd8f255678476eb0a
prerequisite-patch-id: cf8d1aab1c343ad9bb6de1b980bf7a8aa7479e79
prerequisite-patch-id: cb8ee956876a21478178d46383e760f2a29ec60a
prerequisite-patch-id: 0384e88e9105ce6907f44a55ae0d22bb57b11701
prerequisite-patch-id: 010b9094c8a9b1b41dc49fc07d9704a7be6374c0
prerequisite-patch-id: 3e96fcf9486ad8decca891534d4d2b41f786087a
prerequisite-patch-id: d77c491a6a5760ca828ecbb1445a77dcf9bebf0b
prerequisite-patch-id: 5c2e9b005429bca543ac6dd39912731d9388eb10
prerequisite-patch-id: 741c7b38494d42817d2d71adb6f267268c9cb208
prerequisite-patch-id: b97fb8b1e5848e8561fc599ef7173b2b07782918
prerequisite-patch-id: cca04ee447a117242679dc946638dd876bbaf931
prerequisite-patch-id: 7e7784bd5ec5ecfdb8d7130975a915fb88e8c26b
prerequisite-patch-id: 5a5137d28df7153718ef924d49a821fc1482b220
prerequisite-patch-id: 3d010e879709b5540948b11c2692a28fd5bdd1ea
prerequisite-patch-id: 3d418aca0f2a4a5a3e8cbd3c9da2a5229dd26f61
prerequisite-patch-id: 423c72136d6c85888dfac083efb54b518323f0dd
prerequisite-patch-id: 099453248d834931415e431e1bb470c1f99cdfa2
prerequisite-patch-id: 9fde172c51e107415194ecce2a3e218d2fab7f60
prerequisite-patch-id: 602a0f6b0121ef0296a3fe14872d59b8a0673b24
prerequisite-patch-id: ded33eb3b89b9da9e7a32ca5c6da3da2b65d3a83
prerequisite-patch-id: 56baaaf053e49e6306c076a80c5e7759a7c27805
prerequisite-patch-id: ec1ace1ef1e30d4c56143b3148b4f70c123ddd85
prerequisite-patch-id: da789135fed934d00e9020a90ec700a273fb18fa
prerequisite-patch-id: ca5e644043851df5c7472b4149806ac98b6cce5c
prerequisite-patch-id: d4f92797793802ce3021c4d1b45d2d0a94c51f07
prerequisite-patch-id: 992ab3fb9e82572494ff6f8af494ffbe8ba5cc6e
prerequisite-patch-id: 8baf34ed9789ac6a26f1d84648869131cea522fa
prerequisite-patch-id: 63f23c96115916e7707201d828fcab42ceeea385
prerequisite-patch-id: 7c166511597619b0f03043ce3a0a7237032bf7e0
prerequisite-patch-id: 35e2044bb5d5ea5d041ed01579943f6cffa6ee41
prerequisite-patch-id: 497b25db87c4c64173167f70d3a48154e44ca655
prerequisite-patch-id: d78941852e275e8b8ed03254a89324fef00fcf18
prerequisite-patch-id: 3cc8bd3f0886b6dca9197bfdba4bfa6ff360bf24
prerequisite-patch-id: 61890eaa88bcab4ac0aa2ef9a131d56ef8376f1d
prerequisite-patch-id: 097b002021ddd12f7b5180ccaa744ecce925f04b
prerequisite-patch-id: f599ecb06efafb8954fc9ad6d08a9819da860d28
prerequisite-patch-id: 484f86ad1f4fb5d8b2debfb1e7a8c7b6d0610f77
prerequisite-patch-id: 52db9f2823a1ad78ffb91f84911cd9963b295465
prerequisite-patch-id: d936469bba0e3720bf957995c0f842e56c815e85
prerequisite-patch-id: 9bfb8fba3a480dd5c8878fd307d96cbaaf521cff
prerequisite-patch-id: 13798977298ceb264b789af0eae36c714b0d17c1
prerequisite-patch-id: fc68338d9f90388d062471e46e9b691b00302c69
prerequisite-patch-id: 25e5e3c9ec0a10aa564b3cf32fe793aaf1e705b7
prerequisite-patch-id: 9160fde4ddf465965328264e443638a3ab0d09d9
prerequisite-patch-id: 20d490f27f569e5784d5501d842b4be8a4931127
prerequisite-patch-id: 9b7866c753c962fa8107eeff4d25ff40a546f329
prerequisite-patch-id: 653af78a35e216c7dc891a2d46849bdde83a5dfd
prerequisite-patch-id: f27f61687c1f423d4ad8f690a5114644364d26c5
prerequisite-patch-id: 705f5636837961012d4ad7cef93e3c06bf2828ad
prerequisite-patch-id: cf18ec6cc3cfb012e68e34f5319e5ca5fc08b04f
prerequisite-patch-id: 496d56c7025c252650cef84afef17c1cbe761011
prerequisite-patch-id: 849633dc3d51365926008341078b46e05349daf3
prerequisite-patch-id: bdd1c3731521ab2bec54b5757a1b1460ffa8a76b
prerequisite-patch-id: 7a4af5cc7a8d0c73fac182936c3034b8b97a1d81
prerequisite-patch-id: b6640f64140c35ef6614a47ac213d815eaacc385
prerequisite-patch-id: 619f2ef543c43d0e537cc5ec16a88aff8d08f7ee
prerequisite-patch-id: 5b7d7481f225dd506c53bc58d913b3dcf670ab3b
prerequisite-patch-id: 76b2c41e04d00656cff256f72fb81617baf75004
prerequisite-patch-id: e1e44b6305e28dc040a7495749756d39f086b407
prerequisite-patch-id: 23b6508f200dc43698cc460285ec47fef2e54a45
prerequisite-patch-id: b225a20694d23a03f11eab8c86a0a4b7b640a302
prerequisite-patch-id: e630536287ec238942c1948f8b966e15384fd3ff
prerequisite-patch-id: 327ccf1526eb31e0899de28c42c6bc687e274be5
prerequisite-patch-id: 6b4ab77555a60de86ad045538ea19460e0f65a27
prerequisite-patch-id: e9766937f032e867e3953ea53c47a5c385c68feb
prerequisite-patch-id: b6f9c8b0ac1722d3809bc48d89ace7070e1c447a
prerequisite-patch-id: e72efe42eec650c70433a02ce9c97ddeaef02d0d
prerequisite-patch-id: 9f17b908169ba05390869f3e35b69df00bd46d41
prerequisite-patch-id: b9a82d490d17914a2f80b0430cf4973dd93ccd2f
prerequisite-patch-id: 2563a1dcb7798936aa2c4a83dc1e1ddd585af241
prerequisite-patch-id: d4e0829e923f60dbf80b39493879280c8da2ff4e
prerequisite-patch-id: e42a585260f999d56d222e7b2f44405f6cfbc406
prerequisite-patch-id: e163a8cb28f70824dcde6295354df58a9ece12c0
prerequisite-patch-id: fb1ecde59655a27c8d3fdff20a66cbbe3f00bd6d
prerequisite-patch-id: 8cb6ee4b61ec57e6972ac1ee1253e85a7765deaa
prerequisite-patch-id: 499ac0cc3c1b5a08c8609ecc7d210c35edf01370
prerequisite-patch-id: 8434161ce61b9b53baf7c2643709e08bede8891d
prerequisite-patch-id: bf01608b5710ec0f4d041056988bf42e8785b7be
prerequisite-patch-id: 31a846018ddc61b29dffd1c56e8ef29c5aeb164b
prerequisite-patch-id: 1a0ab80ff0cde1bf49af90be105764d6504c42e2
prerequisite-patch-id: 4463e631ff73f48de1f761fa08fc2d3a0d02d2e3
prerequisite-patch-id: 1ef269c11829325108dc950ebb6ebbb0413f491d
prerequisite-patch-id: 244d96e340cb984ccaeb47ba1fc32c093df85877
prerequisite-patch-id: 6490e0a9923c2341d6aa355576fc178e830a10ef
prerequisite-patch-id: 73099e3b819e51e70cedf57b5de2da94161a789b
prerequisite-patch-id: 49c793919ad92fe3162b6cc8efac6762037534e1
prerequisite-patch-id: 53796f63653ecdf3f2a66d9cb3181546441d4ac0
prerequisite-patch-id: aa6fbd949a032b6fce2b599309f633393bc0bb08
prerequisite-patch-id: eb33de06c18bd23ef820d12cd5e340eda4fc15dc
prerequisite-patch-id: 9acaaae21935bd460bd45f89ac9e5b3c7be398fc
prerequisite-patch-id: d00c2306f14a27317918b63539f65df88ee08222
prerequisite-patch-id: 87cb389190ca57ff8250be430e3470b39575271d
prerequisite-patch-id: 2eaee2a99c51fd5a0df72b5253e8064d9facbcd0
prerequisite-patch-id: fa319f93ccd1f3f07955a69b793d0c3ca697fe56
prerequisite-patch-id: 8541186582e59ab7fc5b8242042d068b5ff344ec
prerequisite-patch-id: 02406627f62825a368975d64a3da2c68fafeccea
prerequisite-patch-id: 5ff0c64a0f40ad9c17a67f3ec4af3c24ca81ba7c
prerequisite-patch-id: 7f2ccb5fa7573dd10b4dec4d9b3dda8c5416e77e
prerequisite-patch-id: f32307884ffd5b79bb333fffbf7a1a1fb11e1077
prerequisite-patch-id: dc6d9a25a341dbd7ec34453b5692f0c4ee0e5ebd
prerequisite-patch-id: fdc3da57663352fd762b6ea8b3fb39545cd86f69
prerequisite-patch-id: 93933d68c7698bf5c66aaff4b9e61b8a7cd49deb
prerequisite-patch-id: 601286c6aae0c275b6ebc489197c21f6425d1dea
prerequisite-patch-id: b6bd48dfa8f1d956be0a63ccc27e0f2648ea6188
prerequisite-patch-id: d7bc5f0deb3489e698b5d93d756bb41fe334229e
prerequisite-patch-id: 3f3d8b03dc8e39e30049f94c234fb32333bea7ab
prerequisite-patch-id: e7e5398f510b2490efec81bc227ab3a66fda6db0
prerequisite-patch-id: db92723389041e01bed4d3cab7d800bd0060d44d
prerequisite-patch-id: 7ba892dca22bd88cb2b4f03e9c7ec3ab4828f365
prerequisite-patch-id: 56aac78c79b3a4329e7014d173c8f6edea4ebee1
prerequisite-patch-id: 10e17f897a2bb483d2cd0038598e5e2f08514e4a
prerequisite-patch-id: dfb16a3bd2e302f02dd89fd4337446b454100ed4
prerequisite-patch-id: 145f9e823ba743c9bf1c3f9abcdd1d4648a82d53
prerequisite-patch-id: f7152653caf4f759f0537fc8f7898261e839261a
prerequisite-patch-id: e727e63dd83f98fc829b6b74a11d7f936950aa14
prerequisite-patch-id: c5e20e303c45ddc096195a9d7c5c2cc2432f0290
prerequisite-patch-id: f448aa53083685570eb21b735641430a91610921
prerequisite-patch-id: 4e47d050a1ae9e74cfe36e050a3e0dace07b0409
prerequisite-patch-id: d6a6d1fa1758545ac55632916786db38b684e652
prerequisite-patch-id: 3d5f7033fe09ae00a22ec916ed8105ed3be786b5
prerequisite-patch-id: c6a7f29dbf64603b76a5a7f6f518c91c8fa69039
prerequisite-patch-id: 2c3aaf492801acbeace899e8be217cc8035f5c7c
prerequisite-patch-id: b3f3d12ed51b06b67a96c4b3663e7ade34f3adc5
prerequisite-patch-id: f0a12ddd1e70bc59307a38578b188a2eea485c13
prerequisite-patch-id: 6be34e0afc39be8a9afdb774869d69775541cac0
prerequisite-patch-id: fa5ad2a2e69c8d3dc9b93a2f4cea9d3bbd92c0e5
prerequisite-patch-id: 80b7366854987ae24fd8ed927c3ab5907adc60f3
prerequisite-patch-id: 177b9fdde3af8da75906b625305bd5847eacfa49
prerequisite-patch-id: ec22cfd443b6d05e5877fbb2ee30eb137263c7bf
prerequisite-patch-id: 5f70ec5094411544e135a98f86d4a4c127066af0
prerequisite-patch-id: 7f772f41522a420c0cdc7d5364360bea4d3039a5
prerequisite-patch-id: 5de29a882f6098628e28546fc428b8001a2982d6
prerequisite-patch-id: 6e47d332e95e4cf9a3035fb998fc33976a4248a7
prerequisite-patch-id: b1c10157994954d23ee292a9a47f0ce1141ae00b
prerequisite-patch-id: 5d61f469e90cba8e1bee425221833fe7735f101a
prerequisite-patch-id: aa12cd1065688dfd5c494fa3aab702353f984ed9
prerequisite-patch-id: 5cd9213fe4add5a27f75b8c53ab6273284912314
prerequisite-patch-id: 2b70a980645981bf08f09ae5ae904fabd91f06b4
prerequisite-patch-id: f3ad290f5818d0dc77bb80be76c3a5afd0c895e7
prerequisite-patch-id: f8f8e9b4fa84f6592dc0ec61cfb499b8a4dd34fe
prerequisite-patch-id: 2e0f2765db4c61542cb6f77afd0a6c96b4a96472
prerequisite-patch-id: 0bddb6b3ccb1ada7ab375b818262f4688d85b29c
prerequisite-patch-id: 6ade180f5ea4a054d8daea916cb56139a9e76534
prerequisite-patch-id: b59491087baa3ae50e93132d7c3f9757a9649c52
prerequisite-patch-id: 945182b64bab405af5aaec7d7f52c2a164c810eb
prerequisite-patch-id: 063d9ededd9f3d72340f5738c972e0803e3cdc96
prerequisite-patch-id: 8b80819a5b41866ad1aa2f5c171845a475b04484
prerequisite-patch-id: 38dcab15193713c2a59f5ac6b648aff53e6a36aa
prerequisite-patch-id: cc186287e3a5e027d3c6bb405a0e80a0036fab33
--
2.40.1
1 year, 5 months
[libvirt PATCH v2 0/4] Enable asynchronous teardown
by Boris Fiuczynski
Update capabilities for QEMU 8.1 on s390x, add a new capability
async-teardown and make use of it when running on s390x hosts to improve
memory reclaiming.
v2:
- switch to use on/off on the QEMU command line
- added configuration management of the feature to the domain XML
Boris Fiuczynski (3):
qemu: add run-with async-teardown capability
qemu: allow use of async teardown in domain
qemu: enable asynchronous teardown on s390x hosts
Shalini Chellathurai Saroja (1):
tests: add capabilities for QEMU 8.1.0 on s390x
docs/formatdomain.rst | 6 +
src/conf/domain_conf.c | 22 +
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 9 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 20 +
src/qemu/qemu_domain.c | 14 +
src/qemu/qemu_validate.c | 9 +
tests/domaincapsdata/qemu_8.1.0.s390x.xml | 285 +
.../caps_8.1.0_s390x.replies | 34594 ++++++++++++++++
.../qemucapabilitiesdata/caps_8.1.0_s390x.xml | 3719 ++
.../caps_8.1.0_x86_64.xml | 1 +
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 2 +-
...ith-2-ccw-virtio+ccw-virtio-1-explicit.xml | 1 -
...with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 2 +-
...otplug-base-ccw-live-with-2-ccw-virtio.xml | 2 +-
...-with-ccw-virtio+ccw-virtio-2-explicit.xml | 2 +-
...-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 2 +-
...uhotplug-base-ccw-live-with-ccw-virtio.xml | 2 +-
.../qemuhotplug-base-ccw-live.xml | 2 +-
.../async-teardown.x86_64-latest.args | 37 +
tests/qemuxml2argvdata/async-teardown.xml | 31 +
.../balloon-ccw-deflate.s390x-latest.args | 3 +-
.../console-sclp.s390x-latest.args | 7 +-
.../console-virtio-ccw.s390x-latest.args | 9 +-
.../cpu-s390-features.s390x-latest.args | 1 +
.../cpu-s390-zEC12.s390x-latest.args | 1 +
...default-video-type-s390x.s390x-latest.args | 5 +-
.../disk-error-policy-s390x.s390x-latest.args | 7 +-
.../disk-virtio-ccw-many.s390x-latest.args | 11 +-
.../disk-virtio-ccw.s390x-latest.args | 7 +-
.../disk-virtio-s390-zpci.s390x-latest.args | 7 +-
.../fs9p-ccw.s390x-latest.args | 11 +-
...tdev-scsi-vhost-scsi-ccw.s390x-latest.args | 9 +-
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 5 +-
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 5 +-
...dev-subsys-mdev-vfio-ccw.s390x-latest.args | 5 +-
...o-zpci-autogenerate-fids.s390x-latest.args | 11 +-
...o-zpci-autogenerate-uids.s390x-latest.args | 11 +-
...v-vfio-zpci-autogenerate.s390x-latest.args | 7 +-
...dev-vfio-zpci-boundaries.s390x-latest.args | 15 +-
...vfio-zpci-ccw-memballoon.s390x-latest.args | 9 +-
...io-zpci-multidomain-many.s390x-latest.args | 35 +-
.../hostdev-vfio-zpci.s390x-latest.args | 7 +-
.../input-virtio-ccw.s390x-latest.args | 11 +-
...othreads-virtio-scsi-ccw.s390x-latest.args | 9 +-
.../launch-security-s390-pv.s390x-latest.args | 7 +-
...chine-aeskeywrap-off-cap.s390x-latest.args | 3 +-
...hine-aeskeywrap-off-caps.s390x-latest.args | 3 +-
...achine-aeskeywrap-on-cap.s390x-latest.args | 3 +-
...chine-aeskeywrap-on-caps.s390x-latest.args | 3 +-
...chine-deakeywrap-off-cap.s390x-latest.args | 3 +-
...hine-deakeywrap-off-caps.s390x-latest.args | 3 +-
...achine-deakeywrap-on-cap.s390x-latest.args | 3 +-
...chine-deakeywrap-on-caps.s390x-latest.args | 3 +-
...achine-keywrap-none-caps.s390x-latest.args | 3 +-
.../machine-keywrap-none.s390x-latest.args | 3 +-
...machine-loadparm-hostdev.s390x-latest.args | 5 +-
...multiple-disks-nets-s390.s390x-latest.args | 15 +-
...achine-loadparm-net-s390.s390x-latest.args | 7 +-
.../machine-loadparm-s390.s390x-latest.args | 5 +-
.../net-virtio-ccw.s390x-latest.args | 11 +-
...low-bogus-usb-controller.s390x-latest.args | 11 +-
...390-allow-bogus-usb-none.s390x-latest.args | 11 +-
...0-async-teardown-disabled.s390x-6.0.0.args | 35 +
...-async-teardown-disabled.s390x-latest.args | 36 +
.../s390-async-teardown-disabled.xml | 24 +
...async-teardown-no-attrib.s390x-latest.args | 36 +
.../s390-async-teardown-no-attrib.xml | 24 +
.../s390-async-teardown.s390x-6.0.0.err | 1 +
.../s390-async-teardown.s390x-latest.args | 36 +
.../qemuxml2argvdata/s390-async-teardown.xml | 24 +
...t-cpu-kvm-ccw-virtio-2.7.s390x-latest.args | 3 +-
...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 5 +-
...t-cpu-tcg-ccw-virtio-2.7.s390x-latest.args | 3 +-
...t-cpu-tcg-ccw-virtio-4.2.s390x-latest.args | 3 +-
...no-async-teardown-autogen.s390x-6.0.0.args | 32 +
...o-async-teardown-autogen.s390x-latest.args | 33 +
.../s390-no-async-teardown-autogen.xml | 18 +
.../s390-panic-missing.s390x-latest.args | 7 +-
.../s390-panic-no-address.s390x-latest.args | 7 +-
.../s390-serial-2.s390x-latest.args | 5 +-
.../s390-serial-console.s390x-latest.args | 3 +-
.../s390-serial.s390x-latest.args | 3 +-
.../s390x-ccw-graphics.s390x-latest.args | 23 +-
.../s390x-ccw-headless.s390x-latest.args | 17 +-
.../vhost-vsock-ccw-auto.s390x-latest.args | 7 +-
.../vhost-vsock-ccw-iommu.s390x-latest.args | 7 +-
.../vhost-vsock-ccw-iommu.xml | 3 +
.../vhost-vsock-ccw.s390x-latest.args | 7 +-
.../video-virtio-gpu-ccw.s390x-latest.args | 9 +-
.../virtio-rng-ccw.s390x-latest.args | 11 +-
.../watchdog-diag288.s390x-latest.args | 7 +-
tests/qemuxml2argvtest.c | 9 +
.../async-teardown.x86_64-latest.xml | 44 +
.../default-video-type-s390x.s390x-latest.xml | 3 +
.../disk-virtio-s390-zpci.s390x-latest.xml | 3 +
...stdev-scsi-vhost-scsi-ccw.s390x-latest.xml | 3 +
...stdev-subsys-mdev-vfio-ap.s390x-latest.xml | 3 +
...subsys-mdev-vfio-ccw-boot.s390x-latest.xml | 3 +
...tdev-subsys-mdev-vfio-ccw.s390x-latest.xml | 3 +
...io-zpci-autogenerate-fids.s390x-latest.xml | 3 +
...io-zpci-autogenerate-uids.s390x-latest.xml | 3 +
...ev-vfio-zpci-autogenerate.s390x-latest.xml | 3 +
...tdev-vfio-zpci-boundaries.s390x-latest.xml | 3 +
...-vfio-zpci-ccw-memballoon.s390x-latest.xml | 3 +
...fio-zpci-multidomain-many.s390x-latest.xml | 3 +
.../hostdev-vfio-zpci.s390x-latest.xml | 3 +
.../input-virtio-ccw.s390x-latest.xml | 3 +
...iothreads-disk-virtio-ccw.s390x-latest.xml | 3 +
...iothreads-virtio-scsi-ccw.s390x-latest.xml | 3 +
.../machine-loadparm-hostdev.s390x-latest.xml | 3 +
...-multiple-disks-nets-s390.s390x-latest.xml | 3 +
...90-async-teardown-disabled.s390x-6.0.0.xml | 36 +
...0-async-teardown-disabled.s390x-latest.xml | 36 +
...-async-teardown-no-attrib.s390x-latest.xml | 36 +
.../s390-async-teardown.s390x-latest.xml | 36 +
...lt-cpu-kvm-ccw-virtio-2.7.s390x-latest.xml | 3 +
...lt-cpu-kvm-ccw-virtio-4.2.s390x-latest.xml | 3 +
...lt-cpu-tcg-ccw-virtio-2.7.s390x-latest.xml | 3 +
...lt-cpu-tcg-ccw-virtio-4.2.s390x-latest.xml | 3 +
.../s390-defaultconsole.s390x-latest.xml | 3 +
...-no-async-teardown-autogen.s390x-6.0.0.xml | 25 +
...no-async-teardown-autogen.s390x-latest.xml | 28 +
.../s390-panic-missing.s390x-latest.xml | 3 +
.../s390-panic-no-address.s390x-latest.xml | 3 +
.../s390-panic.s390x-latest.xml | 3 +
.../s390-serial-2.s390x-latest.xml | 3 +
.../s390-serial-console.s390x-latest.xml | 3 +
.../s390-serial.s390x-latest.xml | 3 +
.../s390x-ccw-graphics.s390x-latest.xml | 3 +
.../s390x-ccw-headless.s390x-latest.xml | 3 +
.../vhost-vsock-ccw-auto.s390x-latest.xml | 3 +
.../vhost-vsock-ccw.s390x-latest.xml | 3 +
...video-virtio-gpu-ccw-auto.s390x-latest.xml | 3 +
.../video-virtio-gpu-ccw.s390x-latest.xml | 3 +
tests/qemuxml2xmltest.c | 8 +
138 files changed, 39671 insertions(+), 197 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_8.1.0.s390x.xml
create mode 100644 tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
create mode 100644 tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
create mode 100644 tests/qemuxml2argvdata/async-teardown.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/async-teardown.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.xml
create mode 100644 tests/qemuxml2argvdata/s390-no-async-teardown-autogen.s390x-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/s390-no-async-teardown-autogen.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-no-async-teardown-autogen.xml
create mode 100644 tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-no-async-teardown-autogen.s390x-6.0.0.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-no-async-teardown-autogen.s390x-latest.xml
--
2.41.0
1 year, 5 months
[PATCH] os-posix: Allow 'chroot' via '-run-with' and deprecate the old '-chroot' option
by Thomas Huth
We recently introduced "-run-with" for options that influence the
runtime behavior of QEMU. This option has the big advantage that it
can group related options (so that it is easier for the users to spot
them) and that the options become introspectable via QMP this way.
So let's start moving more switches into this option group, starting
with "-chroot" now.
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
---
docs/about/deprecated.rst | 5 +++++
os-posix.c | 35 ++++++++++++++++++++++++++++++++++-
util/async-teardown.c | 21 ---------------------
qemu-options.hx | 18 +++++++++++++-----
4 files changed, 52 insertions(+), 27 deletions(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 0743459862..1cf53b86ce 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -116,6 +116,11 @@ Use "whpx" (on Windows) or "hvf" (on macOS) instead.
Use ``-run-with async-teardown=on`` instead.
+``-chroot`` (since 8.1)
+'''''''''''''''''''''''
+
+Use ``-run-with chroot=dir`` instead.
+
``-singlestep`` (since 8.1)
'''''''''''''''''''''''''''
diff --git a/os-posix.c b/os-posix.c
index 90ea71725f..0ae1fb2347 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -38,6 +38,7 @@
#include "qemu/cutils.h"
#include "qemu/config-file.h"
#include "qemu/option.h"
+#include "qemu/module.h"
#ifdef CONFIG_LINUX
#include <sys/prctl.h>
@@ -148,6 +149,7 @@ int os_parse_cmd_args(int index, const char *optarg)
}
break;
case QEMU_OPTION_chroot:
+ warn_report("option is deprecated, use '-run-with chroot=...' instead");
chroot_dir = optarg;
break;
case QEMU_OPTION_daemonize:
@@ -158,18 +160,25 @@ int os_parse_cmd_args(int index, const char *optarg)
case QEMU_OPTION_asyncteardown:
init_async_teardown();
break;
+#endif
case QEMU_OPTION_run_with: {
+ const char *str;
QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"),
optarg, false);
if (!opts) {
exit(1);
}
+#if defined(CONFIG_LINUX)
if (qemu_opt_get_bool(opts, "async-teardown", false)) {
init_async_teardown();
}
+#endif
+ str = qemu_opt_get(opts, "chroot");
+ if (str) {
+ chroot_dir = str;
+ }
break;
}
-#endif
default:
return -1;
}
@@ -348,3 +357,27 @@ int os_mlock(void)
return -ENOSYS;
#endif
}
+
+static QemuOptsList qemu_run_with_opts = {
+ .name = "run-with",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head),
+ .desc = {
+#if defined(CONFIG_LINUX)
+ {
+ .name = "async-teardown",
+ .type = QEMU_OPT_BOOL,
+ },
+#endif
+ {
+ .name = "chroot",
+ .type = QEMU_OPT_STRING,
+ },
+ { /* end of list */ }
+ },
+};
+
+static void register_teardown(void)
+{
+ qemu_add_opts(&qemu_run_with_opts);
+}
+opts_init(register_teardown);
diff --git a/util/async-teardown.c b/util/async-teardown.c
index 3ab19c8740..62cdeb0f20 100644
--- a/util/async-teardown.c
+++ b/util/async-teardown.c
@@ -12,9 +12,6 @@
*/
#include "qemu/osdep.h"
-#include "qemu/config-file.h"
-#include "qemu/option.h"
-#include "qemu/module.h"
#include <dirent.h>
#include <sys/prctl.h>
#include <sched.h>
@@ -147,21 +144,3 @@ void init_async_teardown(void)
clone(async_teardown_fn, new_stack_for_clone(), CLONE_VM, NULL);
sigprocmask(SIG_SETMASK, &old_signals, NULL);
}
-
-static QemuOptsList qemu_run_with_opts = {
- .name = "run-with",
- .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head),
- .desc = {
- {
- .name = "async-teardown",
- .type = QEMU_OPT_BOOL,
- },
- { /* end of list */ }
- },
-};
-
-static void register_teardown(void)
-{
- qemu_add_opts(&qemu_run_with_opts);
-}
-opts_init(register_teardown);
diff --git a/qemu-options.hx b/qemu-options.hx
index b57489d7ca..f49d4c0e3c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4670,11 +4670,12 @@ ERST
#ifndef _WIN32
DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
- "-chroot dir chroot to dir just before starting the VM\n",
+ "-chroot dir chroot to dir just before starting the VM (deprecated)\n",
QEMU_ARCH_ALL)
#endif
SRST
``-chroot dir``
+ Deprecated, use '-run-with chroot=...' instead.
Immediately before starting guest execution, chroot to the specified
directory. Especially useful in combination with -runas.
ERST
@@ -4861,13 +4862,16 @@ SRST
This option is deprecated and should no longer be used. The new option
``-run-with async-teardown=on`` is a replacement.
ERST
+#endif
+#ifdef CONFIG_POSIX
DEF("run-with", HAS_ARG, QEMU_OPTION_run_with,
- "-run-with async-teardown[=on|off]\n"
- " misc QEMU process lifecycle options\n"
- " async-teardown=on enables asynchronous teardown\n",
+ "-run-with [async-teardown=on|off][,chroot=dir]\n"
+ " Set miscellaneous QEMU process lifecycle options:\n"
+ " async-teardown=on enables asynchronous teardown (Linux only)\n"
+ " chroot=dir chroot to dir just before starting the VM\n",
QEMU_ARCH_ALL)
SRST
-``-run-with``
+``-run-with [async-teardown=on|off][,chroot=dir]``
Set QEMU process lifecycle options.
``async-teardown=on`` enables asynchronous teardown. A new process called
@@ -4880,6 +4884,10 @@ SRST
performed correctly. This only works if the cleanup process is not
forcefully killed with SIGKILL before the main QEMU process has
terminated completely.
+
+ ``chroot=dir`` can be used for doing a chroot to the specified directory
+ immediately before starting the guest execution. This is especially useful
+ in combination with -runas.
ERST
#endif
--
2.39.3
1 year, 6 months
[PATCH v6] vfio/pci: Propagate ACPI notifications to user-space via eventfd
by Grzegorz Jaszczyk
To allow pass-through devices receiving ACPI notifications, permit to
register ACPI notify handler (via VFIO_DEVICE_SET_IRQS) for a given
device. The handler role is to receive and propagate such ACPI
notifications to the user-space through the user provided eventfd. This
allows VMM to receive and propagate them further to the VM, where the
actual driver for pass-through device resides and can react to device
specific notifications accordingly.
The eventfd usage ensures VMM and device isolation: it allows to use a
dedicated channel associated with the device for such events, such that
the VMM has direct access.
Since the eventfd counter is used as ACPI notification value
placeholder, the eventfd signaling needs to be serialized in order to
not end up with notification values being coalesced. Therefore ACPI
notification values are buffered and signalized one by one, when the
previous notification value has been consumed.
Signed-off-by: Grzegorz Jaszczyk <jaz(a)semihalf.com>
---
Changelog v5..v6
- Get rid of #if IS_ENABLED(CONFIG_ACPI) from vfio_pci_intrs.c
- There is no need to keep vfio_acpi_notification struct definition in
header, make it private and move to cpi_notify.c
- Add lockdep_asserts in acpi_notification_dequeue
- notification_list_lock was not initialized which triggers some
warning with CONFIG_DEBUG_MUTEXES enabled (it was not logical error
since mentioned mutex was zeroed thanks to kzalloc it is just
DEBUG_MUTEXES performs extra checks and sets lock->magic).
- Change notification_lock from mutex to semaphore (notification_sem).
The logic was working fine with the mutex but enabling lockdep support
made me realize that the mutex has to be released by the same task
which acquires it and it is checked with lockdep enabled. Semaphore
does not have such a restriction.
- In order to correctly handle some sequences such as:
* user configures a notification eventfd
* a notification fires
* the user closes the eventfd without reading it, and then tries
to swap in a different eventfd ctx
separate the entire eventfd context together with notification_sem
from the main vfio_acpi_notification struct. Thanks to that entire,
separate eventfd ctx could be swapped leaving the previous eventfd ctx
untouched. The new eventfd has its separate notification_sem
initialized and will not depend on previous eventfd ctx. Additionally
when the last handle to old eventfd will be released and EPOLLHUP
triggered, old eventfd ctx will be cleaned-up.
- Together with the above add support for required EPOLLHUP handling.
- Add missing fput invocations.
- Move some common code into vfio_acpi_eventfd_init and use it during
registration and eventfd swapping.
- v5: https://patchwork.kernel.org/project/kvm/patch/20230609133950.2197552-1-j...
Changelog v4..v5
Address Alex Williamson's feedback:
- s/vfio_acpi_notify.{c,o}/acpi_notify.{c,o}
- Do not put acpi_notify to its own module but fold it into main
vfio.ko. Additionally select it from VFIO_PCI_CORE instead of VFIO_PCI.
- Cleanup acpi notify under igate mutex (in vfio_pci_core_close_device).
- Add extra check for ACPI companion in vfio_pci_get_irq_count and
extend vfio_pci_ioctl_get_irq_info.
- Drop acpi.h include - linux/vfio_acpi_notify.h includes it already.
- Send device check notification value for DATA_NONE and non-zero count
and for DATA_BOOL and non-zero count (as for loopback testing).
- Drop some redundant !acpi_notify->acpi_notify_trigger checks.
- Move some common code to new helper functions:
1) acpi_notification_dequeue
2) vfio_acpi_notify_cleanup and rename previous
vfio_acpi_notify_cleanup into vfio_remove_acpi_notify which uses it
- Add rate limited logging for dropped notifications.
- Move vdev->acpi_notification pointer cleanup to the
vfio_acpi_notify_cleanup function this also fixes two bigger issues
caught by Alex.
- Allow the eventfd to be swapped.
- s/GFP_KERNEL/GFP_KERNEL_ACCOUNT.
- s/VFIO_PCI_ACPI_NTFY_IRQ_INDEX/VFIO_PCI_ACPI_IRQ_INDEX.
- Add header protection for multiple includes.
- v4: https://patchwork.kernel.org/project/kvm/patch/20230522165811.123417-1-ja...
Changelog v3..v4
Address Alex Williamson feedback:
- Instead of introducing new ioctl used for eventfd registration, take
advantage of VFIO_DEVICE_SET_IRQS which already supports virtual IRQs
for things like error notification and device release requests.
- Introduced mechanism preventing creation of large queues.
Other:
- Move the implementation into the newly introduced VFIO_ACPI_NOTIFY
helper module. It is actually not bound to VFIO_PCI but VFIO_PCI
enables it whenever ACPI support is enabled. This change is introduced
since ACPI notifications are not limited to PCI devices, making it PCI
independent will allow to re-use it also for other VFIO_* like
supports: e.g. VFIO_PLATFORM in the future if needed. Moving it out of
drivers/vfio/pci/ was also suggested offline.
- s/notify_val_next/node
- v3: https://patchwork.kernel.org/project/kvm/patch/20230502132700.654528-1-ja...
Changelog v2..v3:
- Fix compilation warnings when building with "W=1"
Changelog v1..v2:
- The v2 implementation is actually completely different then v1:
instead of using acpi netlink events for propagating ACPI
notifications to the user space take advantage of eventfd, which can
provide better VMM and device isolation: it allows to use a dedicated
channel associated with the device for such events, such that the VMM
has direct access.
- Using eventfd counter as notification value placeholder was suggested
in v1 and requires additional serialization logic introduced in v2.
- Since the vfio-pci supports non-ACPI platforms address !CONFIG_ACPI
case.
- v1 discussion: https://patchwork.kernel.org/project/kvm/patch/20230307220553.631069-1-ja...
---
drivers/vfio/Kconfig | 5 +
drivers/vfio/Makefile | 1 +
drivers/vfio/acpi_notify.c | 324 ++++++++++++++++++++++++++++++
drivers/vfio/pci/Kconfig | 1 +
drivers/vfio/pci/vfio_pci_core.c | 13 ++
drivers/vfio/pci/vfio_pci_intrs.c | 80 ++++++++
include/linux/vfio_acpi_notify.h | 36 ++++
include/linux/vfio_pci_core.h | 1 +
include/uapi/linux/vfio.h | 1 +
9 files changed, 462 insertions(+)
create mode 100644 drivers/vfio/acpi_notify.c
create mode 100644 include/linux/vfio_acpi_notify.h
diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
index 89e06c981e43..cd9df43a4eb4 100644
--- a/drivers/vfio/Kconfig
+++ b/drivers/vfio/Kconfig
@@ -12,6 +12,11 @@ menuconfig VFIO
If you don't know what to do here, say N.
if VFIO
+config VFIO_ACPI_NOTIFY
+ bool
+ depends on ACPI
+ default n
+
config VFIO_CONTAINER
bool "Support for the VFIO container /dev/vfio/vfio"
select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
index 70e7dcb302ef..003c2b041785 100644
--- a/drivers/vfio/Makefile
+++ b/drivers/vfio/Makefile
@@ -7,6 +7,7 @@ vfio-y += vfio_main.o \
vfio-$(CONFIG_IOMMUFD) += iommufd.o
vfio-$(CONFIG_VFIO_CONTAINER) += container.o
vfio-$(CONFIG_VFIO_VIRQFD) += virqfd.o
+vfio-$(CONFIG_VFIO_ACPI_NOTIFY) += acpi_notify.o
obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
diff --git a/drivers/vfio/acpi_notify.c b/drivers/vfio/acpi_notify.c
new file mode 100644
index 000000000000..b78c33077dfa
--- /dev/null
+++ b/drivers/vfio/acpi_notify.c
@@ -0,0 +1,324 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * VFIO ACPI notification propagation
+ *
+ * Author: Grzegorz Jaszczyk <jaz(a)semihalf.com>
+ */
+#include <linux/file.h>
+#include <linux/semaphore.h>
+#include <linux/vfio_acpi_notify.h>
+
+#define NOTIFICATION_QUEUE_SIZE 20
+
+struct acpi_eventfd_ctx {
+ struct eventfd_ctx *acpi_notify_trigger;
+ struct file *acpi_notify_trigger_file;
+ struct semaphore notification_sem;
+ struct work_struct acpi_notification_work;
+ wait_queue_entry_t wait;
+ poll_table pt;
+ struct vfio_acpi_notification *acpi_notify;
+};
+
+struct vfio_acpi_notification {
+ struct acpi_eventfd_ctx *acpi_eventfd;
+ struct list_head notification_list;
+ struct mutex notification_list_lock;
+ int notification_queue_count;
+};
+
+struct notification_queue {
+ int notification_val;
+ struct list_head node;
+};
+
+static int vfio_eventfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
+ int sync, void *key)
+{
+ struct acpi_eventfd_ctx *acpi_eventfdctx =
+ container_of(wait, struct acpi_eventfd_ctx, wait);
+ __poll_t flags = key_to_poll(key);
+
+ /*
+ * eventfd_read signalize EPOLLOUT at the end of its function - this
+ * means previous eventfd with its notification value was consumed so
+ * the next notification can be signalized now if pending - schedule
+ * proper work.
+ */
+ if (flags & EPOLLOUT) {
+ up(&acpi_eventfdctx->notification_sem);
+
+ schedule_work(&acpi_eventfdctx->acpi_notification_work);
+ }
+
+ /*
+ * Even if the eventfd is closed lets still queue notifications so they
+ * can be replicated when new eventfd is registered (see "Allow eventfd
+ * to be swapped").
+ *
+ * Below will be reached only in case user closes eventfd and then
+ * trigger eventfd swap (or vice-versa).
+ */
+ if (flags & EPOLLHUP) {
+ /*
+ * eventfd_release after signalling EPOLLHUP calls eventfd_ctx_put
+ * so no need to do it here.
+ */
+
+ kfree(acpi_eventfdctx);
+ }
+
+ return 0;
+}
+
+static void vfio_ptable_queue_proc(struct file *file,
+ wait_queue_head_t *wqh, poll_table *pt)
+{
+ struct acpi_eventfd_ctx *acpi_eventfdctx =
+ container_of(pt, struct acpi_eventfd_ctx, pt);
+
+ add_wait_queue(wqh, &acpi_eventfdctx->wait);
+}
+
+static struct notification_queue *
+acpi_notification_dequeue(struct vfio_acpi_notification *acpi_notify)
+{
+ struct notification_queue *oldest_entry;
+
+ lockdep_assert_held(&acpi_notify->notification_list_lock);
+
+ oldest_entry = list_first_entry(&acpi_notify->notification_list,
+ struct notification_queue,
+ node);
+ list_del(&oldest_entry->node);
+ acpi_notify->notification_queue_count--;
+
+ return oldest_entry;
+}
+
+static void acpi_notification_work_fn(struct work_struct *work)
+{
+ struct acpi_eventfd_ctx *acpi_eventfdctx;
+ struct vfio_acpi_notification *acpi_notify;
+ struct notification_queue *entry;
+
+ acpi_eventfdctx = container_of(work, struct acpi_eventfd_ctx,
+ acpi_notification_work);
+
+ acpi_notify = acpi_eventfdctx->acpi_notify;
+
+ mutex_lock(&acpi_notify->notification_list_lock);
+ if (list_empty(&acpi_notify->notification_list))
+ goto out;
+
+ /*
+ * If the previous eventfd was not yet consumed by user-space lets hold
+ * on and exit. The notification function will be rescheduled when
+ * signaling eventfd will be possible (when the EPOLLOUT will be
+ * signalized and unlocks notify_events or when eventfd will be swapped).
+ */
+ if (down_trylock(&acpi_eventfdctx->notification_sem))
+ goto out;
+
+ entry = acpi_notification_dequeue(acpi_notify);
+
+ mutex_unlock(&acpi_notify->notification_list_lock);
+
+ eventfd_signal(acpi_eventfdctx->acpi_notify_trigger, entry->notification_val);
+
+ kfree(entry);
+
+ return;
+out:
+ mutex_unlock(&acpi_notify->notification_list_lock);
+}
+
+static void
+vfio_acpi_notify_cleanup(struct vfio_acpi_notification **acpi_notify_ptr,
+ struct acpi_device *adev)
+{
+ struct vfio_acpi_notification *acpi_notify = *acpi_notify_ptr;
+ struct acpi_eventfd_ctx *acpi_eventfd = acpi_notify->acpi_eventfd;
+ struct notification_queue *entry, *entry_tmp;
+ u64 cnt;
+
+ eventfd_ctx_remove_wait_queue(acpi_eventfd->acpi_notify_trigger,
+ &acpi_eventfd->wait, &cnt);
+
+ flush_work(&acpi_eventfd->acpi_notification_work);
+
+ mutex_lock(&acpi_notify->notification_list_lock);
+ list_for_each_entry_safe(entry, entry_tmp,
+ &acpi_notify->notification_list,
+ node) {
+ list_del(&entry->node);
+ kfree(entry);
+ }
+ mutex_unlock(&acpi_notify->notification_list_lock);
+
+ eventfd_ctx_put(acpi_eventfd->acpi_notify_trigger);
+
+ /*
+ * fput releases references to eventfd file but it will not trigger the
+ * vfio_eventfd_wakeup with EPOLLHUP since eventfd_ctx_remove_wait_queue
+ * was already called and removed wq entry (wait) from the eventfd
+ * wq head.
+ */
+ fput(acpi_eventfd->acpi_notify_trigger_file);
+
+ kfree(acpi_notify->acpi_eventfd);
+ kfree(acpi_notify);
+
+ *acpi_notify_ptr = NULL;
+}
+
+static void vfio_acpi_notify_handler(acpi_handle handle, u32 event, void *data)
+{
+ struct vfio_acpi_notification *acpi_notify = (struct vfio_acpi_notification *)data;
+ struct notification_queue *entry;
+
+ entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+ if (!entry)
+ return;
+
+ entry->notification_val = event;
+ INIT_LIST_HEAD(&entry->node);
+
+ mutex_lock(&acpi_notify->notification_list_lock);
+ if (acpi_notify->notification_queue_count > NOTIFICATION_QUEUE_SIZE) {
+ struct notification_queue *oldest_entry =
+ acpi_notification_dequeue(acpi_notify);
+
+ if (printk_ratelimit())
+ acpi_handle_warn(handle,
+ "dropping notification value %d\n",
+ oldest_entry->notification_val);
+
+ kfree(oldest_entry);
+ }
+ list_add_tail(&entry->node, &acpi_notify->notification_list);
+ acpi_notify->notification_queue_count++;
+ mutex_unlock(&acpi_notify->notification_list_lock);
+
+ schedule_work(&acpi_notify->acpi_eventfd->acpi_notification_work);
+}
+
+void vfio_acpi_notify(struct acpi_device *adev, u32 event, void *data)
+{
+ acpi_handle handle = adev->handle;
+
+ vfio_acpi_notify_handler(handle, event, data);
+}
+EXPORT_SYMBOL_GPL(vfio_acpi_notify);
+
+void vfio_remove_acpi_notify(struct vfio_acpi_notification **acpi_notify_ptr,
+ struct acpi_device *adev)
+{
+ struct vfio_acpi_notification *acpi_notify = *acpi_notify_ptr;
+
+ if (!acpi_notify)
+ return;
+
+ acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
+ vfio_acpi_notify_handler);
+
+ vfio_acpi_notify_cleanup(acpi_notify_ptr, adev);
+}
+EXPORT_SYMBOL_GPL(vfio_remove_acpi_notify);
+
+static void vfio_acpi_eventfd_init(struct vfio_acpi_notification *acpi_notify,
+ struct eventfd_ctx *efdctx, int32_t fd)
+{
+ struct acpi_eventfd_ctx *acpi_eventfd;
+
+ acpi_eventfd = kzalloc(sizeof(struct acpi_eventfd_ctx), GFP_KERNEL_ACCOUNT);
+
+ INIT_WORK(&acpi_eventfd->acpi_notification_work, acpi_notification_work_fn);
+ acpi_eventfd->acpi_notify_trigger = efdctx;
+
+ sema_init(&acpi_eventfd->notification_sem, 1);
+
+ /*
+ * Install custom wake-up handler to be notified whenever underlying
+ * eventfd is consumed by the user-space.
+ */
+ init_waitqueue_func_entry(&acpi_eventfd->wait, vfio_eventfd_wakeup);
+ init_poll_funcptr(&acpi_eventfd->pt, vfio_ptable_queue_proc);
+
+ acpi_eventfd->acpi_notify_trigger_file = eventfd_fget(fd);
+ vfs_poll(acpi_eventfd->acpi_notify_trigger_file, &acpi_eventfd->pt);
+
+ acpi_eventfd->acpi_notify = acpi_notify;
+ acpi_notify->acpi_eventfd = acpi_eventfd;
+}
+
+int vfio_register_acpi_notify_handler(struct vfio_acpi_notification **acpi_notify_ptr,
+ struct acpi_device *adev, int32_t fd)
+{
+ struct vfio_acpi_notification *acpi_notify = *acpi_notify_ptr;
+ struct eventfd_ctx *efdctx;
+ acpi_status status;
+
+ if (fd < -1)
+ return -EINVAL;
+ else if (fd == -1) {
+ vfio_remove_acpi_notify(acpi_notify_ptr, adev);
+ return 0;
+ }
+
+ efdctx = eventfd_ctx_fdget(fd);
+ if (IS_ERR(efdctx))
+ return PTR_ERR(efdctx);
+
+ /* Allow eventfd to be swapped */
+ if (acpi_notify) {
+ struct file *trigger_file_before_swap =
+ acpi_notify->acpi_eventfd->acpi_notify_trigger_file;
+
+ /*
+ * Lets allocate new acpi_eventfd_ctx, the previous is
+ * alive until eventfd is closed.
+ */
+ vfio_acpi_eventfd_init(acpi_notify, efdctx, fd);
+
+ /*
+ * The ACPI notifications could arrive and be queued during
+ * eventfd swap, retrigger the worker after notification
+ * replication unlocking.
+ */
+ schedule_work(&acpi_notify->acpi_eventfd->acpi_notification_work);
+
+ /*
+ * If the last reference to acpi_notify_trigger_file was
+ * released, the EPOLLHUP will be handled (but not immediately
+ * since fput is async).
+ */
+ fput(trigger_file_before_swap);
+
+ return 0;
+ }
+
+ acpi_notify = kzalloc(sizeof(*acpi_notify), GFP_KERNEL_ACCOUNT);
+ if (!acpi_notify)
+ return -ENOMEM;
+
+ *acpi_notify_ptr = acpi_notify;
+ mutex_init(&acpi_notify->notification_list_lock);
+ INIT_LIST_HEAD(&acpi_notify->notification_list);
+
+ vfio_acpi_eventfd_init(acpi_notify, efdctx, fd);
+
+ status = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
+ vfio_acpi_notify_handler, (void *)acpi_notify);
+ if (ACPI_FAILURE(status)) {
+ dev_err(&adev->dev, "Failed to install notify handler: %s",
+ acpi_format_exception(status));
+
+ vfio_acpi_notify_cleanup(acpi_notify_ptr, adev);
+
+ return -ENODEV;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(vfio_register_acpi_notify_handler);
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
index f9d0c908e738..f03ca773dfd9 100644
--- a/drivers/vfio/pci/Kconfig
+++ b/drivers/vfio/pci/Kconfig
@@ -4,6 +4,7 @@ config VFIO_PCI_CORE
tristate
select VFIO_VIRQFD
select IRQ_BYPASS_MANAGER
+ select VFIO_ACPI_NOTIFY if ACPI
config VFIO_PCI_MMAP
def_bool y if !S390
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index a5ab416cf476..1cc4a9c05403 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -27,6 +27,7 @@
#include <linux/vgaarb.h>
#include <linux/nospec.h>
#include <linux/sched/mm.h>
+#include <linux/vfio_acpi_notify.h>
#if IS_ENABLED(CONFIG_EEH)
#include <asm/eeh.h>
#endif
@@ -683,6 +684,7 @@ void vfio_pci_core_close_device(struct vfio_device *core_vdev)
{
struct vfio_pci_core_device *vdev =
container_of(core_vdev, struct vfio_pci_core_device, vdev);
+ struct acpi_device *adev = ACPI_COMPANION(&vdev->pdev->dev);
if (vdev->sriov_pf_core_dev) {
mutex_lock(&vdev->sriov_pf_core_dev->vf_token->lock);
@@ -704,6 +706,8 @@ void vfio_pci_core_close_device(struct vfio_device *core_vdev)
eventfd_ctx_put(vdev->req_trigger);
vdev->req_trigger = NULL;
}
+ if (adev)
+ vfio_remove_acpi_notify(&vdev->acpi_notification, adev);
mutex_unlock(&vdev->igate);
}
EXPORT_SYMBOL_GPL(vfio_pci_core_close_device);
@@ -725,6 +729,8 @@ EXPORT_SYMBOL_GPL(vfio_pci_core_finish_enable);
static int vfio_pci_get_irq_count(struct vfio_pci_core_device *vdev, int irq_type)
{
+ struct acpi_device *adev = ACPI_COMPANION(&vdev->pdev->dev);
+
if (irq_type == VFIO_PCI_INTX_IRQ_INDEX) {
u8 pin;
@@ -761,6 +767,8 @@ static int vfio_pci_get_irq_count(struct vfio_pci_core_device *vdev, int irq_typ
return 1;
} else if (irq_type == VFIO_PCI_REQ_IRQ_INDEX) {
return 1;
+ } else if (adev && irq_type == VFIO_PCI_ACPI_IRQ_INDEX) {
+ return 1;
}
return 0;
@@ -1084,6 +1092,7 @@ static int vfio_pci_ioctl_get_irq_info(struct vfio_pci_core_device *vdev,
struct vfio_irq_info __user *arg)
{
unsigned long minsz = offsetofend(struct vfio_irq_info, count);
+ struct acpi_device *adev = ACPI_COMPANION(&vdev->pdev->dev);
struct vfio_irq_info info;
if (copy_from_user(&info, arg, minsz))
@@ -1096,6 +1105,10 @@ static int vfio_pci_ioctl_get_irq_info(struct vfio_pci_core_device *vdev,
case VFIO_PCI_INTX_IRQ_INDEX ... VFIO_PCI_MSIX_IRQ_INDEX:
case VFIO_PCI_REQ_IRQ_INDEX:
break;
+ case VFIO_PCI_ACPI_IRQ_INDEX:
+ if (adev)
+ break;
+ return -EINVAL;
case VFIO_PCI_ERR_IRQ_INDEX:
if (pci_is_pcie(vdev->pdev))
break;
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index bffb0741518b..27d0c4cdc3c9 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -19,6 +19,7 @@
#include <linux/vfio.h>
#include <linux/wait.h>
#include <linux/slab.h>
+#include <linux/vfio_acpi_notify.h>
#include "vfio_pci_priv.h"
@@ -667,6 +668,71 @@ static int vfio_pci_set_req_trigger(struct vfio_pci_core_device *vdev,
count, flags, data);
}
+static int
+vfio_pci_set_acpi_ntfy_trigger(struct vfio_pci_core_device *vdev,
+ unsigned int index, unsigned int start,
+ unsigned int count, uint32_t flags, void *data)
+{
+ struct acpi_device *adev = ACPI_COMPANION(&vdev->pdev->dev);
+
+ if (index != VFIO_PCI_ACPI_IRQ_INDEX || start != 0 || count > 1)
+ return -EINVAL;
+
+ if (!adev)
+ return -ENODEV;
+
+ if (!vdev->acpi_notification)
+ return -EINVAL;
+
+ /*
+ * Disable notifications: flags = (DATA_NONE|ACTION_TRIGGER), count = 0
+ * Enable loopback testing: (DATA_BOOL|ACTION_TRIGGER) or
+ * (DATA_NONE|ACTION_TRIGGER), count != 0
+ */
+ if (flags & VFIO_IRQ_SET_DATA_NONE) {
+ if (count)
+ vfio_acpi_notify(adev, ACPI_NOTIFY_DEVICE_CHECK,
+ vdev->acpi_notification);
+ else
+ vfio_remove_acpi_notify(&vdev->acpi_notification, adev);
+
+ return 0;
+ } else if (flags & VFIO_IRQ_SET_DATA_BOOL) {
+ uint8_t trigger;
+
+ if (!count)
+ return -EINVAL;
+
+ trigger = *(uint8_t *)data;
+ if (trigger)
+ vfio_acpi_notify(adev, ACPI_NOTIFY_DEVICE_CHECK,
+ vdev->acpi_notification);
+
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+static int
+vfio_pci_set_acpi_ntfy_eventfd_trigger(struct vfio_pci_core_device *vdev,
+ unsigned int index, unsigned int start,
+ unsigned int count, uint32_t flags, void *data)
+{
+ struct acpi_device *adev = ACPI_COMPANION(&vdev->pdev->dev);
+ int32_t fd;
+
+ if (index != VFIO_PCI_ACPI_IRQ_INDEX || start != 0 || count != 1)
+ return -EINVAL;
+
+ if (!adev)
+ return -ENODEV;
+
+ fd = *(int32_t *)data;
+
+ return vfio_register_acpi_notify_handler(&vdev->acpi_notification, adev, fd);
+}
+
int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,
unsigned index, unsigned start, unsigned count,
void *data)
@@ -716,6 +782,20 @@ int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,
break;
}
break;
+ case VFIO_PCI_ACPI_IRQ_INDEX:
+ switch (flags & VFIO_IRQ_SET_ACTION_TYPE_MASK) {
+ case VFIO_IRQ_SET_ACTION_TRIGGER:
+ switch (flags & VFIO_IRQ_SET_DATA_TYPE_MASK) {
+ case VFIO_IRQ_SET_DATA_BOOL:
+ case VFIO_IRQ_SET_DATA_NONE:
+ func = vfio_pci_set_acpi_ntfy_trigger;
+ break;
+ case VFIO_IRQ_SET_DATA_EVENTFD:
+ func = vfio_pci_set_acpi_ntfy_eventfd_trigger;
+ break;
+ }
+ }
+ break;
}
if (!func)
diff --git a/include/linux/vfio_acpi_notify.h b/include/linux/vfio_acpi_notify.h
new file mode 100644
index 000000000000..e29e4274d192
--- /dev/null
+++ b/include/linux/vfio_acpi_notify.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * VFIO ACPI notification replication
+ *
+ * Author: Grzegorz Jaszczyk <jaz(a)semihalf.com>
+ */
+#include <linux/acpi.h>
+#include <linux/eventfd.h>
+#include <linux/poll.h>
+
+#ifndef VFIO_ACPI_NOTIFY_H
+#define VFIO_ACPI_NOTIFY_H
+
+struct vfio_acpi_notification;
+
+#if IS_ENABLED(CONFIG_ACPI)
+void vfio_acpi_notify(struct acpi_device *adev, u32 event, void *data);
+int vfio_register_acpi_notify_handler(struct vfio_acpi_notification **acpi_notify,
+ struct acpi_device *adev, int32_t fd);
+void vfio_remove_acpi_notify(struct vfio_acpi_notification **acpi_notify,
+ struct acpi_device *adev);
+#else
+static inline void vfio_acpi_notify(struct acpi_device *adev, u32 event, void *data) {}
+static inline int
+vfio_register_acpi_notify_handler(struct vfio_acpi_notification **acpi_notify,
+ struct acpi_device *adev, int32_t fd)
+{
+ return -ENODEV;
+}
+
+static inline void
+vfio_remove_acpi_notify(struct vfio_acpi_notification **acpi_notify,
+ struct acpi_device *adev) {}
+#endif /* CONFIG_ACPI */
+
+#endif /* VFIO_ACPI_NOTIFY_H */
diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h
index 367fd79226a3..a4491b3d8064 100644
--- a/include/linux/vfio_pci_core.h
+++ b/include/linux/vfio_pci_core.h
@@ -96,6 +96,7 @@ struct vfio_pci_core_device {
struct mutex vma_lock;
struct list_head vma_list;
struct rw_semaphore memory_lock;
+ struct vfio_acpi_notification *acpi_notification;
};
/* Will be exported for vfio pci drivers usage */
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index b71276bd7f91..ee8ba6354662 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -625,6 +625,7 @@ enum {
VFIO_PCI_MSIX_IRQ_INDEX,
VFIO_PCI_ERR_IRQ_INDEX,
VFIO_PCI_REQ_IRQ_INDEX,
+ VFIO_PCI_ACPI_IRQ_INDEX,
VFIO_PCI_NUM_IRQS
};
--
2.41.0.255.g8b1d071c50-goog
1 year, 6 months
[PATCH 0/2] qemu: VM saving related fixes
by Peter Krempa
Peter Krempa (2):
qemu: driver: Reformat helpers for saving VM state
Properly mark auto-added 'terminator' virStorageSource
src/qemu/qemu_domain.c | 4 +++-
src/qemu/qemu_driver.c | 11 +++++++----
src/storage_file/storage_source.c | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
--
2.41.0
1 year, 6 months
[PATCH 0/2] NEWS update for upcoming release
by Peter Krempa
Peter Krempa (2):
NEWS: Move section about 'discard_no_unref' to features
NEWS: Document changes for the release
NEWS.rst | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 5 deletions(-)
--
2.41.0
1 year, 6 months
Entering freeze for libvirt-9.5.0
by Jiri Denemark
I have just tagged v9.5.0-rc1 in the repository and pushed signed
tarballs and source RPMs to https://download.libvirt.org/
Please give the release candidate some testing and in case you find a
serious issue which should have a fix in the upcoming release, feel
free to reply to this thread to make sure the issue is more visible.
If you have not done so yet, please update NEWS.rst to document any
significant change you made since the last release.
Thanks,
Jirka
1 year, 6 months
[PATCH] apparmor: Add support for local profile customizations
by Jim Fehlig
Apparmor profiles in /etc/apparmor.d/ are config files that can and should
be replaced on package upgrade, which introduces the potential to overwrite
any local changes. Apparmor supports local profile customizations via
/etc/apparmor.d/local/<service> [1].
This change makes the support explicit by adding libvirtd, virtqemud, and
virtxend profile customization stubs to /etc/apparmor.d/local/. The stubs
are conditionally included by the corresponding main profiles.
[1] https://ubuntu.com/server/docs/security-apparmor
See "Profile customization" section
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This patch was inspired by an internal bug report. The SUSE libvirt package
has marked /etc/apparmor.d/<some-libvirt-service> profiles as
'config(noreplace)' for as long as I can remember. On rare occasions a
profile receives a change that is required to avoid regression. And on rarer
occasions a user might have made local customizations to the profile. With
'noreplace', the trap is set for the user to experience the regression.
Unless other apparmor users convince me otherwise, I'm planning to make
this change in the SUSE package, along with changing the main
/etc/apparmor.d/ profiles to 'config' and using 'config(noreplace)' for the
local customizations only.
Note: I'm fine keeping this as a downstream-only patch if upstream isn't
interested in the clutter.
src/security/apparmor/meson.build | 12 +++++++-----
src/security/apparmor/usr.sbin.libvirtd.in | 3 +++
src/security/apparmor/usr.sbin.libvirtd.local | 1 +
src/security/apparmor/usr.sbin.virtqemud.in | 3 +++
src/security/apparmor/usr.sbin.virtqemud.local | 1 +
src/security/apparmor/usr.sbin.virtxend.in | 3 +++
src/security/apparmor/usr.sbin.virtxend.local | 1 +
7 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build
index 58b4024b85..02a6d098ad 100644
--- a/src/security/apparmor/meson.build
+++ b/src/security/apparmor/meson.build
@@ -34,8 +34,10 @@ install_data(
install_dir: apparmor_dir / 'libvirt',
)
-install_data(
- 'usr.lib.libvirt.virt-aa-helper.local',
- install_dir: apparmor_dir / 'local',
- rename: 'usr.lib.libvirt.virt-aa-helper',
-)
+foreach name : apparmor_gen_profiles
+ install_data(
+ '@0@.local'.format(name),
+ install_dir: apparmor_dir / 'local',
+ rename: name,
+ )
+endforeach
diff --git a/src/security/apparmor/usr.sbin.libvirtd.in b/src/security/apparmor/usr.sbin.libvirtd.in
index edb8dd8e26..41bdef53ec 100644
--- a/src/security/apparmor/usr.sbin.libvirtd.in
+++ b/src/security/apparmor/usr.sbin.libvirtd.in
@@ -139,4 +139,7 @@ profile libvirtd @sbindir@/libvirtd flags=(attach_disconnected) {
/usr/{lib,lib64,lib/qemu,libexec}/qemu-bridge-helper rmix,
}
+
+ # Site-specific additions and overrides. See local/README for details.
+ include if exists <local/usr.sbin.libvirtd>
}
diff --git a/src/security/apparmor/usr.sbin.libvirtd.local b/src/security/apparmor/usr.sbin.libvirtd.local
new file mode 100644
index 0000000000..3716400022
--- /dev/null
+++ b/src/security/apparmor/usr.sbin.libvirtd.local
@@ -0,0 +1 @@
+# Site-specific additions and overrides for 'usr.sbin.libvirtd'
diff --git a/src/security/apparmor/usr.sbin.virtqemud.in b/src/security/apparmor/usr.sbin.virtqemud.in
index f269c60809..3ebdbf2a8f 100644
--- a/src/security/apparmor/usr.sbin.virtqemud.in
+++ b/src/security/apparmor/usr.sbin.virtqemud.in
@@ -132,4 +132,7 @@ profile virtqemud @sbindir@/virtqemud flags=(attach_disconnected) {
/usr/{lib,lib64,lib/qemu,libexec}/qemu-bridge-helper rmix,
}
+
+ # Site-specific additions and overrides. See local/README for details.
+ include if exists <local/usr.sbin.virtqemud>
}
diff --git a/src/security/apparmor/usr.sbin.virtqemud.local b/src/security/apparmor/usr.sbin.virtqemud.local
new file mode 100644
index 0000000000..2ac68bb069
--- /dev/null
+++ b/src/security/apparmor/usr.sbin.virtqemud.local
@@ -0,0 +1 @@
+# Site-specific additions and overrides for 'usr.sbin.virtqemud'
diff --git a/src/security/apparmor/usr.sbin.virtxend.in b/src/security/apparmor/usr.sbin.virtxend.in
index 72e0d801e5..719766a0c1 100644
--- a/src/security/apparmor/usr.sbin.virtxend.in
+++ b/src/security/apparmor/usr.sbin.virtxend.in
@@ -52,4 +52,7 @@ profile virtxend @sbindir@/virtxend flags=(attach_disconnected) {
@libexecdir@/libvirt_iohelper ix,
/etc/libvirt/hooks/** rmix,
/etc/xen/scripts/** rmix,
+
+ # Site-specific additions and overrides. See local/README for details.
+ include if exists <local/usr.sbin.virtxend>
}
diff --git a/src/security/apparmor/usr.sbin.virtxend.local b/src/security/apparmor/usr.sbin.virtxend.local
new file mode 100644
index 0000000000..2ade86d4df
--- /dev/null
+++ b/src/security/apparmor/usr.sbin.virtxend.local
@@ -0,0 +1 @@
+# Site-specific additions and overrides for 'usr.sbin.virtxend'
--
2.40.1
1 year, 6 months