[libvirt PATCH] libxl: libxlLoggerFileFree: remove redundant NULL assignment
by Ján Tomko
The 'file' pointer is already zeroed in virFileFclose
and never read again.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
src/libxl/libxl_logger.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c
index 44ee5a95da..4708553f29 100644
--- a/src/libxl/libxl_logger.c
+++ b/src/libxl/libxl_logger.c
@@ -53,7 +53,6 @@ libxlLoggerFileFree(void *payload)
{
FILE *file = payload;
VIR_FORCE_FCLOSE(file);
- file = NULL;
}
G_GNUC_PRINTF(5, 0) static void
--
2.31.1
2 years, 11 months
[libvirt PATCH] meson: Improve network driver enablement logic
by Andrea Bolognani
The Homebrew package explicitly enables this driver despite us
disabling it by default on macOS, so it must be functional to
at least some extent and certainly can't be causing any build
failures.
Additionally, if the user has explicitly asked for the network
driver to be enabled but libvirtd is disabled for whatever
reason, we should error out instead of silently disabling the
network driver.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Homebrew formula showing that the network driver is
explicitly enabled in the package:
https://github.com/Homebrew/homebrew-core/blob/3aff61292a3ed16bc715ba23fc...
Test pipeline showing that enabling the network driver by
default on macOS doesn't result in build failures:
https://gitlab.com/abologna/libvirt/-/pipelines/421956249
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index ba2f0d21de..cea8bbfa0c 100644
--- a/meson.build
+++ b/meson.build
@@ -1645,10 +1645,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a
endif
endif
-# there's no use compiling the network driver without the libvirt
-# daemon, nor compiling it for macOS, where it breaks the compile
-if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() != 'darwin'
+if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD')
conf.set('WITH_NETWORK', 1)
+elif get_option('driver_network').enabled()
+ error('libvirtd must be enabled to build the network driver')
endif
if udev_dep.found() and conf.has('WITH_LIBVIRTD')
--
2.31.1
2 years, 11 months
[PATCH 0/3] lib: Use g_autoptr() for virDomainDef
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (3):
virdomainobjlist: Use g_autofree
lib: Use g_autoptr() for virDomainDef
lib: Drop some needles labels
src/bhyve/bhyve_driver.c | 15 +++-----
src/bhyve/bhyve_parse_command.c | 23 +++++-------
src/ch/ch_driver.c | 6 ++--
src/conf/domain_conf.c | 10 ++----
src/conf/virdomainobjlist.c | 33 ++++++------------
src/esx/esx_driver.c | 14 +++-----
src/libxl/libxl_domain.c | 24 +++++--------
src/libxl/libxl_driver.c | 62 ++++++++++++---------------------
src/libxl/libxl_migration.c | 3 +-
src/libxl/xen_xl.c | 34 ++++++++----------
src/libxl/xen_xm.c | 18 ++++------
src/lxc/lxc_driver.c | 24 +++++--------
src/lxc/lxc_native.c | 40 ++++++++++-----------
src/openvz/openvz_conf.c | 3 +-
src/openvz/openvz_driver.c | 9 ++---
src/qemu/qemu_saveimage.c | 21 ++++-------
src/qemu/qemu_snapshot.c | 6 ++--
src/test/test_driver.c | 39 +++++++--------------
src/vbox/vbox_common.c | 14 +++-----
src/vmware/vmware_conf.c | 6 ++--
src/vmware/vmware_driver.c | 10 ++----
src/vmx/vmx.c | 12 +++----
src/vz/vz_driver.c | 24 +++++--------
src/vz/vz_sdk.c | 41 ++++++++++------------
tests/securityselinuxtest.c | 8 ++---
25 files changed, 182 insertions(+), 317 deletions(-)
--
2.32.0
2 years, 11 months
[PATCH v4 0/8] Implement detach device related APIs for test driver
by Luke Yue
diff to v3:
- Add virDomainDeviceDefOperationsCallbacks to xmlopt for de-duplicating purpose
- Add virDomainDeviceTypeFlags for de-duplicating purpose
- Remove the memballoon helper function
- Squash test_driver commits
- Move test device xmls to generichotplugdata
- Reimplement tests with internal APIs
link to v3: https://listman.redhat.com/archives/libvir-list/2021-November/msg00288.html
link to CI: https://gitlab.com/lukedyue/libvirt/-/pipelines/421921587
Luke Yue (8):
conf: Introduce virDomainInputDefRemove and fix memory leak
conf: Introduce virDomainDeviceDefOperationsCallbacks to xmlopt
conf: Add virDomainDeviceTypeFlags and use it in various drivers
conf: Add tpm helpers for future use
domain_driver: extract DetachXXXDeviceConfig related functions and use
them
test_driver: Implement virDomainDetachDeviceFlags
examples: xml: test: add xml for testing devices related APIs
tests: Add generichotplugtest
examples/xml/test/meson.build | 1 +
examples/xml/test/testdomfc5.xml | 54 ++
examples/xml/test/testnodeinline.xml | 54 ++
src/bhyve/bhyve_domain.c | 2 +-
src/ch/ch_conf.c | 2 +-
src/conf/domain_conf.c | 572 +++++++++++++++++-
src/conf/domain_conf.h | 135 ++++-
src/conf/virconftypes.h | 2 +
src/hyperv/hyperv_driver.c | 3 +-
src/libvirt_private.syms | 21 +
src/libxl/libxl_conf.c | 3 +-
src/libxl/libxl_domain.c | 8 +
src/libxl/libxl_domain.h | 1 +
src/libxl/libxl_driver.c | 73 +--
src/lxc/lxc_conf.c | 3 +-
src/lxc/lxc_domain.c | 7 +
src/lxc/lxc_domain.h | 1 +
src/lxc/lxc_driver.c | 62 +-
src/openvz/openvz_conf.c | 2 +-
src/qemu/qemu_conf.c | 3 +-
src/qemu/qemu_domain.c | 39 ++
src/qemu/qemu_domain.h | 6 +
src/qemu/qemu_driver.c | 204 +------
src/qemu/qemu_process.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
src/test/test_driver.c | 197 +++++-
src/vbox/vbox_common.c | 2 +-
src/vmware/vmware_driver.c | 2 +-
src/vmx/vmx.c | 2 +-
src/vz/vz_driver.c | 2 +-
tests/bhyveargv2xmltest.c | 2 +-
.../generichotplug-controller.xml | 1 +
.../generichotplug-disk-cdrom.xml | 5 +
.../generichotplug-filesystem.xml | 6 +
.../generichotplug-hostdev.xml | 5 +
.../generichotplug-input.xml | 1 +
.../generichotplug-interface.xml | 6 +
.../generichotplug-lease.xml | 5 +
.../generichotplug-memballoon.xml | 3 +
.../generichotplug-memory.xml | 6 +
.../generichotplugdata/generichotplug-rng.xml | 4 +
.../generichotplug-shmem.xml | 4 +
.../generichotplug-sound.xml | 3 +
.../generichotplugdata/generichotplug-tpm.xml | 5 +
.../generichotplug-vsock.xml | 3 +
.../generichotplug-watchdog.xml | 1 +
tests/generichotplugtest.c | 178 ++++++
tests/meson.build | 1 +
tests/testutils.c | 2 +-
49 files changed, 1377 insertions(+), 331 deletions(-)
create mode 100644 tests/generichotplugdata/generichotplug-controller.xml
create mode 100644 tests/generichotplugdata/generichotplug-disk-cdrom.xml
create mode 100644 tests/generichotplugdata/generichotplug-filesystem.xml
create mode 100644 tests/generichotplugdata/generichotplug-hostdev.xml
create mode 100644 tests/generichotplugdata/generichotplug-input.xml
create mode 100644 tests/generichotplugdata/generichotplug-interface.xml
create mode 100644 tests/generichotplugdata/generichotplug-lease.xml
create mode 100644 tests/generichotplugdata/generichotplug-memballoon.xml
create mode 100644 tests/generichotplugdata/generichotplug-memory.xml
create mode 100644 tests/generichotplugdata/generichotplug-rng.xml
create mode 100644 tests/generichotplugdata/generichotplug-shmem.xml
create mode 100644 tests/generichotplugdata/generichotplug-sound.xml
create mode 100644 tests/generichotplugdata/generichotplug-tpm.xml
create mode 100644 tests/generichotplugdata/generichotplug-vsock.xml
create mode 100644 tests/generichotplugdata/generichotplug-watchdog.xml
create mode 100644 tests/generichotplugtest.c
--
2.34.1
2 years, 11 months
Release of libvirt-7.10.0
by Jiri Denemark
The 7.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
* Added virt-pki-query-dn binary
This binary helps users figure out the format of Distinguished Name
from a certificate file the way that libvirt expects it in
tls_allowed_dn_list option of libvirtd.conf configuration file
* Improvements
* qemu: Report guest interface information in ``virDomainGetGuestInfo``
Libvirt is now able to report interface information from the guest's
perspective (using guest agent).
* qemu: detect guest side errors during device removal
Libvirt is now able to detect guest side errors during device removal by
using the DEVICE_UNPLUG_GUEST_ERROR event, available in QEMU 6.2.0.
* Minimum SSF setting
The libvirtd.conf option tcp_min_ssf can be used to override the minimum
permitted security strength factor for non-TLS remote connections.
The current hardcoded minimum is 56 (single-DES) and will be raised to 112
in the future. Setting a minimum lower than 112 is not supported.
* qemu: Report stats also for block copy destination and backup job scratch
images
The statistics are available via the bulk domain stats API.
* Bug fixes
* qemu: Don't format 'ramfb' attribute when disabled
Fix a regression caused by the conversion to JSON -device arguments where
'ramfb' would be put on the commandline of 'vfio-pci' which doesn't have it,
thus breaking VMs with a mediated host device.
* qemu: Fix block copy and backup to encrypted storage
An oversight in last release lead to a spurious error being reported when
encrypted storage was requested for disk images which are not directly
backing the disk, which is now fixed.
Enjoy.
Jirka
2 years, 11 months
[PATCH] Fix reboot command for LXC containers
by joachim.falk@jfalk.de
From: Joachim Falk <joachim.falk(a)gmx.de>
The virNetDaemonQuit(dmn) command in virLXCControllerSignalChildIO triggers an
early close of all clients of lxc_controller. Here, libvirtd itself is a client
of this controller, and the client connection is used to notify libvirtd if a
reboot of the container is required. However, the client connection was closed
before such a status could be sent to libvirtd. To fix this bug, we will
immediately send the reboot or shutdown status of the container to libvirtd,
and only after client disconnect will we trigger virNetDaemonQuit.
Fixes: #237
Bug: https://gitlab.com/libvirt/libvirt/-/issues/237
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991773
Signed-off-by: Joachim Falk <joachim.falk(a)gmx.de>
---
src/lxc/lxc_controller.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 444f728af4..039efcd7c7 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -894,8 +894,10 @@ static void virLXCControllerClientCloseHook(virNetServerClient *client)
virLXCController *ctrl = virNetServerClientGetPrivateData(client);
VIR_DEBUG("Client %p has closed", client);
- if (ctrl->client == client)
+ if (ctrl->client == client) {
ctrl->client = NULL;
+ VIR_DEBUG("Client has gone away");
+ }
if (ctrl->inShutdown) {
VIR_DEBUG("Arm timer to quit event loop");
virEventUpdateTimeout(ctrl->timerShutdown, 0);
@@ -1006,8 +1008,11 @@ static int lxcControllerClearCapabilities(void)
static bool wantReboot;
static virMutex lock = VIR_MUTEX_INITIALIZER;
+static int
+virLXCControllerEventSendExit(virLXCController *ctrl,
+ int exitstatus);
-static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
+static void virLXCControllerSignalChildIO(virNetDaemon *dmn G_GNUC_UNUSED,
siginfo_t *info G_GNUC_UNUSED,
void *opaque)
{
@@ -1018,7 +1023,6 @@ static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
ret = waitpid(-1, &status, WNOHANG);
VIR_DEBUG("Got sig child %d vs %lld", ret, (long long)ctrl->initpid);
if (ret == ctrl->initpid) {
- virNetDaemonQuit(dmn);
virMutexLock(&lock);
if (WIFSIGNALED(status) &&
WTERMSIG(status) == SIGHUP) {
@@ -1026,6 +1030,7 @@ static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
wantReboot = true;
}
virMutexUnlock(&lock);
+ virLXCControllerEventSendExit(ctrl, wantReboot ? 1 : 0);
}
}
@@ -2276,9 +2281,10 @@ virLXCControllerEventSendExit(virLXCController *ctrl,
VIR_DEBUG("Waiting for client to complete dispatch");
ctrl->inShutdown = true;
virNetServerClientDelayedClose(ctrl->client);
- virNetDaemonRun(ctrl->daemon);
+ } else {
+ VIR_DEBUG("Arm timer to quit event loop");
+ virEventUpdateTimeout(ctrl->timerShutdown, 0);
}
- VIR_DEBUG("Client has gone away");
return 0;
}
@@ -2430,8 +2436,6 @@ virLXCControllerRun(virLXCController *ctrl)
rc = virLXCControllerMain(ctrl);
- virLXCControllerEventSendExit(ctrl, rc);
-
cleanup:
VIR_FORCE_CLOSE(control[0]);
VIR_FORCE_CLOSE(control[1]);
--
2.30.2
2 years, 11 months
[PATCH] Fix reboot command for LXC containers
by Joachim Falk
The virNetDaemonQuit(dmn) command in virLXCControllerSignalChildIO triggers an
early close of all clients of lxc_controller. Here, libvirtd itself is a client
of this controller, and the client connection is used to notify libvirtd if a
reboot of the container is required. However, the client connection was closed
before such a status could be sent to libvirtd. To fix this bug, we will
immediately send the reboot or shutdown status of the container to libvirtd,
and only after client disconnect will we trigger virNetDaemonQuit.
Fixes: #237
Bug: https://gitlab.com/libvirt/libvirt/-/issues/237
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991773
Signed-off-by: Joachim Falk <joachim.falk(a)gmx.de>
---
src/lxc/lxc_controller.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 444f728af4..75107822ba 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -894,8 +894,10 @@ static void virLXCControllerClientCloseHook(virNetServerClient *client)
virLXCController *ctrl = virNetServerClientGetPrivateData(client);
VIR_DEBUG("Client %p has closed", client);
- if (ctrl->client == client)
+ if (ctrl->client == client) {
ctrl->client = NULL;
+ VIR_DEBUG("Client has gone away");
+ }
if (ctrl->inShutdown) {
VIR_DEBUG("Arm timer to quit event loop");
virEventUpdateTimeout(ctrl->timerShutdown, 0);
@@ -1006,6 +1008,9 @@ static int lxcControllerClearCapabilities(void)
static bool wantReboot;
static virMutex lock = VIR_MUTEX_INITIALIZER;
+static int
+virLXCControllerEventSendExit(virLXCController *ctrl,
+ int exitstatus);
static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
siginfo_t *info G_GNUC_UNUSED,
@@ -1015,10 +1020,10 @@ static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
int ret;
int status;
+ ignore_value(dmn);
ret = waitpid(-1, &status, WNOHANG);
VIR_DEBUG("Got sig child %d vs %lld", ret, (long long)ctrl->initpid);
if (ret == ctrl->initpid) {
- virNetDaemonQuit(dmn);
virMutexLock(&lock);
if (WIFSIGNALED(status) &&
WTERMSIG(status) == SIGHUP) {
@@ -1026,6 +1031,7 @@ static void virLXCControllerSignalChildIO(virNetDaemon *dmn,
wantReboot = true;
}
virMutexUnlock(&lock);
+ virLXCControllerEventSendExit(ctrl, wantReboot ? 1 : 0);
}
}
@@ -2276,9 +2282,10 @@ virLXCControllerEventSendExit(virLXCController *ctrl,
VIR_DEBUG("Waiting for client to complete dispatch");
ctrl->inShutdown = true;
virNetServerClientDelayedClose(ctrl->client);
- virNetDaemonRun(ctrl->daemon);
+ } else {
+ VIR_DEBUG("Arm timer to quit event loop");
+ virEventUpdateTimeout(ctrl->timerShutdown, 0);
}
- VIR_DEBUG("Client has gone away");
return 0;
}
@@ -2430,8 +2437,6 @@ virLXCControllerRun(virLXCController *ctrl)
rc = virLXCControllerMain(ctrl);
- virLXCControllerEventSendExit(ctrl, rc);
-
cleanup:
VIR_FORCE_CLOSE(control[0]);
VIR_FORCE_CLOSE(control[1]);
--
2.30.2
2 years, 11 months
[libvirt PATCH 0/5] Add bus-lock-ratelimit
by Tim Wiederhake
This was introduced recently in QEMU, see
https://bugzilla.redhat.com/show_bug.cgi?id=1982165:
Bus locks disrupts overall performance since it blocks all other cores
(which must wait for the bus lock to be released before their memory
operations).
For VMM, it can detect every bus lock acquired by guest VMs and induces
a VM exit. So VMM can count the number/frequency of bus lock and take
some throttling action or just kill the guest.
Tim Wiederhake (5):
conf: Add bus-lock-ratelimit
qemu: Add bus-lock-ratelimit
doc: schema: Add bus-lock-ratelimit to domain schema
tests: Add tests for bus-lock-ratelimit
doc: Document new bus-lock-ratelimit option
docs/formatdomain.rst | 4 +++
docs/schemas/domaincommon.rng | 7 +++++
src/conf/domain_conf.c | 34 +++++++++++++++++++++++
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_command.c | 4 +++
src/qemu/qemu_validate.c | 1 +
tests/qemuxml2argvdata/kvm-features.args | 2 +-
tests/qemuxml2argvdata/kvm-features.xml | 1 +
tests/qemuxml2xmloutdata/kvm-features.xml | 1 +
9 files changed, 55 insertions(+), 1 deletion(-)
--
2.31.1
2 years, 11 months
[libvirt PATCH 00/14] qemu snapshot revert cleanup and refactor
by Pavel Hrdina
Pavel Hrdina (14):
qemu_snapshot: revert: fix incorrect jump to cleanup
qemu_snapshot: revert: drop unused variable
qemu_snapshot: revert: use g_autoptr
qemu_snapshot: revert: jump to endjob instead of calling
qemuProcessEndJob
qemu_snapshot: revert: remove cleanup label
qemu_snapshot: revert: move validation to separate function
qemu_snapshot: revert: move config prepare code to separate function
qemu_snapshot: revert: emit event right after they are created
qemu_snapshot: revert: refactor cleanup section
qemu_snapshot: revert: move saving metadata to separate function
qemu_snapshot: revert: save metadata within qemu process job
qemu_snapshot: revert: move active snapshot revert to separate
function
qemu_snapshot: revert: rename qemuSnapshotRevertInactive
qemu_snapshot: revert: move inactive snapshot to separate function
src/qemu/qemu_snapshot.c | 554 ++++++++++++++++++++++-----------------
1 file changed, 320 insertions(+), 234 deletions(-)
--
2.31.1
2 years, 11 months