[libvirt] [RFC v2 00/16] Add vhost-user-gpu support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This series of patches add support for running a virtio GPU in a
seperate process, using vhost-user.
The QEMU series "[PATCH v4 00/29] vhost-user for input & GPU" is still
under review, and will hopefully land in 3.1. There are several
benefits of running the GPU process in an external process, since Mesa
is rather heavy on the qemu main loop, and may block for a while or
crash. I observe x5 performance improvements with Unigine Heaven 4
benchmark.
The external GPU process is started with one end of the vhost-user
socket pair, the other end is given to a QEMU chardev. It is also
added to the emulator cgroup to restrict its CPU usage.
vhost-user requires shared VM memory. The first patches ease and
improve shared memory setup, by using memfd. They could be considered
seperatly, but that's the setup I'd recommend with vhost-user-gpu.
Review welcome!
RFCv2:
- add new memfd memroyBacking source type
- drop the implicit shared memory NUMA setup approach, explicit now
required
- rebased
Marc-André Lureau (16):
qemu: add memory-backend-memfd capability check
qemu: add memfd memory backing
qemu: add vhost-user-gpu capabilities checks
domain: add "vhost-user" video type
qemu: fill the vhost-user video type capability
qemu: check that qemu is vhost-user-vga capable
qemu: vhost-user is valid as non-primary video device
qemu: validate vhost-user video model
qemu: add qemuSecurityStartVhostUserGPU helper
qemu: add vhost-user-gpu helper unit
qemu: restrict 'virgl=' option to 'virtio' video type
qemu: set default address type on vhost-user video model
qemu: start/stop the vhost-user-gpu external device
qemu: build vhost-user-backend for vhost-user-gpu
qemu: build vhost-user-gpu video device arguments
tests: add vhost-user-gpu xml2argv tests
docs/formatdomain.html.in | 11 +-
docs/schemas/domaincommon.rng | 2 +
src/conf/device_conf.h | 1 +
src/conf/domain_conf.c | 7 +-
src/conf/domain_conf.h | 2 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 135 ++++++--
src/qemu/qemu_domain.c | 8 +-
src/qemu/qemu_domain_address.c | 4 +-
src/qemu/qemu_extdevice.c | 47 ++-
src/qemu/qemu_process.c | 6 +-
src/qemu/qemu_security.c | 48 +++
src/qemu/qemu_security.h | 6 +
src/qemu/qemu_vhost_user_gpu.c | 318 ++++++++++++++++++
src/qemu/qemu_vhost_user_gpu.h | 48 +++
tests/domaincapsschemadata/full.xml | 1 +
.../caps_2.12.0.aarch64.xml | 1 +
.../caps_2.12.0.ppc64.xml | 1 +
.../caps_2.12.0.s390x.xml | 1 +
.../caps_2.12.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
.../caps_3.0.0.riscv32.xml | 1 +
.../caps_3.0.0.riscv64.xml | 1 +
.../caps_3.0.0.x86_64.xml | 1 +
tests/qemuxml2argvdata/memfd-memory-numa.args | 27 ++
tests/qemuxml2argvdata/memfd-memory-numa.xml | 33 ++
.../vhost-user-gpu-secondary.args | 33 ++
.../vhost-user-gpu-secondary.xml | 44 +++
tests/qemuxml2argvdata/vhost-user-vga.args | 30 ++
tests/qemuxml2argvdata/vhost-user-vga.xml | 41 +++
tests/qemuxml2argvtest.c | 15 +
33 files changed, 849 insertions(+), 39 deletions(-)
create mode 100644 src/qemu/qemu_vhost_user_gpu.c
create mode 100644 src/qemu/qemu_vhost_user_gpu.h
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.args
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.xml
--
2.19.0.rc0.48.gb9dfa238d5
6 years, 1 month
[libvirt] [PATCH v2 00/53] implement cgroup v2 support
by Pavel Hrdina
For more information check the kernel documentation [1].
This series implements cgroup v2 support into libvirt without devices,
for that there will be separate series because it uses BPF and it's not
that trivial.
You can get it from my git as well [2].
[1] <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/D...>
[2] <https://github.com/Antique/libvirt/tree/cgroupv2>
Pavel Hrdina (53):
util: introduce cgroup v2 files
vircgroup: introduce virCgroupV2Available
vircgroup: introduce virCgroupV2ValidateMachineGroup
vircgroup: introduce virCgroupV2CopyMounts
vircgroup: introduce virCgroupV2CopyPlacement
vircgroup: introduce virCgroupV2DetectMounts
vircgroup: introduce virCgroupV2DetectPlacement
vircgroup: introduce virCgroupV2ValidatePlacement
vircgroup: introduce virCgroupV2StealPlacement
vircgroup: introduce virCgroupV2DetectControllers
vircgroup: introduce virCgroupV2HasController
vircgroup: introduce virCgroupV2GetAnyController
vircgroup: introduce virCgroupV2PathOfController
vircgroup: introduce virCgroupV2MakeGroup
vircgroup: introduce virCgroupV2Remove
vircgroup: introduce virCgroupV2AddTask
vircgroup: introduce virCgroupV2HasEmptyTasks
vircgroup: introduce virCgroupV2BindMount
vircgroup: introduce virCgroupV2SetOwner
vircgroup: introduce virCgroupV2(Set|Get)BlkioWeight
vircgroup: introduce virCgroupV2GetBlkioIoServiced
vircgroup: introduce virCgroupV2GetBlkioIoDeviceServiced
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceWeight
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceReadIops
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceWriteIops
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceReadBps
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceWriteBps
vircgroup: introduce virCgroupV2SetMemory
vircgroup: introduce virCgroupV2GetMemoryStat
vircgroup: introduce virCgroupV2GetMemoryUsage
vircgroup: introduce virCgroupV2(Set|Get)MemoryHardLimit
vircgroup: introduce virCgroupV2(Set|Get)MemorySoftLimit
vircgroup: introduce virCgroupV2(Set|Get)MemSwapHardLimit
vircgroup: introduce virCgroupV2GetMemSwapUsage
vircgroup: introduce virCgroupV2(Set|Get)CpuShares
vircgroup: introduce virCgroupV2(Set|Get)CpuCfsPeriod
vircgroup: introduce virCgroupV2(Set|Get)CpuCfsQuota
vircgroup: introduce virCgroupV2SupportsCpuBW
vircgroup: introduce virCgroupV2GetCpuacctUsage
vircgroup: introduce virCgroupV2GetCpuacctStat
vircgroup: register cgroup v2 backend
vircgroup: add support for hybrid configuration
vircgroupmock: change cgroup prefix
vircgroupmock: add support to test cgroup v2
vircgrouptest: introduce initFakeFS and cleanupFakeFS helpers
vircgrouptest: prepare testCgroupDetectMounts for cgroup v2
vircgrouptest: add detect mounts test for cgroup v2
vircgrouptest: add detect mounts test for hybrid cgroups
vircgrouptest: prepare validateCgroup for cgroupv2
vircgrouptest: add cgroup v2 tests
vircgrouptest: add hybrid tests
virt-host-validate: rewrite cgroup detection to use util/vircgroup
virt-host-validate: require freezer for LXC
src/Makefile.am | 1 +
src/libvirt_private.syms | 3 +
src/util/Makefile.inc.am | 2 +
src/util/vircgroup.c | 356 +++--
src/util/vircgroupbackend.c | 23 +
src/util/vircgroupbackend.h | 20 +-
src/util/vircgrouppriv.h | 11 +-
src/util/vircgroupv2.c | 1621 +++++++++++++++++++++
src/util/vircgroupv2.h | 27 +
tests/vircgroupdata/all-in-one.parsed | 1 +
tests/vircgroupdata/cgroups1.parsed | 1 +
tests/vircgroupdata/cgroups2.parsed | 1 +
tests/vircgroupdata/cgroups3.parsed | 1 +
tests/vircgroupdata/fedora-18.parsed | 1 +
tests/vircgroupdata/fedora-21.parsed | 1 +
tests/vircgroupdata/hybrid.cgroups | 12 +
tests/vircgroupdata/hybrid.mounts | 23 +
tests/vircgroupdata/hybrid.parsed | 11 +
tests/vircgroupdata/hybrid.self.cgroup | 9 +
tests/vircgroupdata/kubevirt.parsed | 1 +
tests/vircgroupdata/ovirt-node-6.6.parsed | 1 +
tests/vircgroupdata/ovirt-node-7.1.parsed | 1 +
tests/vircgroupdata/rhel-7.1.parsed | 1 +
tests/vircgroupdata/unified.cgroups | 13 +
tests/vircgroupdata/unified.mounts | 20 +
tests/vircgroupdata/unified.parsed | 11 +
tests/vircgroupdata/unified.self.cgroup | 1 +
tests/vircgroupmock.c | 177 ++-
tests/vircgrouptest.c | 191 ++-
tools/virt-host-validate-common.c | 162 +-
tools/virt-host-validate-common.h | 7 +-
tools/virt-host-validate-lxc.c | 41 +-
tools/virt-host-validate-qemu.c | 40 +-
33 files changed, 2450 insertions(+), 342 deletions(-)
create mode 100644 src/util/vircgroupv2.c
create mode 100644 src/util/vircgroupv2.h
create mode 100644 tests/vircgroupdata/hybrid.cgroups
create mode 100644 tests/vircgroupdata/hybrid.mounts
create mode 100644 tests/vircgroupdata/hybrid.parsed
create mode 100644 tests/vircgroupdata/hybrid.self.cgroup
create mode 100644 tests/vircgroupdata/unified.cgroups
create mode 100644 tests/vircgroupdata/unified.mounts
create mode 100644 tests/vircgroupdata/unified.parsed
create mode 100644 tests/vircgroupdata/unified.self.cgroup
--
2.17.1
6 years, 1 month
[libvirt] [PATCH 00/22] syntax-check: Check misaligned stuff and fix them (batch II)
by Shi Lei
This series is batch(II) and it continues to fix misaligned arguments and misaligned
conditions in src directory. The batch I:
https://www.redhat.com/archives/libvir-list/2018-September/msg00888.html
In addition to fix misaligned stuff, this series includes several other jobs:
==========================================
1. Relax the checking-rule for misaligned.
==========================================
In addition to the check-rule in batch I, a new code style is okay:
Linefeed can be put behind the open-parenthesis of the function,
the position of argument should be:
1) pos % 4 == 0
2) pos > start_of_function_name(includes func's parent_pointer)
3) pos is the first place which matches 1) and 2)
E.g.
[indent]if (virLongLongLongFunctionName(
[4-spaces-align]LongLongLongFirstName,
[4-spaces-align]LongLongLongSecondName) < 0)
or
[indent]ret = pointer->virFunctionName(
[4-spaces-align]LongLongLongFirstName,
[4-spaces-align]LongLongLongSecondName);
====================================================
2. Add indicator to help correcting misaligned stuff.
====================================================
The [patch 21/22] definitely indicates the correct position.
===========================================
3. Improve the speed of check-spacing.pl .
===========================================
The [patch 22/22] uses global var, rather than passing arguments
to subroutine. It can be a bit faster.
The benchmark for check-spacing.pl on my PC:
(before batch I ) 1.6s
(before batch II ) 3.3s
(apply this patch) 2.7s
====================================================
# Remaining work after this batch. (for src directory)
====================================================
DIR Misaligned(lines)
esx 334
qemu 227
hyperv 104
lxc 60
conf 76
libxl 69
vbox 65
test 60
security 62
Plan to fix them in two or three weeks.
Shi Lei (22):
access: Fix misaligned arguments
admin: Fix misaligned arguments
bhyve: Fix misaligned arguments and misaligned conditions
cpu: Fix misaligned arguments
interface: Fix misaligned arguments
locking: Fix misaligned arguments
network: Fix misaligned arguments
src:libvirt*.c: Fix misaligned arguments
nwfilter: Fix misaligned arguments and misaligned conditions
phyp: Fix misaligned arguments
remote: Fix misaligned arguments
rpc: Fix misaligned arguments
storage: Fix misaligned arguments and misaligned conditions
uml: Fix misaligned arguments
vmware: Fix misaligned arguments and misaligned conditions
vmx: Fix misaligned arguments
vz: Fix misaligned arguments and misaligned conditions
xenapi: Fix misaligned arguments
xenconfig: Fix misaligned arguments and misaligned conditions
build-aux:check-spacing: Relax the check-rule for misaligned stuff
build-aux:check-spacing: Add indicator to help correcting misaligned
stuff
build-aux:check-spacing: Remove arguments of subroutines for speed
build-aux/check-spacing.pl | 247 +++++++++++----------
src/access/viraccessdriverpolkit.c | 6 +-
src/admin/admin_server.c | 2 +-
src/admin/admin_server_dispatch.c | 4 +-
src/bhyve/bhyve_capabilities.c | 7 +-
src/bhyve/bhyve_command.c | 6 +-
src/bhyve/bhyve_driver.c | 10 +-
src/bhyve/bhyve_monitor.c | 4 +-
src/bhyve/bhyve_parse_command.c | 16 +-
src/bhyve/bhyve_process.c | 6 +-
src/cpu/cpu_ppc64.c | 4 +-
src/cpu/cpu_x86.c | 16 +-
src/interface/interface_backend_udev.c | 102 +++++----
src/libvirt-domain.c | 14 +-
src/libvirt-host.c | 4 +-
src/libvirt-lxc.c | 5 +-
src/libvirt-network.c | 2 +-
src/libvirt-nodedev.c | 4 +-
src/libvirt-storage.c | 13 +-
src/libvirt.c | 4 +-
src/locking/lock_manager.c | 4 +-
src/network/bridge_driver.c | 25 +--
src/nwfilter/nwfilter_dhcpsnoop.c | 10 +-
src/nwfilter/nwfilter_driver.c | 8 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 18 +-
src/nwfilter/nwfilter_learnipaddr.c | 36 ++-
src/phyp/phyp_driver.c | 20 +-
src/remote/remote_daemon.c | 2 +-
src/remote/remote_daemon_dispatch.c | 16 +-
src/remote/remote_driver.c | 31 +--
src/rpc/virnetclient.c | 40 ++--
src/rpc/virnetlibsshsession.c | 2 +-
src/rpc/virnetservermdns.c | 4 +-
src/rpc/virnetsocket.c | 23 +-
src/rpc/virnetsshsession.c | 2 +-
src/storage/storage_backend_disk.c | 7 +-
src/storage/storage_backend_gluster.c | 2 +-
src/storage/storage_backend_iscsi_direct.c | 2 +-
src/storage/storage_backend_rbd.c | 14 +-
src/storage/storage_driver.c | 6 +-
src/storage/storage_util.c | 16 +-
src/uml/uml_driver.c | 50 ++---
src/vmware/vmware_conf.c | 2 +-
src/vmware/vmware_driver.c | 10 +-
src/vmx/vmx.c | 23 +-
src/vz/vz_driver.c | 14 +-
src/vz/vz_sdk.c | 26 ++-
src/vz/vz_utils.c | 2 +-
src/xenapi/xenapi_utils.c | 12 +-
src/xenconfig/xen_common.c | 21 +-
src/xenconfig/xen_xl.c | 23 +-
src/xenconfig/xen_xm.c | 8 +-
52 files changed, 488 insertions(+), 467 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH] rpm: disable some features on riscv64
by Daniel P. Berrangé
numctl, numad and zfs-fuse are not available on riscv64 targets
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
libvirt.spec.in | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 667f89c0b9..90daefe6f1 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -100,13 +100,13 @@
%define with_vbox 0
%endif
-# Numactl is not available on s390[x] and ARM
-%ifarch s390 s390x %{arm}
+# Numactl is not available on many non-x86 archs
+%ifarch s390 s390x %{arm} riscv64
%define with_numactl 0
%endif
# zfs-fuse is not available on some architectures
-%ifarch s390 s390x aarch64
+%ifarch s390 s390x aarch64 riscv64
%define with_storage_zfs 0
%endif
@@ -180,8 +180,8 @@
%if %{with_qemu} || %{with_lxc} || %{with_uml}
# numad is used to manage the CPU and memory placement dynamically,
-# it's not available on s390[x] and ARM.
- %ifnarch s390 s390x %{arm}
+# it's not available on many non-x86 architectures.
+ %ifnarch s390 s390x %{arm} riscv64
%define with_numad 0%{!?_without_numad:1}
%endif
%endif
--
2.17.1
6 years, 1 month
[libvirt] [PATCH 00/53] implement cgroup v2 support
by Pavel Hrdina
For more information check the kernel documentation [1].
This series implements cgroup v2 support into libvirt without devices,
for that there will be separate series because it uses BPF and it's not
that trivial.
You can get it from my git as well [2].
[1] <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/D...>
[2] <https://github.com/Antique/libvirt/tree/cgroupv2>
Pavel Hrdina (53):
util: introduce cgroup v2 files
vircgroup: introduce virCgroupV2Available
vircgroup: introduce virCgroupV2ValidateMachineGroup
vircgroup: introduce virCgroupV2CopyMounts
vircgroup: introduce virCgroupV2CopyPlacement
vircgroup: introduce virCgroupV2DetectMounts
vircgroup: introduce virCgroupV2DetectPlacement
vircgroup: introduce virCgroupV2ValidatePlacement
vircgroup: introduce virCgroupV2StealPlacement
vircgroup: introduce virCgroupV2DetectControllers
vircgroup: introduce virCgroupV2HasController
vircgroup: introduce virCgroupV2GetAnyController
vircgroup: introduce virCgroupV2PathOfController
vircgroup: introduce virCgroupV2MakeGroup
vircgroup: introduce virCgroupV2Remove
vircgroup: introduce virCgroupV2AddTask
vircgroup: introduce virCgroupV2HasEmptyTasks
vircgroup: introduce virCgroupV2BindMount
vircgroup: introduce virCgroupV2SetOwner
vircgroup: register cgroup v2 backend
vircgroup: introduce virCgroupV2SetBlkioWeight
vircgroup: introduce virCgroupV2GetBlkioIoServiced
vircgroup: introduce virCgroupV2GetBlkioIoDeviceServiced
vircgroup: introduce virCgroupV2SetBlkioDeviceWeight
vircgroup: introduce virCgroupV2SetBlkioDeviceReadIops
vircgroup: introduce virCgroupV2SetBlkioDeviceWriteIops
vircgroup: introduce virCgroupV2SetBlkioDeviceReadBps
vircgroup: introduce virCgroupV2SetBlkioDeviceWriteBps
vircgroup: introduce virCgroupV2SetMemory
vircgroup: introduce virCgroupV2GetMemoryStat
vircgroup: introduce virCgroupV2GetMemoryUsage
vircgroup: introduce virCgroupV2SetMemoryHardLimit
vircgroup: introduce virCgroupV2SetMemorySoftLimit
vircgroup: introduce virCgroupV2SetMemSwapHardLimit
vircgroup: introduce virCgroupV2GetMemSwapUsage
vircgroup: introduce virCgroupV2SetCpuShares
vircgroup: introduce virCgroupV2SetCpuCfsPeriod
vircgroup: introduce virCgroupV2SetCpuCfsQuota
vircgroup: introduce virCgroupV2SupportsCpuBW
vircgroup: introduce virCgroupV2GetCpuacctUsage
vircgroup: introduce virCgroupV2GetCpuacctStat
vircgroup: add support for hybrid configuration
vircgroupmock: change cgroup prefix
vircgroupmock: add support to test cgroup v2
vircgrouptest: introduce initFakeFS and cleanupFakeFS helpers
vircgrouptest: prepare testCgroupDetectMounts for cgroup v2
vircgrouptest: add detect mounts test for cgroup v2
vircgrouptest: add detect mounts test for hybrid cgroups
vircgrouptest: prepare validateCgroup for cgroupv2
vircgrouptest: add cgroup v2 tests
vircgrouptest: add hybrid tests
virt-host-validate: rewrite cgroup detection to use util/vircgroup
virt-host-validate: require freezer for LXC
src/Makefile.am | 1 +
src/libvirt_private.syms | 3 +
src/util/Makefile.inc.am | 2 +
src/util/vircgroup.c | 356 +++--
src/util/vircgroupbackend.c | 23 +
src/util/vircgroupbackend.h | 20 +-
src/util/vircgrouppriv.h | 11 +-
src/util/vircgroupv2.c | 1615 +++++++++++++++++++++
src/util/vircgroupv2.h | 27 +
tests/vircgroupdata/all-in-one.parsed | 1 +
tests/vircgroupdata/cgroups1.parsed | 1 +
tests/vircgroupdata/cgroups2.parsed | 1 +
tests/vircgroupdata/cgroups3.parsed | 1 +
tests/vircgroupdata/fedora-18.parsed | 1 +
tests/vircgroupdata/fedora-21.parsed | 1 +
tests/vircgroupdata/hybrid.cgroups | 12 +
tests/vircgroupdata/hybrid.mounts | 23 +
tests/vircgroupdata/hybrid.parsed | 11 +
tests/vircgroupdata/hybrid.self.cgroup | 9 +
tests/vircgroupdata/kubevirt.parsed | 1 +
tests/vircgroupdata/ovirt-node-6.6.parsed | 1 +
tests/vircgroupdata/ovirt-node-7.1.parsed | 1 +
tests/vircgroupdata/rhel-7.1.parsed | 1 +
tests/vircgroupdata/unified.cgroups | 13 +
tests/vircgroupdata/unified.mounts | 20 +
tests/vircgroupdata/unified.parsed | 11 +
tests/vircgroupdata/unified.self.cgroup | 1 +
tests/vircgroupmock.c | 169 ++-
tests/vircgrouptest.c | 191 ++-
tools/virt-host-validate-common.c | 162 +--
tools/virt-host-validate-common.h | 7 +-
tools/virt-host-validate-lxc.c | 41 +-
tools/virt-host-validate-qemu.c | 40 +-
33 files changed, 2436 insertions(+), 342 deletions(-)
create mode 100644 src/util/vircgroupv2.c
create mode 100644 src/util/vircgroupv2.h
create mode 100644 tests/vircgroupdata/hybrid.cgroups
create mode 100644 tests/vircgroupdata/hybrid.mounts
create mode 100644 tests/vircgroupdata/hybrid.parsed
create mode 100644 tests/vircgroupdata/hybrid.self.cgroup
create mode 100644 tests/vircgroupdata/unified.cgroups
create mode 100644 tests/vircgroupdata/unified.mounts
create mode 100644 tests/vircgroupdata/unified.parsed
create mode 100644 tests/vircgroupdata/unified.self.cgroup
--
2.17.1
6 years, 1 month
[libvirt] [PATCH] qemu: fix comment in qemuSecurityChownCallback
by Ján Tomko
s/chmod/chown/
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b238309852..ef87a6ef05 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -287,7 +287,7 @@ qemuSecurityChownCallback(const virStorageSource *src,
return rv;
if (virStorageSourceIsLocalStorage(src)) {
- /* use direct chmod for local files so that the file doesn't
+ /* use direct chown for local files so that the file doesn't
* need to be initialized */
if (!src->path)
return 0;
--
2.16.4
6 years, 1 month
[libvirt] domain XML for tracking libosinfo ID
by Cole Robinson
Right now in virt-manager we only track a VM's OS name (win10, fedora28,
etc.) during the VM install phase. This piece of data is important
post-install though: if the user adds a new disk to the VM later, we
want to be able to ask libosinfo about what devices the installed OS
supports, so we can set optimal defaults, like enabling virtio.
There isn't any standard libvirt XML field to track this kind of info
though, so apps have to invent their own schema. nova and rhev do it
indirectly AFAICT. gnome-boxes does it directly with XML like this:
<metadata>
<boxes:gnome-boxes xmlns:boxes="https://wiki.gnome.org/Apps/Boxes">
<os-id>http://fedoraproject.org/fedora/28</os-id>
....
</boxes:gnome-boxes>
</metadata>
I want to add something similar to virt-manager but it seems a shame to
invent our own private schema for something that most non-trivial virt
apps will want to know about. I was thinking a schema we could document
with libosinfo, something like
<metadata>
<libosinfo
xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<os-id>http://fedoraproject.org/fedora/28</os-id>
</libosinfo>
</metadata>
FWIW there's an oooold bug about possible tracking something like this
in the domain XML as a first class citizen:
https://bugzilla.redhat.com/show_bug.cgi?id=509164
But I think nowadays that's a bad fit and is likely off the table
Thoughts?
- Cole
6 years, 1 month
[libvirt] [PATCH v3 0/6] BaselineHypervisorCPU using QEMU QMP exchanges
by Chris Venteicher
Some architectures (S390) depend on QEMU to compute baseline CPU model and
expand a models feature set.
Interacting with QEMU requires starting the QEMU process and completing one or
more query-cpu-model-baseline QMP exchanges with QEMU in addition to a
query-cpu-model-expansion QMP exchange to expand all features in the model.
See "s390x CPU models: exposing features" patch set on Qemu-devel for discussion
of QEMU aspects.
This is part of resolution of: https://bugzilla.redhat.com/show_bug.cgi?id=1511999
Version 3 attempts to address all issues from V1 and V2 including making the
QEMU process activation for QMP Queries generic (not specific to capabilities)
and moving that code from qemu_capabilities to qemu_process.
I attempted to make the new qemu_process functions consistent with the functions
but mostly ended up reusing the guts of the previous functions from qemu_capabilities.
Of interest may be the choice to reuse a domain structure to hold the Qmp Query
process state and connection information. Also, pay attention to the use of a large
random number to uniquely identify decoupled processes in terms of sockets and
file system footprint. If you believe it's worth the effort I think there are some
pre-existing library functions to establish files with unique identifiers in a
thread safe way.
The last patch may also be interesting and is based on past discussion of QEMU cpu
expansion only returning migratable features except for one x86 case where
non-migratable features are explicitly requested. The patch records that features
are migratable based on QEMU only returning migratable features. The main result
is the CPU xml for S390 CPU's contains the same migratability info the X86 currently
does. The testcases were updated to reflect the change. Is this ok?
Unlike the previous versions every patch should compile independently if applied
in sequence.
Thanks,
Chris
Chris Venteicher (6):
qemu_monitor: Introduce qemuMonitorCPUModelInfoNew
qemu_monitor: Introduce qemuMonitorCPUModelInfo / JSON conversion
qemu_monitor: qemuMonitorGetCPUModelExpansion inputs and outputs
CPUModelInfo
qemu_process: Use common processes mgmt funcs for all QMP query types
qemu_driver: BaselineHypervisorCPU support for S390
qemu_monitor: Default props to migratable when expanding cpu model
src/qemu/qemu_capabilities.c | 559 ++++++++----------
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_driver.c | 143 ++++-
src/qemu/qemu_monitor.c | 199 ++++++-
src/qemu/qemu_monitor.h | 29 +-
src/qemu/qemu_monitor_json.c | 210 +++++--
src/qemu/qemu_monitor_json.h | 13 +-
src/qemu/qemu_process.c | 398 +++++++++++++
src/qemu/qemu_process.h | 35 ++
tests/cputest.c | 11 +-
.../caps_2.10.0.s390x.xml | 60 +-
.../caps_2.11.0.s390x.xml | 58 +-
.../caps_2.12.0.s390x.xml | 56 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 32 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 34 +-
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 64 +-
tests/qemucapabilitiestest.c | 7 +
17 files changed, 1375 insertions(+), 537 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH v3 0/5] libxl: PVHv2 support
by Marek Marczykowski-Górecki
This is a respin of my old PVHv1 patch[1], converted to PVHv2.
Should the code use "PVH" name (as libxl does internally), or "PVHv2" as in
many places in Xen documentation? I've chosen the former, but want to confirm
it.
Also, not sure about VIR_DOMAIN_OSTYPE_XENPVH (as discussed on PVHv1 patch) -
while it will be messy in many cases, there is
libxl_domain_build_info.u.{hvm,pv,pvh} which would be good to not mess up.
Also, PVHv2 needs different kernel features than PV (CONFIG_XEN_PVH vs
CONFIG_XEN_PV), so keeping the same VIR_DOMAIN_OSTYPE_XEN could be
confusing.
On the other hand, libxl_domain_build_info.u.pv is used in very few places (one
section of libxlMakeDomBuildInfo), so guarding u.hvm access with
VIR_DOMAIN_OSTYPE_HVM may be enough.
For now I've reused VIR_DOMAIN_OSTYPE_XEN - in the driver itself, most of
the code is the same as for PV.
Since PVHv2 relies on features in newer Xen versions, I needed to convert also
some older code. For example b_info->u.hvm.nested_hvm was deprecated in favor
of b_info->nested_hvm. While the code do handle both old and new versions
(obviously refusing PVHv2 if Xen is too old), this isn't the case for tests.
How it should be handled, if at all?
First few preparatory patches can be applied independently.
[1] https://www.redhat.com/archives/libvir-list/2016-August/msg00376.html
Changes in v2:
- drop "docs: don't refer to deprecated 'linux' ostype in example" patch -
migrating further away from "linux" os type is offtopic to this series and
apparently is a controversial thing
- drop "docs: update domain schema for machine attribute" patch -
already applied
- apply review comments from Jim
- rebase on master
Changes in v3:
- rebase on master, drop already applied patches
- use #ifdef LIBXL_DOMAIN_TYPE_PVH to detect PVH support, fix compilation
failure on older Xen
- exclude PVH from VIR_DOMAIN_OSTYPE_XEN <-> VIR_DOMAIN_OSTYPE_LINUX conversion
- fix reported capabilities for PVH
Marek Marczykowski-Górecki (5):
libxl: reorder libxlMakeDomBuildInfo for upcoming PVH support
libxl: add support for PVH
tests: add basic Xen PVH test
xenconfig: add support for parsing type= xl config entry
xenconfig: add support for type="pvh"
docs/formatcaps.html.in | 4 +-
docs/schemas/domaincommon.rng | 1 +-
src/conf/domain_conf.c | 6 +-
src/libxl/libxl_capabilities.c | 47 +++++++++++---
src/libxl/libxl_conf.c | 76 ++++++++++++++++------
src/libxl/libxl_driver.c | 6 +-
src/xenconfig/xen_common.c | 27 ++++++--
src/xenconfig/xen_xl.c | 5 +-
tests/libxlxml2domconfigdata/basic-pvh.json | 49 ++++++++++++++-
tests/libxlxml2domconfigdata/basic-pvh.xml | 28 ++++++++-
tests/libxlxml2domconfigtest.c | 3 +-
tests/testutilsxen.c | 3 +-
tests/xlconfigdata/test-fullvirt-type.cfg | 21 ++++++-
tests/xlconfigdata/test-fullvirt-type.xml | 27 ++++++++-
tests/xlconfigdata/test-paravirt-type.cfg | 13 ++++-
tests/xlconfigdata/test-paravirt-type.xml | 25 +++++++-
tests/xlconfigdata/test-pvh-type.cfg | 13 ++++-
tests/xlconfigdata/test-pvh-type.xml | 25 +++++++-
tests/xlconfigtest.c | 3 +-
19 files changed, 346 insertions(+), 36 deletions(-)
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.json
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.xml
create mode 100644 tests/xlconfigdata/test-fullvirt-type.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-type.xml
create mode 100644 tests/xlconfigdata/test-paravirt-type.cfg
create mode 100644 tests/xlconfigdata/test-paravirt-type.xml
create mode 100644 tests/xlconfigdata/test-pvh-type.cfg
create mode 100644 tests/xlconfigdata/test-pvh-type.xml
base-commit: 199eee6aae7af3d813fbe98660c7e0fa1a8ae7b7
--
git-series 0.9.1
6 years, 1 month
[libvirt] [RFC] cgroup settings and systemd daemon-reload conflict
by Nikolay Shirokovskiy
Hi, all.
It turns out that systemd daemon-reload reset settings that are managable
thru 'systemctl set-property' interface.
> virsh schedinfo tst3 | grep global_quota
global_quota : -1
> virsh schedinfo tst3 --set global_quota=50000 | grep global_quota
global_quota : 50000
> systemctl daemon-reload
> virsh schedinfo tst3 | grep global_quota
global_quota : -1
This behaviour does not limited to cpu controller, same for blkio for example.
I checked different versions of systemd (219 - Feb 15, and quite recent 236 - Dec 17)
to make sure it is not kind of bug of old version. So systemd does not play well
with direct writes to cgroup parameters that managable thru systemd. Looks like
libvirtd needs to use systemd's dbus interface to change all such parameters.
I only wonder how this can be unnoticed for such long time (creating cgroup for domain
thru systemd - Jul 2013) as daemon-reload is called upon libvirtd package update. May
be I miss something?
Nikolay
6 years, 1 month