[libvirt PATCH] tools: virsh: metadata: do not report error on missing metadata
by Ján Tomko
Similarly to `desc` and `net-desc`, return an empty string if
there is no metadata to be returned.
https://issues.redhat.com/browse/RHEL-27172
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
tools/virsh-domain.c | 10 ++++++++--
tools/virsh-network.c | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index f3da2f903f..e104aa909a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8480,8 +8480,14 @@ cmdMetadata(vshControl *ctl, const vshCmd *cmd)
g_autofree char *data = NULL;
/* get */
if (!(data = virDomainGetMetadata(dom, VIR_DOMAIN_METADATA_ELEMENT,
- uri, flags)))
- return false;
+ uri, flags))) {
+ if (virGetLastErrorCode() == VIR_ERR_NO_DOMAIN_METADATA) {
+ virResetLastError();
+ data = g_strdup("");
+ } else {
+ return false;
+ }
+ }
vshPrint(ctl, "%s\n", data);
}
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index 6fcc7fd8ee..bcdb76ae36 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -604,8 +604,14 @@ cmdNetworkMetadata(vshControl *ctl, const vshCmd *cmd)
/* get */
if (!(data = virNetworkGetMetadata(net, VIR_NETWORK_METADATA_ELEMENT,
- uri, flags)))
- return false;
+ uri, flags))) {
+ if (virGetLastErrorCode() == VIR_ERR_NO_NETWORK_METADATA) {
+ virResetLastError();
+ data = g_strdup("");
+ } else {
+ return false;
+ }
+ }
vshPrint(ctl, "%s\n", data);
}
--
2.48.1
1 week, 4 days
[PATCH rfcv4 00/13] LIBVIRT: X86: TDX support
by Zhenzhong Duan
Hi,
This series brings libvirt the x86 TDX support.
* What's TDX?
TDX stands for Trust Domain Extensions which isolates VMs from
the virtual-machine manager (VMM)/hypervisor and any other software on
the platform.
To support TDX, multiple software components, not only KVM but also QEMU,
guest Linux and virtual bios, need to be updated. For more details, please
check link[1].
This patchset is another software component to extend libvirt to support TDX,
with which one can start a TDX guest from high level rather than running qemu
directly.
* Misc
As QEMU use a software emulated way to reset guest which isn't supported by TDX
guest for security reason. We simulate reboot for TDX guest by kill and create a
new one in FakeReboot framework.
Complete code can be found at [2], matching qemu code can be found at [3].
There is a 'debug' property for tdx-guest object which isn't in matching qemu[3]
yet. I keep them intentionally as they will be implemented in qemu as extention
series of [3].
* Test
start/stop/reboot with virsh
stop/reboot trigger in guest
stop with on_poweroff=destroy/restart
reboot with on_reboot=destroy/restart
* Patch organization
- patch 1-4: Support query of TDX capabilities.
- patch 5-8: Add TDX type to launchsecurity framework.
- patch 9-11: Add reboot support to TDX guest
- patch 12-13: Add test and docs
TODO:
- update QEMU capabilities data in tests, depending on qemu TDX merged beforehand
- add reconnect logic in virsh command
[1] https://lore.kernel.org/kvm/cover.1708933498.git.isaku.yamahata@intel.com
[2] https://github.com/intel/libvirt-tdx/commits/tdx_for_upstream_rfcv4
[3] https://github.com/intel/qemu-tdx/tree/tdx-qemu-upstream-v5
Thanks
Zhenzhong
Changelog:
rfcv4:
- add a check to tools/virt-host-validate-qemu.c (Daniel)
- remove check of q35 (Daniel)
- model 'SocktetAddress' QAPI in xml schema (Daniel)
- s/Quote-Generation-Service/quoteGenerationService/ (Daniel)
- define bits in tdx->policy and add validating logic (Daniel)
- presume QEMU choose split kernel irqchip for TDX guest by default (Daniel)
- utilize existing FakeReboot framework to do reboot for TDX guest (Daniel)
- drop patch11 'conf: Add support to keep same domid for hard reboot' (Daniel)
- add test in tests/ to validate parsing and formatting logic (Daniel)
- add doc in docs/formatdomain.rst (Daniel)
- add R-B
rfcv3:
- Change to generate qemu cmdline with -bios
- drop firmware auto match as -bios is used
- add a hard reboot method to reboot TDX guest
rfcv3: https://www.mail-archive.com/devel@lists.libvirt.org/msg00385.html
rfcv2:
- give up using qmp cmd and check TDX directly on host for TDX capabilities.
- use launchsecurity framework to support TDX
- use <os>.<loader> for general loader
- add auto firmware match feature for TDX
A example TDVF fimware description file 70-edk2-x86_64-tdx.json:
{
"description": "UEFI firmware for x86_64, supporting Intel TDX",
"interface-types": [
"uefi"
],
"mapping": {
"device": "generic",
"filename": "/usr/share/OVMF/OVMF_CODE-tdx.fd"
},
"targets": [
{
"architecture": "x86_64",
"machines": [
"pc-q35-*"
]
}
],
"features": [
"intel-tdx",
"verbose-dynamic"
],
"tags": [
]
}
rfcv2: https://www.mail-archive.com/libvir-list@redhat.com/msg219378.html
Zhenzhong Duan (13):
tools: Secure guest check for Intel in virt-host-validate
qemu: Check if INTEL Trust Domain Extention support is enabled
qemu: Add TDX capability
conf: expose TDX feature in domain capabilities
conf: add tdx as launch security type
qemu: Add command line and validation for TDX type
qemu: force special parameters enabled for TDX guest
Add Intel TDX Quote Generation Service(QGS) support
qemu: add FakeReboot support for TDX guest
qemu: Support reboot command in guest
qemu: Avoid duplicate FakeReboot for secure guest
Add test cases for Intel TDX
docs: domain: Add documentation for Intel TDX guest
docs/formatdomain.rst | 68 ++++
docs/formatdomaincaps.rst | 1 +
src/conf/domain_capabilities.c | 1 +
src/conf/domain_capabilities.h | 1 +
src/conf/domain_conf.c | 312 ++++++++++++++++++
src/conf/domain_conf.h | 75 +++++
src/conf/schemas/domaincaps.rng | 9 +
src/conf/schemas/domaincommon.rng | 135 ++++++++
src/conf/virconftypes.h | 2 +
src/qemu/qemu_capabilities.c | 36 +-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 139 ++++++++
src/qemu/qemu_firmware.c | 1 +
src/qemu/qemu_monitor.c | 28 +-
src/qemu/qemu_monitor.h | 2 +-
src/qemu/qemu_monitor_json.c | 6 +-
src/qemu/qemu_namespace.c | 1 +
src/qemu/qemu_process.c | 75 +++++
src/qemu/qemu_validate.c | 44 +++
...unch-security-tdx-qgs-fd.x86_64-latest.xml | 77 +++++
.../launch-security-tdx-qgs-fd.xml | 30 ++
...ch-security-tdx-qgs-inet.x86_64-latest.xml | 77 +++++
.../launch-security-tdx-qgs-inet.xml | 30 ++
...ch-security-tdx-qgs-unix.x86_64-latest.xml | 77 +++++
.../launch-security-tdx-qgs-unix.xml | 30 ++
...h-security-tdx-qgs-vsock.x86_64-latest.xml | 77 +++++
.../launch-security-tdx-qgs-vsock.xml | 30 ++
tests/qemuxmlconftest.c | 24 ++
tools/virt-host-validate-common.c | 22 +-
tools/virt-host-validate-common.h | 1 +
30 files changed, 1407 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.xml
--
2.34.1
1 week, 4 days
[PATCH v8 00/18] *** qemu: block: Support block disk along with throttle filters ***
by Harikumar Rajkumar
*** Support block disk along with throttle filters ***
Chun Feng Wu (17):
schema: Add new domain elements to support multiple throttle groups
schema: Add new domain elements to support multiple throttle filters
config: Introduce ThrottleGroup and corresponding XML parsing
config: Introduce ThrottleFilter and corresponding XML parsing
qemu: monitor: Add support for ThrottleGroup operations
tests: Test qemuMonitorJSONGetThrottleGroup and
qemuMonitorJSONUpdateThrottleGroup
remote: New APIs for ThrottleGroup lifecycle management
qemu: Refactor qemuDomainSetBlockIoTune to extract common methods
qemu: Implement qemu driver for throttle API
qemu: helper: throttle filter nodename and preparation processing
qemu: block: Support block disk along with throttle filters
config: validate: Verify iotune, throttle group and filter
qemuxmlconftest: Add 'throttlefilter' tests
test_driver: Test throttle group lifecycle APIs
virsh: Refactor iotune options for re-use
virsh: Add support for throttle group operations
virsh: Add option "throttle-groups" to "attach_disk"
Harikumar Rajkumar (1):
qemustatusxml2xmldata: Add 'throttlefilter' tests
This patch version addresses the feedback provided on patch v5, which includes the following modifications:
* Reimplementation of the "get throttle group" to query from the XML.
* Allowing the SET API to reset the throttle group config fields to its default in QEMU.
* Updating the version to 11.1.0.
* Implementing various coding style changes as suggested.
* Removal of unnecessary comments.
docs/formatdomain.rst | 47 ++
docs/manpages/virsh.rst | 137 +++-
include/libvirt/libvirt-domain.h | 14 +
src/conf/domain_conf.c | 407 ++++++++++
src/conf/domain_conf.h | 47 ++
src/conf/domain_validate.c | 118 ++-
src/conf/schemas/domaincommon.rng | 293 ++++---
src/conf/virconftypes.h | 4 +
src/driver-hypervisor.h | 14 +
src/libvirt-domain.c | 122 +++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_block.c | 136 ++++
src/qemu/qemu_block.h | 49 ++
src/qemu/qemu_command.c | 180 +++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 77 +-
src/qemu/qemu_driver.c | 485 +++++++++---
src/qemu/qemu_hotplug.c | 29 +
src/qemu/qemu_monitor.c | 21 +
src/qemu/qemu_monitor.h | 9 +
src/qemu/qemu_monitor_json.c | 129 +++
src/qemu/qemu_monitor_json.h | 14 +
src/remote/remote_daemon_dispatch.c | 105 +++
src/remote/remote_driver.c | 3 +
src/remote/remote_protocol.x | 50 +-
src/remote_protocol-structs | 28 +
src/test/test_driver.c | 367 ++++++---
tests/qemumonitorjsontest.c | 86 ++
.../throttlefilter-in.xml | 392 ++++++++++
.../throttlefilter-out.xml | 393 ++++++++++
tests/qemuxmlactivetest.c | 1 +
.../throttlefilter-invalid.x86_64-latest.err | 1 +
.../throttlefilter-invalid.xml | 89 +++
.../throttlefilter.x86_64-latest.args | 55 ++
.../throttlefilter.x86_64-latest.xml | 105 +++
tests/qemuxmlconfdata/throttlefilter.xml | 95 +++
tests/qemuxmlconftest.c | 2 +
tools/virsh-completer-domain.c | 82 ++
tools/virsh-completer-domain.h | 16 +
tools/virsh-domain.c | 736 ++++++++++++++----
41 files changed, 4428 insertions(+), 530 deletions(-)
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-in.xml
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-out.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml
--
2.39.5 (Apple Git-154)
3 weeks, 6 days
[PATCH v2 00/21] Add qemu RDP server support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This patch series offers an out-of-process Remote Desktop Protocol (RDP)
server solution utilizing QEMU's -display dbus interface, offering improved
modularity and potential security benefits compared to built-in server.
This initiative was spearheaded by Mihnea Buzatu during the QEMU Summer of Code
2023. The project's goal was to develop an out-of-process RDP server using the
-display dbus interface, implemented in Rust. Given that the IronRDP crate
lacked some server support at the time, investments in IronRDP were required.
I finally released an initial v0.1 version of qemu-rdp on crates.io
(https://crates.io/crates/qemu-rdp). That should allow more people to review and
evaluate the state of this work.
On unix systems, with cargo/rust toolchain installed, it should be as easy as
running "cargo install qemu-rdp", apply this patch series for libvirt, set the
"rdp_tls_x509_cert_dir" location for your TLS certificates, and configure a VM
with both dbus & rdp graphics (run "virsh domdisplay DOMAIN" to get the display
connection details).
Thanks for the reviews & feedback!
v2: thanks to Daniel review
- drop extra error report from "qemu: report an error for unsupported graphics"
- replace g_return pre-conditions with ATTRIBUTE_NONNULL
- improve "qemu/dbus: keep a connection to the VM D-Bus" to also reconnect
- use domainLogContext for logging (for virtiofs as well)
- check for qemu-rdp availabilty for setting 'rdp' capability
- make dbus-addr qemu-rdp capability mandatory
- rebased
- add r-b tags
Marc-André Lureau (21):
build-sys: drop -Winline when optimization=g
build: fix -Werror=maybe-uninitialized
qemu-slirp: drop unneeded check for OOM
util: annotate non-null arguments for virGDBusCallMethod()
qemu: fall-through for unsupported graphics
qemu: add rdp state directory
qemu: add qemu RDP configuration
conf: parse optional RDP username & password
conf: generalize virDomainDefHasSpiceGraphics
qemu: use virDomainDefHasGraphics
qemu: add RDP ports range allocator
qemu: limit to one <graphics type='rdp'>
qemu/virtiofs: use domainLogContext
qemu/dbus: keep a connection to the VM D-Bus
qemu/dbus: log daemon stdout/err, use domainLogContext
qemu: validate RDP configuration
qemu: add qemu-rdp helper unit
qemu: pass virQEMUDriverConfig to capabilities
qemu: add 'rdp' capability if qemu-rdp is available
qemu: add RDP support
tests: add qemu <graphics type='rdp'/> test
docs/formatdomain.rst | 25 +-
meson.build | 7 +-
po/POTFILES | 1 +
src/conf/domain_conf.c | 28 +-
src/conf/domain_conf.h | 5 +-
src/conf/schemas/domaincommon.rng | 10 +
src/libvirt_private.syms | 2 +-
src/qemu/libvirtd_qemu.aug | 7 +
src/qemu/meson.build | 1 +
src/qemu/qemu.conf.in | 31 ++
src/qemu/qemu_capabilities.c | 24 +-
src/qemu/qemu_capabilities.h | 12 +-
src/qemu/qemu_command.c | 9 +-
src/qemu/qemu_conf.c | 56 ++-
src/qemu/qemu_conf.h | 13 +
src/qemu/qemu_dbus.c | 69 ++-
src/qemu/qemu_dbus.h | 3 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 4 +
src/qemu/qemu_driver.c | 20 +
src/qemu/qemu_extdevice.c | 46 +-
src/qemu/qemu_hotplug.c | 49 ++-
src/qemu/qemu_hotplug.h | 1 +
src/qemu/qemu_process.c | 170 ++++++-
src/qemu/qemu_rdp.c | 416 ++++++++++++++++++
src/qemu/qemu_rdp.h | 73 +++
src/qemu/qemu_slirp.c | 6 -
src/qemu/qemu_validate.c | 48 +-
src/qemu/qemu_virtiofs.c | 53 +--
src/qemu/test_libvirtd_qemu.aug.in | 5 +
src/util/virgdbus.h | 13 +-
.../domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 +
.../qemu_7.2.0-hvf.x86_64+hvf.xml | 1 +
.../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 +
.../qemu_7.2.0-tcg.x86_64+hvf.xml | 1 +
.../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 +
.../qemu_8.2.0-tcg-virt.loongarch64.xml | 1 +
.../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 +
.../qemu_8.2.0-virt.aarch64.xml | 1 +
.../qemu_8.2.0-virt.loongarch64.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_9.0.0.sparc.xml | 1 +
tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 +
.../qemu_9.1.0-tcg-virt.riscv64.xml | 1 +
.../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 +
.../qemu_9.1.0-virt.riscv64.xml | 1 +
tests/domaincapsdata/qemu_9.1.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 +
tests/domaincapstest.c | 7 +-
.../graphics-rdp.x86_64-latest.args | 35 ++
.../graphics-rdp.x86_64-latest.xml | 1 +
tests/qemuxmlconfdata/graphics-rdp.xml | 43 ++
tests/qemuxmlconftest.c | 2 +
tests/testutilsqemu.c | 10 +
tools/nss/libvirt_nss_leases.c | 2 +-
tools/nss/libvirt_nss_macs.c | 2 +-
85 files changed, 1218 insertions(+), 138 deletions(-)
create mode 100644 src/qemu/qemu_rdp.c
create mode 100644 src/qemu/qemu_rdp.h
create mode 100644 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.args
create mode 120000 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/graphics-rdp.xml
--
2.47.0
3 weeks, 6 days
[PATCH 0/5] qemu: Introduce nvme disk emulation support
by honglei.wang@smartx.com
From: hongleiwang <honglei.wang(a)smartx.com>
QEMU has supported nvme disk emulation for a long time,
see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html.
The following patches introduce nvme and nvme-ns disk bus type:
A disk with nvme as bus is represented as nvme disk that contains
only one nvme namespace. In XML, it can be used like this:
<devices>
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/data.img'/>
<target dev='nvmea' bus='nvme'/>
<serial>nvme-serial-value</serial>
</disk>
...
</devices>
A disk with nvme-ns as bus is represented as an nvme namespace
and needs to be attached to an nvme controller. In XML, it can be
used like this:
<devices>
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/data.img'/>
<target dev='nvmensa' bus='nvme-ns'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='nvme' index='0'>
<serial>nvme-controller-serial-value</serial>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
...
</devices>
ray (5):
qemu: Add support for NVMe disk bus type
qemu: Add support for NVMe namespace disk bus type
qemu_capabilities: Add support for NVMe disk capabilities
docs: Add NVMe and NVMe namespace disk bus types to documentation
tests: Add test case for NVMe device configuration
docs/formatdomain.rst | 5 ++-
src/conf/domain_conf.c | 42 +++++++++++++++++++
src/conf/domain_conf.h | 8 ++++
src/conf/domain_postparse.c | 4 ++
src/conf/domain_validate.c | 5 ++-
src/conf/schemas/domaincommon.rng | 12 +++++-
src/conf/virconftypes.h | 2 +
src/hyperv/hyperv_driver.c | 4 ++
src/qemu/qemu_alias.c | 2 +
src/qemu/qemu_capabilities.c | 10 +++++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 31 ++++++++++++++
src/qemu/qemu_domain_address.c | 30 +++++++++++--
src/qemu/qemu_domain_address.h | 4 ++
src/qemu/qemu_hotplug.c | 14 +++++++
src/qemu/qemu_postparse.c | 1 +
src/qemu/qemu_validate.c | 40 ++++++++++++++++++
src/test/test_driver.c | 4 ++
src/util/virutil.c | 2 +-
src/vbox/vbox_common.c | 3 ++
src/vmx/vmx.c | 2 +
tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_10.0.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 2 +
.../domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0.ppc.xml | 2 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 2 +
.../qemu_8.2.0-tcg-virt.loongarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml | 2 +
.../domaincapsdata/qemu_8.2.0-virt.loongarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 2 +
.../caps_7.0.0_aarch64+hvf.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 2 +
.../qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 2 +
tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 2 +
.../caps_8.2.0_loongarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 2 +
.../disk-nvme-device.x86_64-latest.args | 38 +++++++++++++++++
.../disk-nvme-device.x86_64-latest.xml | 49 ++++++++++++++++++++++
tests/qemuxmlconfdata/disk-nvme-device.xml | 46 ++++++++++++++++++++
tests/qemuxmlconftest.c | 1 +
133 files changed, 569 insertions(+), 8 deletions(-)
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.xml
--
2.11.0
1 month
[PATCH 00/26] integrate auto-shutdown of VMs with daemons
by Daniel P. Berrangé
This series starts the work needed to obsolete the libvirt-guests.sh
script which has grown a surprisingly large amount of functionality.
Currently the virt daemons will acquire inhibitors to delay OS shutdown
when VMs are running. The libvirt-guests.service unit can be used to
call libvirt-guests.sh to shutdown running VMs on system shutdown.
This split is a bad architecture because libvirt-guests.service will
only run once the system has decided to initiate the shutdown sequence.
When the user requests as shutdown while inhibitors are present, logind
will emit a "PrepareForShutdown" signal over dbus. Applications are
supposed to respond to this by preserving state & releasing their
inhibitors, which in turns allows shutdown to be initiated.
The remote daemon already has support for listening for the
"PrepareForShutdown" signal, but only does this for session instances,
not system instances.
This series essentially takes that logic and expands it to run in the
system instances too, thus conceptually making libvirt-guests.service
obsolete.
It is slightly more complicated than that though for many reasons...
Saving running VMs can take a very long time. The inhibitor delay
can be as low as 5 seconds, and when killing a service, systemd may
not wait very long for it to terminate. libvirt-guests.service deals
with this by setting TimeoutStopSecs=0 to make systemd wait forever.
This is undesirable to set in libvirtd.service though, as we would
like systemd to kill the daemon aggressively if it hangs. The series
thus uses the notification protocol to request systemd give it more
time to shutdown, as long as we're in the phase of saving running
VMs. A bug in this code will still result in systemd waiting forever,
which is no different from libvirt-guests.service, but a bug in any
other part of the libvirt daemon shutdown code will result in systemd
killing us.
The existing logic for saving VMs in the session daemons had many
feature gaps compared to libvirt-guests.sh. Thus there is code to
add support
* Requesting graceful OS shutdown if managed save failed
* Force poweroff of VMs if no other action worked
* Optionally enabling/disabling use of managed save,
graceful shutdown and force poweroff, which is more flexible
than ON_SHUTDOWN=nnn, as we can try the whole sequence of
options
* Ability to bypass cache in managed save
* Support for one-time autostart of VMs as an official API
To aid in testing this logic, virt-admin gains a new command
'virt-admin daemon-shutdown --preserve'
All this new functionality is wired up into the QEMU driver, and is
made easily accessible to other hypervisor drivers, so would easily
be extendable to Xen, CH, LXC drivers, but this is not done in this
series. IOW, libvirt-guests.service is not yet fully obsolete.
The new functionality is also not enabled by default for the system
daemon, it requires explicit admin changes to /etc/libvirt/qemu.conf
to enable it. This is because it would clash with execution of the
libvirt-guests.service if both were enabled.
It is highly desirable that we enable this by default though, so we
need to figure out a upgrade story wrt libvirt-guests.service.
The only libvirt-guests.sh features not implemented are:
* PARALLEL_SHUTDOWN=nn.
When doing a graceful shutdown we initiate it on every single VM
at once, and then monitor progress of all of them in parallel.
* SYNC_TIME=nn
When make not attempt to sync guest time when restoring from
managed save. This ought to be fixed
Daniel P. Berrangé (26):
util: add APIs for more systemd notifications
remote: notify systemd when reloading config
hypervisor: introduce helper for autostart
src: convert drivers over to use new autostart helper
hypervisor: add support for delay interval during autostart
qemu: add 'auto_start_delay' configuration parameter
hypervisor: move support for auto-shutdown out of QEMU driver
remote: always invoke virStateStop for all daemons
hypervisor: expand available shutdown actions
hypervisor: custom shutdown actions for transient vs persistent VMs
qemu: support automatic VM managed save in system daemon
qemu: improve shutdown defaults for session daemon
qemu: configurable delay for shutdown before poweroff
hypervisor: support bypassing cache for managed save
qemu: add config parameter to control auto-save bypass cache
src: add new APIs for marking a domain to autostart once
conf: implement support for autostart once feature
hypervisor: wire up support for auto restore of running domains
qemu: wire up support for once only autostart
qemu: add config to control if auto-shutdown VMs are restored
rpc: move state stop into virNetDaemon class
rpc: don't unconditionally quit after preserving state
rpc: fix shutdown sequence when preserving state
admin: add 'daemon-shutdown' command
rpc: don't let systemd shutdown daemon while saving VMs
hypervisor: send systemd status messages while saving
include/libvirt/libvirt-admin.h | 13 ++
include/libvirt/libvirt-domain.h | 4 +
src/admin/admin_protocol.x | 11 +-
src/admin/admin_server_dispatch.c | 13 ++
src/admin/libvirt-admin.c | 33 ++++
src/admin/libvirt_admin_public.syms | 5 +
src/bhyve/bhyve_driver.c | 53 ++----
src/conf/domain_conf.c | 6 +-
src/conf/domain_conf.h | 1 +
src/conf/virdomainobjlist.c | 7 +-
src/driver-hypervisor.h | 10 ++
src/hypervisor/domain_driver.c | 250 ++++++++++++++++++++++++++++
src/hypervisor/domain_driver.h | 42 +++++
src/libvirt-domain.c | 87 ++++++++++
src/libvirt_private.syms | 10 +-
src/libvirt_public.syms | 6 +
src/libvirt_remote.syms | 2 +-
src/libxl/libxl_driver.c | 36 ++--
src/lxc/lxc_driver.c | 13 +-
src/lxc/lxc_process.c | 18 +-
src/lxc/lxc_process.h | 2 +
src/qemu/libvirtd_qemu.aug | 7 +
src/qemu/qemu.conf.in | 59 +++++++
src/qemu/qemu_conf.c | 63 +++++++
src/qemu/qemu_conf.h | 7 +
src/qemu/qemu_driver.c | 203 +++++++++++++---------
src/qemu/test_libvirtd_qemu.aug.in | 7 +
src/remote/libvirtd.service.in | 2 +-
src/remote/remote_daemon.c | 78 +++------
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 30 +++-
src/remote_protocol-structs | 12 ++
src/rpc/gendispatch.pl | 4 +-
src/rpc/virnetdaemon.c | 212 +++++++++++++++++++----
src/rpc/virnetdaemon.h | 20 ++-
src/util/virsystemd.c | 41 ++++-
src/util/virsystemd.h | 6 +-
src/virtd.service.in | 2 +-
tools/virsh-domain-monitor.c | 5 +
tools/virsh-domain.c | 39 ++++-
tools/virt-admin.c | 41 +++++
41 files changed, 1181 insertions(+), 281 deletions(-)
--
2.47.1
1 month
[PATCH 0/3] Full boot order support on s390x
by Boris Fiuczynski
This series adds on s390x full boot order support which has been
introduced recently in QEMU with the PR
https://lore.kernel.org/qemu-devel/20241023131710.906748-1-thuth@redhat.com/
The replies and xml files are removed from the patch in this series and
are available in https://gitlab.com/fiuczy/libvirt/-/commits/fullbootorder
Boris Fiuczynski (3):
qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM
tests: add capabilities for QEMU 9.2.0 on s390x
qemu: command: add multi boot device support on s390x
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 40 +-
src/qemu/qemu_command.h | 6 +-
src/qemu/qemu_hotplug.c | 6 +-
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 +
.../caps_5.2.0_s390x.replies | 321 +-
.../caps_6.0.0_s390x.replies | 321 +-
.../caps_8.1.0_s390x.replies | 321 +-
.../caps_8.2.0_s390x.replies | 321 +-
.../caps_9.1.0_s390x.replies | 321 +-
.../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++
.../machine-loadparm-hostdev.s390x-9.1.0.args | 33 +
.../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 +
...machine-loadparm-hostdev.s390x-latest.args | 4 +-
...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 +
...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 +
...multiple-disks-nets-s390.s390x-latest.args | 8 +-
...machine-loadparm-net-s390.s390x-9.1.0.args | 34 +
.../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 +
...achine-loadparm-net-s390.s390x-latest.args | 4 +-
.../machine-loadparm-s390.s390x-9.1.0.args | 34 +
.../machine-loadparm-s390.s390x-9.1.0.xml | 33 +
.../machine-loadparm-s390.s390x-latest.args | 4 +-
tests/qemuxmlconftest.c | 4 +
26 files changed, 42664 insertions(+), 120 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml
--
2.45.0
1 month
[PATCH v1 0/3] Introduce qemuDomainSetVcpuTuneParameters API
by yong.huang@smartx.com
From: Hyman Huang <yong.huang(a)smartx.com>
This patchset is the prerequisite for the vCPU dirty-limit feature:
https://patchew.org/Libvirt/cover.1703135535.git.yong.huang@smartx.com/
As suggested by Daniel:
We've generally tried to avoid adding single purpose APIs for
tunable parameters, instead using APIs with virTypedParameter
arrays to allow bulk updates.
I note that we don't appear to have any mechanism currently
to set the VCPU scheduler tunables either
Perhaps we should have a more general
virDomainSetVCPUTuneParameters(virDomainPtr domain,
int vcpu,
virTypedParameterPtr params,
unsigned int params,
unsigned int flags);
Refer the following link to see more details:
https://patchew.org/Libvirt/169397083100.4628.15196043252714532301-0@git....
We present the qemuDomainSetVcpuTuneParameters API separately
because the patchset is somewhat self-contained.
Please review,
Yong
Hyman Huang (3):
libvirt: Add virDomainSetVcpuTuneParameters API
qemu_driver: Implement qemuDomainSetVcpuTuneParameters
virsh: Use the new API to implement cmdSetvcpu
include/libvirt/libvirt-domain.h | 25 ++++++++++++++
src/driver-hypervisor.h | 8 +++++
src/libvirt-domain.c | 56 ++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_driver.c | 29 +++++++++++++++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 20 +++++++++++-
tools/virsh-domain.c | 10 +++++-
8 files changed, 152 insertions(+), 2 deletions(-)
--
2.27.0
1 month
[PATCH v3 0/2] Enable SEV SNP support in ch driver
by Praveen K Paladugu
This version introduces virStringFormatHex method and uses this method while sending host_data to cloud-hypervisor.
Praveen K Paladugu (2):
util: Introduce virStringFormatHex
ch: Enable SEV SNP support
src/ch/ch_monitor.c | 65 ++++++++++++++++++++++++++++++++--------
src/libvirt_private.syms | 1 +
src/util/virstring.c | 19 ++++++++++++
src/util/virstring.h | 1 +
4 files changed, 74 insertions(+), 12 deletions(-)
--
2.47.0
1 month
[PATCH 0/4] hw/s390x: Alias @dump-skeys -> @dump-s390-skey and deprecate
by Philippe Mathieu-Daudé
We are trying to unify all qemu-system-FOO to a single binary.
In order to do that we need to remove QAPI target specific code.
@dump-skeys is only available on qemu-system-s390x. This series
rename it as @dump-s390-skey, making it available on other
binaries. We take care of backward compatibility via deprecation.
Philippe Mathieu-Daudé (4):
hw/s390x: Introduce the @dump-s390-skeys QMP command
hw/s390x: Introduce the 'dump_s390_skeys' HMP command
hw/s390x: Deprecate the HMP 'dump_skeys' command
hw/s390x: Deprecate the QMP @dump-skeys command
docs/about/deprecated.rst | 5 +++++
qapi/misc-target.json | 5 +++++
qapi/misc.json | 18 ++++++++++++++++++
include/monitor/hmp.h | 1 +
hw/s390x/s390-skeys-stub.c | 24 ++++++++++++++++++++++++
hw/s390x/s390-skeys.c | 19 +++++++++++++++++--
hmp-commands.hx | 17 +++++++++++++++--
hw/s390x/meson.build | 5 +++++
8 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 hw/s390x/s390-skeys-stub.c
--
2.41.0
1 month