[PATCH 0/4] qemu: Init ext devices paths on reconnect
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (4):
qemu_process: Document qemuProcessPrepare{Domain,Host}() order
qemu_extdevice: Init paths in qemuExtDevicesPrepareDomain()
qemu_extdevice: Expose qemuExtDevicesInitPaths()
qemu: Init ext devices paths on reconnect
src/qemu/qemu_extdevice.c | 8 ++++----
src/qemu/qemu_extdevice.h | 5 +++++
src/qemu/qemu_process.c | 7 +++++++
3 files changed, 16 insertions(+), 4 deletions(-)
--
2.37.4
1 year, 11 months
[PATCH 0/7] Sanitize logic to get live/config device definitions for unplug/update
by Peter Krempa
Convert code *DomainUpdateDeviceFlags/*DomainDetachDeviceLiveAndConfig
to avoid use of virDomainDeviceDefCopy. We have the original XML string
from the user so it doesn't make sense to parse it and then copy it
(whcih involves formatting and parsing back), when we can simply parse
it twice, saving the extra formatting step.
Peter Krempa (7):
qemu: driver: Fix formatting of function headers around
qemuDomainAttachDevice
qemuDomainUpdateDeviceFlags: Parse XML twice rather than use
virDomainDeviceDefCopy
qemuDomainDetachDeviceLiveAndConfig: Parse XML twice rather than use
virDomainDeviceDefCopy
qemuDomainDetachDeviceLiveAndConfig: Refactor cleanup
lxcDomainAttachDeviceFlags: Parse XML twice rather than use
virDomainDeviceDefCopy
lxcDomainDetachDeviceFlags: Parse XML twice rather than use
virDomainDeviceDefCopy
conf: domain: Remove virDomainDeviceDefCopy
src/conf/domain_conf.c | 121 ---------------------------------------
src/conf/domain_conf.h | 4 --
src/libvirt_private.syms | 1 -
src/lxc/lxc_driver.c | 75 ++++++++++--------------
src/qemu/qemu_driver.c | 97 +++++++++++++------------------
5 files changed, 70 insertions(+), 228 deletions(-)
--
2.37.3
1 year, 11 months
[PATCH v3] qemu: Don't report spurious errors from vCPU tid validation on hotunplug timeout
by Peter Krempa
From: Shaleen Bathla <shaleen.bathla(a)oracle.com>
Use of qemuDomainValidateVcpuInfo in the helpers for hotplug and unplug
of vCPUs can lead to spurious errors reported such as:
internal error: qemu didn't report thread id for vcpu 'XX'"
The reason for this is that qemuDomainValidateVcpuInfo validates the
state of all vCPUs against the expected state of vCPUs. If an unplug
operation completed before libvirt was unable to process it yet the
expected state could not reflect the current state.
To avoid spurious errors the qemuDomainHotplugAddVcpu and
qemuDomainRemoveVcpu functions are modified to do localized validation
only for the vCPUs they actually modify.
We also now ensure that the cgroups are modified before bailing out on
error for any vCPUs which passed validation.
Additionally in order for qemuDomainRemoveVcpuAlias to be able to find
the unplugged vCPU we must ensure that qemuDomainRefreshVcpuInfo does
not clear out the alias in case when the vCPU is no longer reported by
qemu.
Co-authored-by: Partha Satapathy <partha.satapathy(a)oracle.com>
Signed-off-by: Shaleen Bathla <shaleen.bathla(a)oracle.com>
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
v3 addresses my review feedback of the original patch, as well as
rewrites the commit message for more clarity.
src/qemu/qemu_domain.c | 6 +++--
src/qemu/qemu_hotplug.c | 53 ++++++++++++++++++++++++-----------------
2 files changed, 35 insertions(+), 24 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ef1a9c8c74..64ebec626c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9795,8 +9795,10 @@ qemuDomainRefreshVcpuInfo(virDomainObj *vm,
vcpupriv->vcpus = info[i].vcpus;
VIR_FREE(vcpupriv->type);
vcpupriv->type = g_steal_pointer(&info[i].type);
- VIR_FREE(vcpupriv->alias);
- vcpupriv->alias = g_steal_pointer(&info[i].alias);
+ if (info[i].alias) {
+ VIR_FREE(vcpupriv->alias);
+ vcpupriv->alias = g_steal_pointer(&info[i].alias);
+ }
virJSONValueFree(vcpupriv->props);
vcpupriv->props = g_steal_pointer(&info[i].props);
vcpupriv->enable_id = info[i].id;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index da92ced2f4..6e300f547c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -6088,38 +6088,37 @@ qemuDomainRemoveVcpu(virDomainObj *vm,
qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo);
int oldvcpus = virDomainDefGetVcpus(vm->def);
unsigned int nvcpus = vcpupriv->vcpus;
- virErrorPtr save_error = NULL;
size_t i;
+ ssize_t offlineVcpuWithTid = -1;
if (qemuDomainRefreshVcpuInfo(vm, VIR_ASYNC_JOB_NONE, false) < 0)
return -1;
- /* validation requires us to set the expected state prior to calling it */
for (i = vcpu; i < vcpu + nvcpus; i++) {
vcpuinfo = virDomainDefGetVcpu(vm->def, i);
- vcpuinfo->online = false;
+ vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo);
+
+ if (vcpupriv->tid == 0) {
+ vcpuinfo->online = false;
+ /* Clear the alias as VCPU is now unplugged */
+ VIR_FREE(vcpupriv->alias);
+ ignore_value(virCgroupDelThread(priv->cgroup, VIR_CGROUP_THREAD_VCPU, i));
+ } else {
+ if (offlineVcpuWithTid == -1)
+ offlineVcpuWithTid = i;
+ }
}
- if (qemuDomainValidateVcpuInfo(vm) < 0) {
- /* rollback vcpu count if the setting has failed */
+ if (offlineVcpuWithTid != -1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("qemu reported thread id for inactive vcpu '%zu'"),
+ offlineVcpuWithTid);
virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", false);
-
- for (i = vcpu; i < vcpu + nvcpus; i++) {
- vcpuinfo = virDomainDefGetVcpu(vm->def, i);
- vcpuinfo->online = true;
- }
return -1;
}
virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", true);
- virErrorPreserveLast(&save_error);
-
- for (i = vcpu; i < vcpu + nvcpus; i++)
- ignore_value(virCgroupDelThread(priv->cgroup, VIR_CGROUP_THREAD_VCPU, i));
-
- virErrorRestore(&save_error);
-
return 0;
}
@@ -6141,6 +6140,9 @@ qemuDomainRemoveVcpuAlias(virDomainObj *vm,
return;
}
}
+
+ VIR_DEBUG("vcpu '%s' not found in vcpulist of domain '%s'",
+ alias, vm->def->name);
}
@@ -6209,6 +6211,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver,
int rc;
int oldvcpus = virDomainDefGetVcpus(vm->def);
size_t i;
+ bool vcpuTidMissing = false;
if (!qemuDomainSupportsNewVcpuHotplug(vm)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
@@ -6238,20 +6241,26 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver,
if (qemuDomainRefreshVcpuInfo(vm, VIR_ASYNC_JOB_NONE, false) < 0)
return -1;
- /* validation requires us to set the expected state prior to calling it */
for (i = vcpu; i < vcpu + nvcpus; i++) {
vcpuinfo = virDomainDefGetVcpu(vm->def, i);
vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo);
vcpuinfo->online = true;
- if (vcpupriv->tid > 0 &&
- qemuProcessSetupVcpu(vm, i, true) < 0)
- return -1;
+ if (vcpupriv->tid > 0) {
+ if (qemuProcessSetupVcpu(vm, i, true) < 0) {
+ return -1;
+ }
+ } else {
+ vcpuTidMissing = true;
+ }
}
- if (qemuDomainValidateVcpuInfo(vm) < 0)
+ if (vcpuTidMissing && qemuDomainHasVcpuPids(vm)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("qemu didn't report thread id for vcpu '%zu'"), i);
return -1;
+ }
qemuDomainVcpuPersistOrder(vm->def);
--
2.37.3
1 year, 11 months
[PATCH 0/3] qemu_tpm: Set log file label on migration
by Michal Privoznik
See 3/3 for explanation.
Michal Prívozník (3):
security: Extend TPM label APIs
qemu_tpm: Extend start/stop APIs
qemu_tpm: Set log file label on migration
src/qemu/qemu_security.c | 13 +++++++----
src/qemu/qemu_security.h | 4 +++-
src/qemu/qemu_tpm.c | 22 +++++++++---------
src/security/security_driver.h | 6 +++--
src/security/security_manager.c | 10 +++++----
src/security/security_manager.h | 6 +++--
src/security/security_selinux.c | 40 +++++++++++++++++++++------------
src/security/security_stack.c | 12 +++++-----
8 files changed, 71 insertions(+), 42 deletions(-)
--
2.37.4
1 year, 11 months
[PATCH 00/13] virsh: Don't reimplement virXPathNodeSet
by Peter Krempa
This series converts open-coded virXPathNodeSet to the proper helper use
and also adds --print-xml option to commands using xmlXpathEval which
didn't have it.
Peter Krempa (13):
virsh: Add --print-xml option for 'detach-interface'
virshDomainDetachInterface: Use virXPathNodeSet instead of
xmlXpathEval
virsh: Add --print-xml option for 'domif-setlink'
virsh: cmdDomIfSetLink: Use virXPathNodeSet instead of xmlXpathEval
virsh: Refactor cleanup in 'cmdVolClone'
virsh: Add --print-xml flag for 'vol-clone' command
virsh: virshMakeCloneXML: Use virXPathNode instead of xmlXPathEval
virsh: cmdDetachDisk: Refactor cleanup
virsh: cmdChangeMedia: Refactor cleanup
virshFindDisk: Use virXPathNodeSet instead of xmlXPathEval
virshFindDisk: Sanitize removable media check
util: xml: Introduce virXMLNodeGetSubelement
virshFindDisk: Sanitize use of 'tmp' variable
docs/manpages/virsh.rst | 15 +-
src/libvirt_private.syms | 1 +
src/util/virxml.c | 23 +++
src/util/virxml.h | 5 +
tools/virsh-domain.c | 298 ++++++++++++++++++---------------------
tools/virsh-volume.c | 61 ++++----
6 files changed, 207 insertions(+), 196 deletions(-)
--
2.38.1
1 year, 11 months
[PATCH] spec: Remove use of %{name} macro
by Jim Fehlig
The spec file uses both "libvirt" and "%{name}", but in reality the
expanded value of %{name} will never change. Drop the macro in favor
of the explicit and more readable "libvirt".
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
libvirt.spec.in | 66 ++++++++++++++++++++++++-------------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index fa94cda3c5..d07a43c721 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -439,13 +439,13 @@ Summary: Server side daemon and supporting files for libvirt library
# for subpackages are listed later in those subpackages)
# The client side, i.e. shared libs are in a subpackage
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
# The libvirt-guests.sh script requires virsh from libvirt-client subpackage,
# but not every deployment wants to use libvirt-guests service. Using
# Recommends here will install libvirt-client by default (if available), but
# RPM won't complain if the package is unavailable, masked, or removed later.
-Recommends: %{name}-client = %{version}-%{release}
+Recommends: libvirt-client = %{version}-%{release}
# netcat is needed on the server side so that clients that have
# libvirt < 6.9.0 can connect, but newer versions will prefer
@@ -896,7 +896,7 @@ capabilities of VirtualBox
%package client
Summary: Client side utilities of the libvirt library
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
# Needed by virt-pki-validate script.
Requires: gnutls-utils
@@ -909,7 +909,7 @@ capabilities of recent versions of Linux (and other OSes).
%package client-qemu
Summary: Additional client side utilities for QEMU
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
Requires: python3-libvirt >= 3.7.0
%description client-qemu
@@ -931,7 +931,7 @@ Shared libraries for accessing the libvirt daemon.
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
Requires: wireshark
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
%description wireshark
Wireshark dissector plugin for better analysis of libvirt RPC traffic.
@@ -940,7 +940,7 @@ Wireshark dissector plugin for better analysis of libvirt RPC traffic.
%if %{with_lxc}
%package login-shell
Summary: Login shell for connecting users to an LXC container
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
%description login-shell
Provides the set-uid virt-login-shell binary that is used to
@@ -950,7 +950,7 @@ namespaces.
%package devel
Summary: Libraries, includes, etc. to compile with the libvirt library
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
Requires: pkgconfig
%description devel
@@ -962,8 +962,8 @@ Summary: Sanlock lock manager plugin for QEMU driver
Requires: sanlock >= 2.4
#for virt-sanlock-cleanup require augeas
Requires: augeas
-Requires: %{name}-daemon = %{version}-%{release}
-Requires: %{name}-libs = %{version}-%{release}
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: libvirt-libs = %{version}-%{release}
%description lock-sanlock
Includes the Sanlock lock manager plugin for the QEMU
@@ -1157,7 +1157,7 @@ exit 1
# place macros above and build commands below this comment
-export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
+export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
%meson \
-Drunstatedir=%{_rundir} \
@@ -1312,7 +1312,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
%install
rm -fr %{buildroot}
-export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
+export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
%meson_install
@@ -1882,7 +1882,7 @@ exit 0
%{_unitdir}/virtinterfaced-admin.socket
%attr(0755, root, root) %{_sbindir}/virtinterfaced
%ghost %dir %{_rundir}/libvirt/interface/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_interface.so
%{_mandir}/man8/virtinterfaced.8*
%files daemon-driver-network
@@ -1901,7 +1901,7 @@ exit 0
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
-%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_network.so
%{_mandir}/man8/virtnetworkd.8*
%if %{with_firewalld_zone}
@@ -1922,7 +1922,7 @@ exit 0
%{_unitdir}/virtnodedevd-admin.socket
%attr(0755, root, root) %{_sbindir}/virtnodedevd
%ghost %dir %{_rundir}/libvirt/nodedev/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_nodedev.so
%{_mandir}/man8/virtnodedevd.8*
%files daemon-driver-nwfilter
@@ -1938,7 +1938,7 @@ exit 0
%ghost %dir %{_rundir}/libvirt/network/
%ghost %dir %{_rundir}/libvirt/nwfilter-binding/
%ghost %dir %{_rundir}/libvirt/nwfilter/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_nwfilter.so
%{_mandir}/man8/virtnwfilterd.8*
%files daemon-driver-secret
@@ -1952,7 +1952,7 @@ exit 0
%attr(0755, root, root) %{_sbindir}/virtsecretd
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/secrets/
%ghost %dir %{_rundir}/libvirt/secrets/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_secret.so
%{_mandir}/man8/virtsecretd.8*
%files daemon-driver-storage
@@ -1970,45 +1970,45 @@ exit 0
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/storage/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/storage/autostart/
%ghost %dir %{_rundir}/libvirt/storage/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_fs.so
-%{_libdir}/%{name}/storage-file/libvirt_storage_file_fs.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so
+%{_libdir}/libvirt/storage-file/libvirt_storage_file_fs.so
%{_mandir}/man8/virtstoraged.8*
%files daemon-driver-storage-disk
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_disk.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_disk.so
%files daemon-driver-storage-logical
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_logical.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_logical.so
%files daemon-driver-storage-scsi
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_scsi.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_scsi.so
%files daemon-driver-storage-iscsi
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_iscsi.so
%if %{with_storage_iscsi_direct}
%files daemon-driver-storage-iscsi-direct
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi-direct.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_iscsi-direct.so
%endif
%files daemon-driver-storage-mpath
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_mpath.so
%if %{with_storage_gluster}
%files daemon-driver-storage-gluster
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_gluster.so
-%{_libdir}/%{name}/storage-file/libvirt_storage_file_gluster.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_gluster.so
+%{_libdir}/libvirt/storage-file/libvirt_storage_file_gluster.so
%endif
%if %{with_storage_rbd}
%files daemon-driver-storage-rbd
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_rbd.so
%endif
%if %{with_storage_zfs}
%files daemon-driver-storage-zfs
-%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
+%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_zfs.so
%endif
%if %{with_qemu}
@@ -2044,7 +2044,7 @@ exit 0
%dir %attr(0750, root, root) %{_localstatedir}/cache/libvirt/qemu/
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
-%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_qemu.so
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/swtpm/
%dir %attr(0730, tss, tss) %{_localstatedir}/log/swtpm/libvirt/qemu/
%{_bindir}/virt-qemu-run
@@ -2072,7 +2072,7 @@ exit 0
%{_datadir}/augeas/lenses/libvirtd_lxc.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
%attr(0755, root, root) %{_libexecdir}/libvirt_lxc
-%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_lxc.so
%{_mandir}/man8/virtlxcd.8*
%endif
@@ -2100,7 +2100,7 @@ exit 0
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/channel/target/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/dump/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/save/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_libxl.so
%{_mandir}/man8/virtxend.8*
%endif
@@ -2114,7 +2114,7 @@ exit 0
%{_unitdir}/virtvboxd-ro.socket
%{_unitdir}/virtvboxd-admin.socket
%attr(0755, root, root) %{_sbindir}/virtvboxd
-%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
+%{_libdir}/libvirt/connection-driver/libvirt_driver_vbox.so
%{_mandir}/man8/virtvboxd.8*
%endif
--
2.38.1
1 year, 11 months
[PATCH 00/12] JSON monitor handling cleanups and spurious error bug fix
by Peter Krempa
First half introduces qemuMonitorJSONGetReply and uses it in our code
base, second half introduces virJSONValueArrayToStringList, uses it to
fix a bug and refactor the rest of the usage.
Peter Krempa (12):
qemu: monitor: Introduce qemuMonitorJSONGetReply, a better
qemuMonitorJSONCheckReply
qemu: monitor: Use qemuMonitorJSONGetReply for VIR_JSON_TYPE_OBJECT
qemu: monitor: Use qemuMonitorJSONGetReply for VIR_JSON_TYPE_ARRAY
qemu: monitor: Use qemuMonitorJSONGetReply when the value is extracted
directly
qemu: monitor: Unify and refactor 'PTY' case in
qemuMonitorJSONAttachCharDev
util: json: Split out array->strinlist conversion from
virJSONValueObjectGetStringArray
qemuAgentGetDisks: Don't use virJSONValueObjectGetStringArray for
optional data
qemuMonitorJSONGetCPUDefinitions: Rework lookup of
'unavailable-features'
qemuMonitorJSONGetCPUDefinitions: Avoid double lookup of object
qemu: monitor: Use qemuMonitorJSONGetReply in conjunction with
virJSONValueArrayToStringList
qemuAgentSSHGetAuthorizedKeys: Convert last use
ofvirJSONValueObjectGetStringArray
util: json: Remove unused virJSONValueObjectGetStringArray wrapper
src/libvirt_private.syms | 2 +-
src/qemu/qemu_agent.c | 13 ++-
src/qemu/qemu_monitor_json.c | 189 +++++++++++++++--------------------
src/util/virjson.c | 44 +++-----
src/util/virjson.h | 3 +-
5 files changed, 106 insertions(+), 145 deletions(-)
--
2.38.1
1 year, 11 months
[PATCH] commandtest: Comply with FreeBSD poll()
by Michal Privoznik
In one of recent commits I've introduced a new test case to
commandtest. In the test case I'm using poll() to wait for data
on a pipe (the write end is passed to commandhelper). However, on
FreeBSD the POLLIN semantic is a bit different:
POLLIN Data other than high priority data may be read
without blocking.
Well, the pipe is non-blocking, so even if there's no data to be
read the flag is set (and subsequent read() returns 0). On the
other hand, POLLHUP is set too, BUT, if the commandhelper manages
to write everything into the pipe and die right after we'd get
both POLLIN and POLLHUP after the very first time poll() returns.
That's very unfortunate, but okay - we can just check whether
read() returned zero and break from the reading loop.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/commandtest.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 62275ba96d..688cf59160 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -1205,6 +1205,9 @@ test29(const void *unused G_GNUC_UNUSED)
goto cleanup;
}
+ if (rc == 0)
+ break;
+
outactual = g_renew(char, outactual, outactuallen + rc + 1);
memcpy(outactual + outactuallen, buf, rc);
outactuallen += rc;
--
2.37.4
1 year, 11 months
Release of libvirt-8.10.0
by Jiri Denemark
The 8.10.0 release of both libvirt and libvirt-python is tagged and
signed tarballs and source RPMs are available at
https://libvirt.org/sources/
https://libvirt.org/sources/python/
Thanks everybody who helped with this release by sending patches,
reviewing, testing, or providing feedback. Your work is greatly
appreciated.
* New features
* Tool for validating SEV firmware boot measurement of QEMU VMs
The ``virt-qemu-sev-validate`` program will compare a reported SEV/SEV-ES
domain launch measurement, to a computed launch measurement. This
determines whether the domain has been tampered with during launch.
* Support for SGX EPC (enclave page cache)
Users can add a ``<memory model='sgx-epc'>`` device to lauch a VM with
``Intel Software Guard Extensions``.
* Support migration of vTPM state of QEMU vms on shared storage
Pass ``--migration`` option if appropriate in order for ``swtpm`` to
properly migrate on shared storage.
* Improvements
* Mark close callback (un-)register API as high priority
High priority APIs use a separate thread pool thus can help in eliminating
problems with stuck VMs. Marking the close callback API as high priority
allows ``virsh`` to properly connect to the daemon in case the normal
priority workers are stuck allowing other high priority API usage.
* Updated x86 CPU features
The following features for the x86 platform were added:
``v-vmsave-vmload``, ``vgif``, ``avx512-vp2intersect``, ``avx512-fp16``,
``serialize``, ``tsx-ldtrk``, ``arch-lbr``, ``xfd``, ``intel-pt-lip``,
``avic``, ``sgx``, ``sgxlc``, ``sgx-exinfo``, ``sgx1``, ``sgx2``,
``sgx-debug``, ``sgx-mode64``, ``sgx-provisionkey``, ``sgx-tokenkey``,
``sgx-kss``, ``bus-lock-detect``, ``pks``, ``amx``.
* Add support for ``hv-avic`` Hyper-V enlightenment
``qemu-6.2`` introduced support for the ``hv-avic`` enlightenment which
allows to use Hyper-V SynIC with hardware APICv/AVIC enabled.
* qemu: Run memory preallocation with numa-pinned threads
Run the thread allocating memory in the proper NUMA node to reduce overhead.
* RPM packaging changes
- add optional dependancy of ``libvirt-daemon`` on ``libvirt-client``
The ``libvirt-guests.`` tool requires the ``virsh`` client to work
properly, but we don't want to require the installation of the daemon
if the tool is not used.
- relax required ``python3-libvirt`` version for ``libvirt-client-qemu``
The ``virt-qemu-qmp-proxy`` tool requires python but doesn't strictly
need the newest version. Remove the strict versioning requirement in
order to prevent cyclic dependency when building.
* Bug fixes
* Skip initialization of ``cache`` capabilities if host doesn't support them
Hypervisor drivers would fail to initialize on ``aarch64`` hosts with
following error ::
virStateInitialize:657 : Initialisation of cloud-hypervisor state driver failed: no error
which prevented the startup of the daemon.
* Allow incoming connections to guests on routed networks w/firewalld
A change in handling of implicit rules in ``firewalld 1.0.0`` broke
incomming connections to VMs when using ``routed`` network. This is fixed
by adding a new ``libvirt-routed`` zone configured to once again allow
incoming sessions to guests on routed networks.
* Fix infinite loop in nodedev driver
Certain udev entries might be of a size that makes libudev emit EINVAL
which caused a busy loop burning CPU. Fix it by ignoring the return code.
Enjoy.
Jirka
1 year, 11 months