[libvirt] [PATCH 0/9] More GLib macro usage (glib chronicles)
by Ján Tomko
Ján Tomko (9):
util: xml: use g_auto directly for VIR_XPATH_NODE_AUTORESTORE
virbuffer: use g_auto directly for virBuffer
Use g_autofree instead of VIR_AUTOFREE
Use G_DEFINE_AUTOPTR_CLEANUP_FUNC instead of VIR_DEFINE_AUTOPTR_FUNC
Use g_autoptr instead of VIR_AUTOPTR
Define G_DEFINE_AUTOPTR_CLEANUP_FUNC for virDomainCheckpointDef
Use g_autoptr instead of VIR_AUTOUNREF
Delete virObjectAutoUnref
Remove virautoclean.h
src/bhyve/bhyve_conf.c | 2 +-
src/conf/checkpoint_conf.c | 10 +-
src/conf/checkpoint_conf.h | 1 +
src/conf/domain_capabilities.h | 3 +-
src/conf/domain_conf.c | 858 ++++++++++-----------
src/conf/domain_conf.h | 2 +-
src/conf/interface_conf.c | 2 +-
src/conf/network_conf.c | 6 +-
src/conf/node_device_conf.c | 2 +-
src/conf/nwfilter_conf.c | 2 +-
src/conf/secret_conf.c | 8 +-
src/conf/secret_conf.h | 2 +-
src/conf/snapshot_conf.c | 4 +-
src/conf/storage_conf.c | 60 +-
src/conf/storage_conf.h | 7 +-
src/conf/virnetworkobj.c | 10 +-
src/conf/virnetworkportdef.c | 18 +-
src/conf/virnetworkportdef.h | 2 +-
src/conf/virstorageobj.c | 4 +-
src/cpu/cpu_x86.c | 12 +-
src/driver.c | 4 +-
src/esx/esx_driver.c | 2 +-
src/esx/esx_storage_backend_vmfs.c | 4 +-
src/interface/interface_backend_netcf.c | 2 +-
src/interface/interface_backend_udev.c | 2 +-
src/libvirt-admin.c | 4 +-
src/libvirt.c | 2 +-
src/libvirt_private.syms | 1 -
src/libxl/libxl_conf.c | 2 +-
src/libxl/libxl_driver.c | 6 +-
src/libxl/xen_common.c | 24 +-
src/libxl/xen_xl.c | 14 +-
src/libxl/xen_xm.c | 10 +-
src/locking/lock_daemon.c | 2 +-
src/locking/lock_daemon_config.c | 2 +-
src/locking/lock_driver_lockd.c | 2 +-
src/locking/lock_driver_sanlock.c | 2 +-
src/logging/log_daemon.c | 2 +-
src/logging/log_daemon_config.c | 2 +-
src/lxc/lxc_conf.c | 2 +-
src/lxc/lxc_native.c | 18 +-
src/network/bridge_driver.c | 12 +-
src/node_device/node_device_hal.c | 2 +-
src/node_device/node_device_udev.c | 2 +-
src/phyp/phyp_driver.c | 4 +-
src/qemu/qemu_agent.c | 16 +-
src/qemu/qemu_block.c | 126 +--
src/qemu/qemu_block.h | 4 +-
src/qemu/qemu_blockjob.c | 26 +-
src/qemu/qemu_capabilities.c | 12 +-
src/qemu/qemu_checkpoint.c | 22 +-
src/qemu/qemu_command.c | 336 ++++----
src/qemu/qemu_conf.c | 54 +-
src/qemu/qemu_dbus.c | 2 +-
src/qemu/qemu_dbus.h | 2 +-
src/qemu/qemu_domain.c | 100 +--
src/qemu/qemu_domain_address.c | 6 +-
src/qemu/qemu_driver.c | 58 +-
src/qemu/qemu_extdevice.c | 4 +-
src/qemu/qemu_firmware.c | 46 +-
src/qemu/qemu_firmware.h | 3 +-
src/qemu/qemu_hotplug.c | 154 ++--
src/qemu/qemu_interface.c | 2 +-
src/qemu/qemu_interop_config.c | 18 +-
src/qemu/qemu_migration.c | 8 +-
src/qemu/qemu_migration_params.h | 3 +-
src/qemu/qemu_monitor.c | 4 +-
src/qemu/qemu_monitor.h | 2 +-
src/qemu/qemu_monitor_json.c | 72 +-
src/qemu/qemu_process.c | 10 +-
src/qemu/qemu_qapi.c | 4 +-
src/qemu/qemu_slirp.c | 40 +-
src/qemu/qemu_slirp.h | 2 +-
src/qemu/qemu_tpm.c | 10 +-
src/qemu/qemu_vhost_user.c | 18 +-
src/qemu/qemu_vhost_user.h | 3 +-
src/qemu/qemu_vhost_user_gpu.c | 22 +-
src/remote/remote_daemon.c | 2 +-
src/remote/remote_daemon_config.c | 4 +-
src/remote/remote_daemon_dispatch.c | 8 +-
src/remote/remote_driver.c | 42 +-
src/secret/secret_driver.c | 4 +-
src/security/security_selinux.c | 2 +-
src/security/security_util.c | 36 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 2 +-
src/storage/storage_backend_disk.c | 20 +-
src/storage/storage_backend_fs.c | 16 +-
src/storage/storage_backend_gluster.c | 12 +-
src/storage/storage_backend_iscsi.c | 18 +-
src/storage/storage_backend_iscsi_direct.c | 14 +-
src/storage/storage_backend_logical.c | 34 +-
src/storage/storage_backend_mpath.c | 4 +-
src/storage/storage_backend_rbd.c | 18 +-
src/storage/storage_backend_scsi.c | 14 +-
src/storage/storage_backend_sheepdog.c | 18 +-
src/storage/storage_backend_vstorage.c | 12 +-
src/storage/storage_backend_zfs.c | 20 +-
src/storage/storage_driver.c | 36 +-
src/storage/storage_file_gluster.c | 4 +-
src/storage/storage_util.c | 106 +--
src/test/test_driver.c | 62 +-
src/util/Makefile.inc.am | 1 -
src/util/iohelper.c | 2 +-
src/util/virarptable.c | 4 +-
src/util/viraudit.c | 2 +-
src/util/virauth.c | 12 +-
src/util/virauthconfig.c | 4 +-
src/util/virauthconfig.h | 3 +-
src/util/virautoclean.h | 89 ---
src/util/virbitmap.c | 2 +-
src/util/virbitmap.h | 3 +-
src/util/virbuffer.c | 6 +-
src/util/virbuffer.h | 3 +-
src/util/vircgroup.c | 40 +-
src/util/vircgroupv1.c | 108 +--
src/util/vircgroupv2.c | 108 +--
src/util/vircommand.c | 26 +-
src/util/vircommand.h | 3 +-
src/util/virconf.h | 3 +-
src/util/virerror.c | 4 +-
src/util/virerror.h | 3 +-
src/util/vireventpoll.c | 2 +-
src/util/virfcp.c | 4 +-
src/util/virfile.c | 70 +-
src/util/virfile.h | 3 +-
src/util/virfilecache.c | 8 +-
src/util/virfirewall.c | 16 +-
src/util/virfirewall.h | 3 +-
src/util/virfirewalld.c | 4 +-
src/util/virfirmware.h | 2 +-
src/util/virhash.h | 4 +-
src/util/virhook.c | 6 +-
src/util/virhostdev.c | 68 +-
src/util/virhostmem.c | 12 +-
src/util/viriptables.c | 20 +-
src/util/viriscsi.c | 34 +-
src/util/virjson.c | 18 +-
src/util/virjson.h | 3 +-
src/util/virkmod.c | 8 +-
src/util/virlease.c | 8 +-
src/util/virmacaddr.h | 3 +-
src/util/virmdev.c | 20 +-
src/util/virmdev.h | 5 +-
src/util/virnetdev.c | 4 +-
src/util/virnetdev.h | 3 +-
src/util/virnetdevbridge.c | 16 +-
src/util/virnetdevip.c | 56 +-
src/util/virnetdevip.h | 5 +-
src/util/virnetdevmacvlan.c | 10 +-
src/util/virnetdevopenvswitch.c | 26 +-
src/util/virnetdevtap.c | 6 +-
src/util/virnetdevveth.c | 10 +-
src/util/virnetdevvlan.h | 3 +-
src/util/virnetlink.c | 28 +-
src/util/virnetlink.h | 3 +-
src/util/virnodesuspend.c | 4 +-
src/util/virnuma.c | 28 +-
src/util/virobject.c | 14 -
src/util/virobject.h | 15 -
src/util/virpci.c | 96 +--
src/util/virpci.h | 7 +-
src/util/virperf.c | 4 +-
src/util/virperf.h | 3 +-
src/util/virpidfile.c | 22 +-
src/util/virprocess.c | 18 +-
src/util/virqemu.c | 6 +-
src/util/virresctrl.c | 2 +-
src/util/virscsi.c | 22 +-
src/util/virscsi.h | 3 +-
src/util/virscsivhost.c | 2 +-
src/util/virscsivhost.h | 3 +-
src/util/virsocketaddr.c | 8 +-
src/util/virsocketaddr.h | 3 +-
src/util/virstoragefile.c | 80 +-
src/util/virstoragefile.h | 3 +-
src/util/virsystemd.h | 3 +-
src/util/virtpm.c | 8 +-
src/util/virtypedparam.h | 3 +-
src/util/viruri.h | 3 +-
src/util/virusb.c | 6 +-
src/util/virusb.h | 3 +-
src/util/virutil.c | 4 +-
src/util/virxml.h | 11 +-
src/vbox/vbox_common.c | 4 +-
src/vbox/vbox_storage.c | 2 +-
src/vmx/vmx.c | 2 +-
src/vz/vz_driver.c | 2 +-
tests/cputest.c | 4 +-
tests/networkxml2firewalltest.c | 4 +-
tests/qemublocktest.c | 58 +-
tests/qemucapabilitiestest.c | 4 +-
tests/qemucaps2xmltest.c | 4 +-
tests/qemudomaincheckpointxml2xmltest.c | 8 +-
tests/qemudomainsnapshotxml2xmltest.c | 2 +-
tests/qemufirmwaretest.c | 14 +-
tests/qemuhotplugtest.c | 2 +-
tests/qemumonitorjsontest.c | 88 +--
tests/qemumonitortestutils.c | 26 +-
tests/qemumonitortestutils.h | 3 +-
tests/qemusecuritytest.c | 10 +-
tests/qemuvhostusertest.c | 14 +-
tests/storagebackendsheepdogtest.c | 14 +-
tests/storagepoolcapstest.c | 10 +-
tests/storagepoolxml2argvtest.c | 10 +-
tests/storagepoolxml2xmltest.c | 8 +-
tests/storagevolxml2argvtest.c | 22 +-
tests/storagevolxml2xmltest.c | 12 +-
tests/testutils.c | 4 +-
tests/testutilsqemu.c | 2 +-
tests/virbitmaptest.c | 6 +-
tests/virbuftest.c | 6 +-
tests/virconftest.c | 12 +-
tests/virfilewrapper.c | 12 +-
tests/virhostdevtest.c | 2 +-
tests/virjsontest.c | 68 +-
tests/virmockstathelpers.c | 16 +-
tests/virnetdevopenvswitchtest.c | 4 +-
tests/virnetworkportxml2xmltest.c | 2 +-
tests/virpcimock.c | 56 +-
tests/virstoragetest.c | 28 +-
tests/virstorageutiltest.c | 4 +-
tests/virsystemdtest.c | 4 +-
tests/xlconfigtest.c | 4 +-
tests/xmconfigtest.c | 4 +-
tools/virsh-completer-domain.c | 28 +-
tools/virsh-completer-host.c | 22 +-
tools/virsh-completer.c | 2 +-
tools/virsh-domain-monitor.c | 10 +-
tools/virsh-domain.c | 20 +-
tools/virsh-network.c | 2 +-
tools/virsh-pool.c | 2 +-
tools/virsh-secret.c | 2 +-
tools/virsh-util.h | 2 +-
tools/virt-admin.c | 6 +-
tools/virt-login-shell-helper.c | 2 +-
236 files changed, 2325 insertions(+), 2478 deletions(-)
delete mode 100644 src/util/virautoclean.h
--
2.19.2
5 years, 1 month
[libvirt] [PATCH 0/8] Use even morer of GLib's macros (glib chronicles)
by Ján Tomko
Ján Tomko (8):
syntax-check: mock-noinline: fix after G_GNUC attribute invocations
syntax-check: prohibit_attribute_macros: generalize error
Use G_GNUC_NO_INLINE instead of ATTRIBUTE_NOINLINE
Use G_GNUC_PRINTF instead of ATTRIBUTE_FMT_PRINTF
Document the ATTRIBUTE_FALLTHROUGH macro
Use G_GNUC_FALLTHROUGH instead of ATTRIBUTE_FALLTHROUGH
examples: Use G_N_ELEMENTS instead of ARRAY_CARDINALITY
Use G_N_ELEMENTS instead of ARRAY_CARDINALITY
build-aux/mock-noinline.pl | 4 +-
build-aux/syntax-check.mk | 10 ++-
examples/c/misc/event-test.c | 26 +++----
src/access/viraccessmanager.c | 2 +-
src/conf/domain_capabilities.h | 2 +-
src/conf/domain_conf.c | 10 +--
src/conf/network_conf.c | 2 +-
src/conf/nwfilter_conf.c | 14 ++--
src/conf/storage_conf.c | 2 +-
src/conf/virdomainsnapshotobjlist.c | 2 +-
src/cpu/cpu.c | 4 +-
src/cpu/cpu_arm.c | 2 +-
src/cpu/cpu_ppc64.c | 6 +-
src/cpu/cpu_s390.c | 2 +-
src/cpu/cpu_x86.c | 8 +-
src/esx/esx_vi.c | 4 +-
src/internal.h | 41 ++++------
src/libvirt-domain.c | 8 +-
src/libvirt-host.c | 2 +-
src/libxl/libxl_capabilities.c | 8 +-
src/libxl/libxl_conf.c | 2 +-
src/libxl/libxl_driver.c | 2 +-
src/libxl/libxl_logger.c | 2 +-
src/libxl/libxl_migration.c | 4 +-
src/libxl/xen_xl.c | 2 +-
src/locking/domain_lock.c | 4 +-
src/locking/lock_daemon.c | 4 +-
src/locking/sanlock_helper.c | 2 +-
src/logging/log_daemon.c | 4 +-
src/lxc/lxc_container.c | 8 +-
src/lxc/lxc_controller.c | 2 +-
src/lxc/lxc_monitor.c | 2 +-
src/network/bridge_driver.c | 8 +-
src/network/leaseshelper.c | 4 +-
src/node_device/node_device_hal.c | 4 +-
src/node_device/node_device_udev.c | 2 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 10 +--
src/nwfilter/nwfilter_learnipaddr.c | 2 +-
src/phyp/phyp_driver.c | 2 +-
src/qemu/qemu_agent.c | 2 +-
src/qemu/qemu_capabilities.c | 112 ++++++++++++++--------------
src/qemu/qemu_capspriv.h | 2 +-
src/qemu/qemu_command.c | 6 +-
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_domain.c | 8 +-
src/qemu/qemu_domain.h | 4 +-
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_hotplug.c | 4 +-
src/qemu/qemu_migration.c | 8 +-
src/qemu/qemu_migration_params.c | 12 +--
src/qemu/qemu_monitor_json.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/qemu/qemu_qapi.c | 2 +-
src/remote/remote_daemon.c | 4 +-
src/remote/remote_daemon_dispatch.c | 14 ++--
src/remote/remote_driver.c | 8 +-
src/rpc/gendispatch.pl | 2 +-
src/rpc/virnetclient.c | 8 +-
src/rpc/virnetsocket.h | 4 +-
src/security/security_dac.c | 2 +-
src/security/security_driver.c | 2 +-
src/security/security_selinux.c | 2 +-
src/security/virt-aa-helper.c | 6 +-
src/test/test_driver.c | 2 +-
src/util/virarch.c | 2 +-
src/util/viraudit.c | 2 +-
src/util/viraudit.h | 2 +-
src/util/virbuffer.h | 4 +-
src/util/vircgroupv1.c | 6 +-
src/util/vircgroupv2.c | 4 +-
src/util/vircommand.h | 6 +-
src/util/virconf.c | 2 +-
src/util/vircrypto.c | 2 +-
src/util/virdbus.c | 2 +-
src/util/virenum.h | 6 +-
src/util/virerror.h | 8 +-
src/util/virfile.h | 28 +++----
src/util/virfirewall.c | 2 +-
src/util/virfirewall.h | 2 +-
src/util/virhashcode.c | 6 +-
src/util/virhashcode.h | 2 +-
src/util/virhostcpu.c | 2 +-
src/util/virhostcpu.h | 4 +-
src/util/virhostuptime.h | 2 +-
src/util/viriptables.c | 8 +-
src/util/viriscsi.c | 2 +-
src/util/virkeycode.c | 26 +++----
src/util/virlog.c | 6 +-
src/util/virlog.h | 4 +-
src/util/virmacaddr.h | 2 +-
src/util/virnetdev.c | 4 +-
src/util/virnetdev.h | 10 +--
src/util/virnetdevip.h | 2 +-
src/util/virnetdevmacvlan.h | 2 +-
src/util/virnetdevopenvswitch.h | 2 +-
src/util/virnetdevtap.h | 6 +-
src/util/virnetlink.c | 2 +-
src/util/virnuma.h | 16 ++--
src/util/virperf.c | 2 +-
src/util/virprocess.c | 2 +-
src/util/virprocess.h | 4 +-
src/util/virrandom.h | 6 +-
src/util/virscsi.h | 2 +-
src/util/virscsivhost.h | 2 +-
src/util/virstoragefile.c | 6 +-
src/util/virstring.h | 4 +-
src/util/virtpm.c | 4 +-
src/util/virtpm.h | 2 +-
src/util/virtypedparam.c | 2 +-
src/util/virtypedparam.h | 14 ++--
src/util/virutil.c | 14 ++--
src/util/virutil.h | 12 +--
src/util/viruuid.h | 2 +-
src/vbox/vbox_XPCOMCGlue.c | 2 +-
src/vmware/vmware_driver.c | 2 +-
src/vz/vz_driver.c | 8 +-
tests/commandhelper.c | 2 +-
tests/esxutilstest.c | 8 +-
tests/eventtest.c | 2 +-
tests/nwfilterxml2firewalltest.c | 2 +-
tests/openvzutilstest.c | 2 +-
tests/qemufirmwaretest.c | 4 +-
tests/qemumonitorjsontest.c | 4 +-
tests/qemumonitortestutils.c | 2 +-
tests/qemuvhostusertest.c | 2 +-
tests/qemuxml2argvmock.c | 2 +-
tests/qemuxml2argvtest.c | 18 ++---
tests/testutils.c | 2 +-
tests/testutilshostcpus.h | 8 +-
tests/testutilsqemu.c | 40 +++++-----
tests/testutilsxen.c | 6 +-
tests/utiltest.c | 10 +--
tests/virbitmaptest.c | 8 +-
tests/vircgrouptest.c | 14 ++--
tests/virfiletest.c | 2 +-
tests/virfirewalltest.c | 2 +-
tests/virhashtest.c | 32 ++++----
tests/virhostcputest.c | 2 +-
tests/viriscsitest.c | 2 +-
tests/virnetmessagetest.c | 6 +-
tests/virnettlscontexttest.c | 2 +-
tests/virnettlssessiontest.c | 2 +-
tests/virnumamock.c | 2 +-
tests/virpcitest.c | 6 +-
tests/virpolkittest.c | 2 +-
tests/virrotatingfiletest.c | 10 +--
tests/virstoragetest.c | 8 +-
tests/virstringtest.c | 8 +-
tests/virsystemdtest.c | 4 +-
tests/virtypedparamtest.c | 8 +-
tools/virsh-domain.c | 6 +-
tools/virsh-edit.c | 2 +-
tools/virsh-network.c | 2 +-
tools/virsh-nodedev.c | 2 +-
tools/virsh-pool.c | 2 +-
tools/virsh-secret.c | 2 +-
tools/virsh.c | 2 +-
tools/virt-admin.c | 2 +-
tools/virt-host-validate-common.c | 4 +-
tools/virt-host-validate-common.h | 4 +-
tools/vsh.h | 10 +--
161 files changed, 498 insertions(+), 503 deletions(-)
--
2.19.2
5 years, 1 month
[libvirt] [PATCH v4] util: Ignore SIGPIPE before write logs to stderr in child process
by Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal
handlers to the defaults. But child process may write logs to
stderr/stdout, that may generate SIGPIPE if journald has stopped.
So in virExec(), set SIGPIPE to ignored before invoke
virCommandMassClose, and revert it back to SIG_DFL after that.
In virProcessRunInFork(), just set SIGPIPE to ignored.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
---
v1 patch:
https://www.redhat.com/archives/libvir-list/2019-October/msg00720.html
Changes in v2:
- use pthread_sigmask to block SIGPIPE
Changes in v3:
- pass SIG_UNBLOCK(not SIG_SETMASK) to pthread_sigmask when unlock SIGPIPE
Changes in v4:
- don't block SIGPIPE, ignore it when invoke VIR_FORCE_CLOSE and virCommandMassClose
---
src/util/vircommand.c | 16 ++++++++++++++++
src/util/virprocess.c | 10 ++++++++++
2 files changed, 26 insertions(+)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 763bcb6..bb6e73b 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -653,9 +653,25 @@ virExec(virCommandPtr cmd)
umask(cmd->mask);
ret = EXIT_CANCELED;
+ memset(&waxoff, 0, sizeof(waxoff));
+ waxoff.sa_handler = SIG_IGN;
+ sigemptyset(&waxoff.sa_mask);
+ memset(&waxon, 0, sizeof(waxon));
+ if (sigaction(SIGPIPE, &waxoff, &waxon) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Could not disable SIGPIPE"));
+ goto fork_error;
+ }
+
if (virCommandMassClose(cmd, childin, childout, childerr) < 0)
goto fork_error;
+ if (sigaction(SIGPIPE, &waxon, NULL) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Could not re-enable SIGPIPE"));
+ goto fork_error;
+ }
+
if (prepareStdFd(childin, STDIN_FILENO) < 0) {
virReportSystemError(errno,
"%s", _("failed to setup stdin file handle"));
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index e8d4ba0..da66dcf 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -1151,6 +1151,16 @@ virProcessRunInFork(virProcessForkCallback cb,
goto cleanup;
if (child == 0) {
+ struct sigaction waxoff;
+
+ memset(&waxoff, 0, sizeof(waxoff));
+ waxoff.sa_handler = SIG_IGN;
+ sigemptyset(&waxoff.sa_mask);
+ if (sigaction(SIGPIPE, &waxoff, NULL) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Could not disable SIGPIPE"));
+ }
+
VIR_FORCE_CLOSE(errfd[0]);
ret = virProcessRunInForkHelper(errfd[1], parent, cb, opaque);
VIR_FORCE_CLOSE(errfd[1]);
--
1.8.3.1
5 years, 1 month
[libvirt] [PATCH 0/1] Add shrink flag to blockresize command
by martinsson.patrik@gmail.com
From: patchon <martinsson.patrik(a)gmail.com>
This changes the behaviour when shrinking a block device. This should be
a fairly uncommon thing to do (I think), so I don't think one have to
worry about breaking anything when introducing the new flag (--shrink).
This also mimics the existing behaviour of the vol-resize command, which
I personally think makes sense.
Unfortunately this check was not present when I, one late Friday
afternoon, was asked to extend a production-mysql-slave-device. This
made me accidentally shrink a 2.5TB device with about 150GB. Needless
to say - that Friday afternoon did not end with the obligatory
weekend-beer-celebration.
Non the less, I think this makes sense from an end user perspective.
Also, there is actually one mention of this on behaviour already at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902171
patchon (1):
Add shrink flag to blockresize command
src/qemu/qemu_driver.c | 15 ++++++++++++++-
tools/virsh-domain.c | 7 +++++++
tools/virsh.pod | 9 ++++++++-
3 files changed, 29 insertions(+), 2 deletions(-)
--
2.23.0
5 years, 1 month
[libvirt] [PATCH 0/2] Fix build with musl libc
by casantos@redhat.com
From: Carlos Santos <casantos(a)redhat.com>
- Do not use 'stderr' as a field name, since it's a preprocessor macro
in stdio.h.
- Include paths.h for _PATH_MOUNTED, if it's not defined in mntent.h.
Found while porting libvirt to Buildroot (https://buildroot.org/).
Carlos Santos (2):
qemu: fix build with musl libc
storage: fix build with musl libc
src/qemu/qemu_process.c | 8 ++++----
src/qemu/qemu_process.h | 2 +-
src/storage/storage_backend_fs.c | 3 +++
src/storage/storage_backend_vstorage.c | 3 +++
4 files changed, 11 insertions(+), 5 deletions(-)
--
2.18.1
5 years, 1 month
[libvirt] [RFC 0/1] convert virStorageSource to GObject
by Daniel Henrique Barboza
I was hoping to quickly re-send the qemu_driver cleanups I've
sent some time ago, now using Glib. I started by attempting to
change the first VIR_AUTOUNREF() call in qemu_driver.c to
g_autoptr(), which happens to be a virStorageSourcePtr type,
then I realized that it wasn't that simple.
Following up the instructions found on commit 16121a88a7, I started
the conversion. Then 'make check' started to fail because some
calls to virObjectRef/virObjectUnref were still remaining
in the code, messing up stuff related with mirrorChain in
qemu_blockjob.c. Turns out it was easier to burn through all the
instances and change them to use GLib.
This is being sent as RFC because x-I am aware that docs/hacking.html
mentions that we shouldn't mix up certain GLib macros with Libvirt
ones, thus I am uncertain of whether I have messed up or not.
'make check' works, did a few sanity checks with libvirtd as
well.
Hopefully this is somewhere near the mark. I intend to do such
convertions from time to time, based on the cleanups I wanted to
make in the qemu_driver file prior to the GLib introduction.
Daniel Henrique Barboza (1):
util: convert virStorageSource class to use GObject
src/conf/domain_conf.c | 13 ++---
src/conf/snapshot_conf.c | 3 +-
src/qemu/qemu_blockjob.c | 43 ++++++--------
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_driver.c | 14 ++---
src/qemu/qemu_hotplug.c | 3 +-
src/qemu/qemu_migration.c | 2 +-
src/storage/storage_backend_gluster.c | 2 +-
src/storage/storage_util.c | 4 +-
src/util/virstoragefile.c | 84 +++++++++++++--------------
src/util/virstoragefile.h | 9 ++-
tests/qemublocktest.c | 6 +-
tests/virstoragetest.c | 12 ++--
13 files changed, 98 insertions(+), 103 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [PATCH v2 0/6] Enable ramfb parameter for mediated devices
by Jonathon Jongsma
This patch series is a continuation of a previous series that was already
mostly merged. The one unmerged patch from the previous series is patch 6 in
this series and has been rebased to git master. The other 5 patches are an
attempt to address some things that Cole suggested in the previous review. I'm
not sure whether I split the patches up too finely or not, but I'm happy to
combine a couple of these patches if requested.
Jonathon Jongsma (6):
qemu: set domain capabilities for ramfb device
qemu: use VIR_AUTOUNREF in qemuDomainDeviceDefValidate()
qemu: fix domain device validation
qemu: consolidate video validation
qemu: unify domain caps validation for video devices
qemu: add 'ramfb' attribute for mediated devices
docs/formatdomain.html.in | 8 +
docs/schemas/domaincommon.rng | 5 +
src/conf/domain_capabilities.c | 17 ++-
src/conf/domain_conf.c | 11 ++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_command.c | 17 ++-
src/qemu/qemu_domain.c | 142 +++++++++---------
src/qemu/qemu_process.c | 62 --------
.../domaincapsschemadata/qemu_3.0.0.s390x.xml | 1 +
.../qemu_3.1.0.x86_64.xml | 1 +
.../qemu_4.0.0.x86_64.xml | 1 +
.../qemu_4.1.0.x86_64.xml | 1 +
.../qemu_4.2.0.x86_64.xml | 1 +
...tdev-mdev-display-ramfb.x86_64-latest.args | 37 +++++
.../hostdev-mdev-display-ramfb.xml | 33 ++++
tests/qemuxml2argvtest.c | 1 +
17 files changed, 203 insertions(+), 138 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-ramfb.xml
--
2.21.0
5 years, 1 month
[libvirt] Fwd: libvirtd failing on MacOS in setgroups
by Marcus Furlong
Resend to libvir-list in case that is more appropriate:
Hi,
I get the following error when running libvirtd on MacOS as root:
2019-07-11 00:12:33.673+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-x86_64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
As a result `virsh capabilities` as root returns nothing:
$ sudo virsh capabilities | grep qemu
<baselabel type='qemu'>+0:+0</baselabel>
whereas running as a regular user works fine:
$ virsh capabilites | grep qemu
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
<domain type='qemu'/>
and by extension, running VMs as regular user works fine via
qemu:///session , but qemu:///system does not work.
It seems like setgroups is failing:
https://github.com/libvirt/libvirt/blob/v5.5.0/src/util/virutil.c#L1045-L...
Is this the expected behaviour?
Full output below:
$ sudo libvirtd
2019-07-11 00:12:33.379+0000: 123145573953536: info : libvirt version: 5.5.0
2019-07-11 00:12:33.379+0000: 123145573953536: warning :
virProcessGetStartTime:1070 : Process start time of pid 49746 not
available on this platform
2019-07-11 00:12:33.379+0000: 123145573953536: error :
virSysinfoReadDMI:1172 : internal error: Failed to find path for
dmidecode binary
2019-07-11 00:12:33.380+0000: 123145573953536: error :
virFileFindHugeTLBFS:3734 : this function is not supported by the
connection driver: virFileFindHugeTLBFS
2019-07-11 00:12:33.382+0000: 123145573953536: warning :
virQEMUCapsInit:919 : Failed to get host CPU cache info
2019-07-11 00:12:33.401+0000: 123145573953536: error :
virHostCPUGetTscInfo:1405 : Probing TSC is not supported on this
platform: Function not implemented
2019-07-11 00:12:33.401+0000: 123145573953536: error : virExec:521 :
Cannot find 'pm-is-supported' in path: No such file or directory
2019-07-11 00:12:33.401+0000: 123145573953536: warning :
virQEMUCapsInit:926 : Failed to get host power management capabilities
2019-07-11 00:12:33.401+0000: 123145573953536: error :
virNumaGetPages:988 : Operation not supported: page info is not
supported on this platform
2019-07-11 00:12:33.401+0000: 123145573953536: warning :
virQEMUCapsInit:933 : Failed to get pages info
2019-07-11 00:12:33.407+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-alpha for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.407+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-alpha: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-alpha for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.413+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-arm for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.413+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-arm: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-arm for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.419+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-arm for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.419+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-arm: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-arm for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.424+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-aarch64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.424+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-aarch64: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-aarch64 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.431+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-cris for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.431+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-cris: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-cris for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.437+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-i386 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.437+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-i386: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-i386 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.443+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-lm32 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.443+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-lm32: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-lm32 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.449+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-m68k for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.449+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-m68k: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-m68k for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.497+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-microblaze for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.497+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-microblaze: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-microblaze for probing:
libvirt: error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.503+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-microblazeel for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.503+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-microblazeel: internal error: Failed to
start QEMU binary /usr/local/bin/qemu-system-microblazeel for probing:
libvirt: error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.509+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-mips for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.509+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-mips: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-mips for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.515+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-mipsel for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.515+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-mipsel: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-mipsel for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.521+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-mips64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.521+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-mips64: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-mips64 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.527+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-mips64el for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.527+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-mips64el: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-mips64el for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.533+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.533+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-ppc: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.571+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc64 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.571+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-ppc64: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc64 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.576+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc64 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.576+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-ppc64: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-ppc64 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.582+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-riscv32 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.582+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-riscv32: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-riscv32 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.588+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-riscv64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.588+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-riscv64: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-riscv64 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.594+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-s390x for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.594+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-s390x: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-s390x for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.600+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sh4 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.600+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-sh4: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sh4 for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.605+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sh4eb for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.605+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-sh4eb: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sh4eb for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.612+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sparc for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.612+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-sparc: internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sparc for probing: libvirt: error :
cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.619+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-sparc64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.619+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-sparc64: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-sparc64 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.667+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-unicore32 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.667+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-unicore32: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-unicore32 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.673+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-x86_64 for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.673+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-x86_64: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-x86_64 for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.679+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-xtensa for probing: libvirt: error
: cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.679+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-xtensa: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-xtensa for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.685+0000: 123145573953536: error :
qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU
binary /usr/local/bin/qemu-system-xtensaeb for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
2019-07-11 00:12:33.685+0000: 123145573953536: warning :
virQEMUCapsLogProbeFailure:4578 : Failed to probe capabilities for
/usr/local/bin/qemu-system-xtensaeb: internal error: Failed to start
QEMU binary /usr/local/bin/qemu-system-xtensaeb for probing: libvirt:
error : cannot set supplemental groups: Invalid argument
--
Marcus Furlong
5 years, 1 month
[libvirt] [PATCH] qemu: fix EFI nvram removal on domain undefine
by Pavel Mores
When undefining a UEFI domain its nvram file has to be properly handled as
well. It's mandatory to use one of --nvram and --keep-nvram options when
'virsh undefine <domain>' is issued for a UEFI domain. To fix the bug as
reported, virsh should return an error message if neither option is used
and the nvram file should be removed when --nvram is given.
The cause of the problem is that when qemuDomainUndefineFlags() is invoked
on an inactive domain the path to its nvram file is empty. This commit
aims to fix this by formatting and filling in the path in time for the
nvram removal code to run properly.
https://bugzilla.redhat.com/show_bug.cgi?id=1751596
Signed-off-by: Pavel Mores <pmores(a)redhat.com>
---
src/qemu/qemu_domain.c | 12 +++++++++---
src/qemu/qemu_domain.h | 4 ++++
src/qemu/qemu_driver.c | 20 +++++++++++++++-----
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 35067c851f..1a0367cc27 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -15441,16 +15441,22 @@ qemuDomainDiskIsMissingLocalOptional(virDomainDiskDefPtr disk)
}
+int
+qemuDomainNVRAMPathFormat(virQEMUDriverConfigPtr cfg,
+ virDomainDefPtr def, char **path)
+{
+ return virAsprintf(path, "%s/%s_VARS.fd", cfg->nvramDir, def->name);
+}
+
int
qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cfg,
virDomainDefPtr def)
{
if (def->os.loader &&
def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
- def->os.loader->readonly == VIR_TRISTATE_SWITCH_ON &&
+ def->os.loader->readonly == VIR_TRISTATE_BOOL_YES &&
!def->os.loader->nvram) {
- return virAsprintf(&def->os.loader->nvram, "%s/%s_VARS.fd",
- cfg->nvramDir, def->name);
+ return qemuDomainNVRAMPathFormat(cfg, def, &def->os.loader->nvram);
}
return 0;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 01a54d4265..07725c7cc4 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1207,6 +1207,10 @@ qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv);
bool
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDefPtr disk);
+int
+qemuDomainNVRAMPathFormat(virQEMUDriverConfigPtr cfg,
+ virDomainDefPtr def, char **path);
+
int
qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cfg,
virDomainDefPtr def);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bc0ede2fb0..dcaadbdb52 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7828,6 +7828,8 @@ qemuDomainUndefineFlags(virDomainPtr dom,
int nsnapshots;
int ncheckpoints;
virQEMUDriverConfigPtr cfg = NULL;
+ char *nvram_path = NULL;
+ bool need_deallocate_nvram_path = false;
virCheckFlags(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE |
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA |
@@ -7905,14 +7907,20 @@ qemuDomainUndefineFlags(virDomainPtr dom,
}
}
- if (vm->def->os.loader &&
- vm->def->os.loader->nvram &&
- virFileExists(vm->def->os.loader->nvram)) {
+ if (vm->def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) {
+ qemuDomainNVRAMPathFormat(cfg, vm->def, &nvram_path);
+ need_deallocate_nvram_path = true;
+ } else {
+ if (vm->def->os.loader)
+ nvram_path = vm->def->os.loader->nvram;
+ }
+
+ if (nvram_path && virFileExists(nvram_path)) {
if ((flags & VIR_DOMAIN_UNDEFINE_NVRAM)) {
- if (unlink(vm->def->os.loader->nvram) < 0) {
+ if (unlink(nvram_path) < 0) {
virReportSystemError(errno,
_("failed to remove nvram: %s"),
- vm->def->os.loader->nvram);
+ nvram_path);
goto endjob;
}
} else if (!(flags & VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)) {
@@ -7948,6 +7956,8 @@ qemuDomainUndefineFlags(virDomainPtr dom,
virDomainObjEndAPI(&vm);
virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
+ if (need_deallocate_nvram_path)
+ VIR_FREE(nvram_path);
return ret;
}
--
2.21.0
5 years, 1 month
[libvirt] [PATCH 0/2] conf: Fix up empty 'network' cdroms
by Peter Krempa
Peter Krempa (2):
conf: Reset disk type if <source> element is completely missing
tests: Add test case for empty 'network' cdrom
src/conf/domain_conf.c | 4 +++
...m-empty-network-invalid.x86_64-latest.args | 34 +++++++++++++++++++
.../disk-cdrom-empty-network-invalid.xml | 30 ++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
...om-empty-network-invalid.x86_64-latest.xml | 34 +++++++++++++++++++
tests/qemuxml2xmloutdata/disk-source-pool.xml | 2 +-
tests/qemuxml2xmltest.c | 1 +
7 files changed, 105 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml
--
2.21.0
5 years, 1 month