[PATCH v3 1/1] rpc: avoid crash when system time jump back

2021-02-09 Thread BiaoxiangYe
From: BiaoXiang Ye Setting the system time backward would lead to a multiplication overflow in function virKeepAliveStart. The function virKeepAliveTimerInternal got the same bug too. Backtrace below: #0 0xae898470 in raise () from /usr/lib64/libc.so.6 #1 0xae89981c in

[PATCH v3 0/1] rpc: avoid crash when system time jump back

2021-02-09 Thread BiaoxiangYe
From: BiaoXiang Ye use G_USEC_PER_SEC instead of self-defining macro v2: - using monotonic timer instead of detecting a jump backwards BiaoXiang Ye (1): rpc: avoid crash when system time jump back src/rpc/virkeepalive.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-)

Re: tpm-tis device for ARM virt

2021-02-09 Thread Jim Fehlig
On 2/9/21 2:20 AM, Andrea Bolognani wrote: On Mon, 2021-02-08 at 17:30 -0700, Jim Fehlig wrote: Hi All, I received a private bug report that starting a VM with swtpm device fails with qemu-system-aarch64. The VM config has QEMU reports the following error error:

[PATCH] build: Remove unused 'conflicts' key from virt_daemon_unit

2021-02-09 Thread Jim Fehlig
The 'conflict' key in a virt_daemon_unit dictionary is not used when generating systemd service and socket files. The comment associated with the key claims the default is 'true', and a few build files needlessly set it to 'true' when defining their virt_daemon_unit. Remove the 'conflict' key and

Re: [PATCH v2 1/2] rpc: avoid crash when system time jump back

2021-02-09 Thread Jonathon Jongsma
On Tue, 9 Feb 2021 09:19:47 + BiaoxiangYe wrote: > From: BiaoXiang Ye > > Setting the system time backward would lead to a > multiplication overflow in function virKeepAliveStart. > The function virKeepAliveTimerInternal got the same bug too. > > Backtrace below: > #0

Re: generation of virtproxd socket files

2021-02-09 Thread Jim Fehlig
On 2/9/21 6:56 AM, Martin Kletzander wrote: On Mon, Feb 08, 2021 at 04:09:16PM -0700, Jim Fehlig wrote: Hi All, Thanks to everyone for the hints! I received a report [1] and verified that virtproxyd*.socket files have broken syntax. E.g. from virtproxyd.socket [Unit] Description=Libvirt

Re: [PATCH] Rework qemuMigrationDstPrecreateDisk()

2021-02-09 Thread Jonathon Jongsma
On Sat, 6 Feb 2021 11:11:11 +0800 Yi Li wrote: > 'conn' vairable which are used only inside the func. Let's declare > inside the func body to make that obvious. > Use g_autofree to allow removal of 'cleanup:' and the 'ret' variable. It may be worth referencing the commit that introduced this

[PATCH] build: Fix generation of virtproxyd socket files

2021-02-09 Thread Jim Fehlig
The various virtproxyd socket files are generated with invalid syntax, e.g. from virtproxyd.socket [Unit] Description=Libvirt proxy local socket Before=virtproxyd.service libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tcp.socket libvirtd-tls.socket Note the missing

Re: [PATCH] build: Fix generation of virtproxyd socket files

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 10:50:31AM -0700, Jim Fehlig wrote: > The various virtproxyd socket files are generated with invalid syntax, > e.g. from virtproxyd.socket > > [Unit] > Description=Libvirt proxy local socket > Before=virtproxyd.service > libvirtd.socket libvirtd-ro.socket

Re: [PATCH 0/2] Fix two memleaks in virQEMUCapsLoadMachines()

2021-02-09 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: *** BLURB HERE *** Michal Prívozník (2): qemu_capabilities: Don't leak @str in virQEMUCapsLoadMachines() qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly src/qemu/qemu_capabilities.c | 9 +++-- 1 file changed, 7

Re: [PATCH 00/12] vsh: Improve completer code

2021-02-09 Thread Jonathon Jongsma
On Thu, 4 Feb 2021 15:13:25 +0100 Michal Privoznik wrote: > There is no functional change to completion. No user visible change, > nor to a developer who writes a completer callback. Some code > deduplication and code cleanup and adapting code to 2021. > > Michal Prívozník (12): > lib:

Re: [libvirt PATCH 5/5] qemu: wire up support for maximum CPU model

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 05:33:28PM +0100, Pavel Hrdina wrote: > On Tue, Feb 09, 2021 at 01:59:01PM +, Daniel P. Berrangé wrote: > > The "max" model can be treated the same way as "host" model in general. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > 94 files changed, 431

Re: [libvirt PATCH 4/5] qemu: probe for "-cpu max" support

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 04:25:06PM +, Daniel P. Berrangé wrote: > On Tue, Feb 09, 2021 at 05:23:35PM +0100, Pavel Hrdina wrote: > > On Tue, Feb 09, 2021 at 01:59:00PM +, Daniel P. Berrangé wrote: > > > This is a special CPU model similar to "-cpu host", so won't use our > > > normal CPU

Re: [libvirt PATCH 5/5] qemu: wire up support for maximum CPU model

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 01:59:01PM +, Daniel P. Berrangé wrote: > The "max" model can be treated the same way as "host" model in general. > > Signed-off-by: Daniel P. Berrangé > --- > 94 files changed, 431 insertions(+), 73 deletions(-) > > diff --git a/src/qemu/qemu_capabilities.c

Re: [PATCH 09/12] vsh: Deduplicate filtering in vshReadlineCommandGenerator()

2021-02-09 Thread Jonathon Jongsma
On Thu, 4 Feb 2021 15:13:34 +0100 Michal Privoznik wrote: > This is what we do for completer callbacks: we let them generate > all possible outputs ignoring any partial input (e.g. prefix of a > domain name) and then use vshCompleterFilter() to filter out > those strings which don't fit the

Re: [libvirt PATCH 4/5] qemu: probe for "-cpu max" support

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 05:23:35PM +0100, Pavel Hrdina wrote: > On Tue, Feb 09, 2021 at 01:59:00PM +, Daniel P. Berrangé wrote: > > This is a special CPU model similar to "-cpu host", so won't use our > > normal CPU model detection logic. > > > > Signed-off-by: Daniel P. Berrangé > > --- > >

Re: [libvirt PATCH 4/5] qemu: probe for "-cpu max" support

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 01:59:00PM +, Daniel P. Berrangé wrote: > This is a special CPU model similar to "-cpu host", so won't use our > normal CPU model detection logic. > > Signed-off-by: Daniel P. Berrangé > --- > src/qemu/qemu_capabilities.c | 11 +++ >

Re: [libvirt PATCH 0/9] fix cgroups on systemd hosts

2021-02-09 Thread Michal Privoznik
On 2/9/21 2:26 PM, Pavel Hrdina wrote: When running on host with systemd there is an ownership issue of the root VM cgroup. When it is created for us by systemd using machined the owner of the root VM cgroup is systemd and we should not touch any of the files as systemd can and will modify any

[libvirt PATCH v2 2/6] qemu: record deprecation messages against the domain

2021-02-09 Thread Daniel P . Berrangé
These messages are only valid while the domain is running. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_domain.c | 5 + src/qemu/qemu_process.c | 5 + 2 files changed, 10 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0f09e321fb..d362764060

[libvirt PATCH v2 4/6] remote: add RPC support for the virDomainGetMessages API

2021-02-09 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/remote/remote_daemon_dispatch.c | 45 + src/remote/remote_driver.c | 44 src/remote/remote_protocol.x| 21 +- src/remote_protocol-structs | 11 +++ 4 files

[libvirt PATCH v2 1/6] conf: record deprecation messages against the domain

2021-02-09 Thread Daniel P . Berrangé
These messages will be stored in the live status XML. Signed-off-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 28 +--- src/conf/domain_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) diff --git

[libvirt PATCH v2 5/6] qemu: implement virDomainGetMessages API

2021-02-09 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 17 src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.h | 3 +++ src/qemu/qemu_driver.c | 58 5 files changed, 81 insertions(+) diff

[libvirt PATCH v2 3/6] src: define virDomainGetMessages API

2021-02-09 Thread Daniel P . Berrangé
This API allows fetching a list of informational messages recorded against the domain. This provides a way to give information about tainting of the guest due to undesirable actions/configs, as well as provide details of deprecated features. The output of this API is explicitly targetted at

[libvirt PATCH v2 6/6] tools: report messages for 'dominfo' command

2021-02-09 Thread Daniel P . Berrangé
$ virsh dominfo demo Id: 2 Name: demo UUID: eadf8ef0-bf14-4c5f-9708-4a19bacf9e81 OS Type:hvm State: running CPU(s): 2 CPU time: 15.8s Max memory: 1536000 KiB Used memory:1536000 KiB Persistent: yes Autostart: disable

[libvirt PATCH v2 0/6] APIs for reporting tainting and deprecation messages

2021-02-09 Thread Daniel P . Berrangé
This is a follow up to https://listman.redhat.com/archives/libvir-list/2021-January/msg00988.html I pushed the first non-API parts of that series already. This posting takes a different approach to the APIs. Instead of separte APIs for tainting and deprecations, there is now one API for

Re: [PATCH 08/12] vsh: Deduplicate filtering in vshReadlineOptionsGenerator()

2021-02-09 Thread Jonathon Jongsma
On Thu, 4 Feb 2021 15:13:33 +0100 Michal Privoznik wrote: > This is what we do for completer callbacks: we let them generate > all possible outputs ignoring any partial input (e.g. prefix of a > domain name) and then use vshCompleterFilter() to filter out > those strings which don't fit the

Re: [PATCH 2/2] qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 04:42:38PM +0100, Michal Privoznik wrote: > A element can have "deprecated" attribute that > corresponds to 'deprecated' member of _virQEMUCapsMachineType > struct. But the member is of boolean type. Therefore, the string > returned by virXMLPropString() must be freed. >

[PATCH 2/2] qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly

2021-02-09 Thread Michal Privoznik
A element can have "deprecated" attribute that corresponds to 'deprecated' member of _virQEMUCapsMachineType struct. But the member is of boolean type. Therefore, the string returned by virXMLPropString() must be freed. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 6

[PATCH 1/2] qemu_capabilities: Don't leak @str in virQEMUCapsLoadMachines()

2021-02-09 Thread Michal Privoznik
If parsing "maxCpus" attribute of element fails an error is printed but the corresponding string is not freed. While it is very unlikely to happen (parsed XML is not user provided and we are the ones generating it), it is possible. Instead of freeing the variable in the error path explicitly,

[PATCH 0/2] Fix two memleaks in virQEMUCapsLoadMachines()

2021-02-09 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): qemu_capabilities: Don't leak @str in virQEMUCapsLoadMachines() qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly src/qemu/qemu_capabilities.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.26.2

Re: [PATCH 07/40] util: Add helpers for auto-freeing GSList filled with strings

2021-02-09 Thread Michal Privoznik
On 2/9/21 3:48 PM, Peter Krempa wrote: On Tue, Feb 09, 2021 at 15:22:40 +0100, Michal Privoznik wrote: On 2/6/21 9:32 AM, Peter Krempa wrote: glib's 'g_autoslist()' doesn't support lists of 'char *' strings. Add a type alias 'virGSListString' so that we can register an 'autoptr' function for

Re: [PATCH 07/40] util: Add helpers for auto-freeing GSList filled with strings

2021-02-09 Thread Peter Krempa
On Tue, Feb 09, 2021 at 15:22:40 +0100, Michal Privoznik wrote: > On 2/6/21 9:32 AM, Peter Krempa wrote: > > glib's 'g_autoslist()' doesn't support lists of 'char *' strings. Add a > > type alias 'virGSListString' so that we can register an 'autoptr' > > function for it for simple usage of GSList

Re: [PATCH 31/40] Replace virStringListLength where actual lenght is not needed

2021-02-09 Thread Ján Tomko
On a Saturday in 2021, Peter Krempa wrote: Some callers don't need to know the actual lenght of the list but only s/lenght/length/ here and in the commit summary Jano care whether the required element is present or the list is non-empty. Don't calculate the list length in those cases.

Re: [libvirt PATCH 3/5] cpu: wire up support for maximum CPU mode

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 01:58:59PM +, Daniel P. Berrangé wrote: > The logic applied in the ppc64 case isn't quite correct, as the > interpretation of maximum mode depends on whether hardware virt > is used or not. This is information the CPU driver doesn't have. > > Signed-off-by: Daniel P.

Re: [libvirt PATCH 2/5] conf: add reporting of "maximum" CPU mode in domain caps

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 01:58:58PM +, Daniel P. Berrangé wrote: > The data reported is the same as for "host-passthrough" > > Signed-off-by: Daniel P. Berrangé > --- > docs/formatdomaincaps.html.in | 6 ++ > docs/schemas/domaincaps.rng | 13

Re: [PATCH 07/40] util: Add helpers for auto-freeing GSList filled with strings

2021-02-09 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: On 2/6/21 9:32 AM, Peter Krempa wrote: glib's 'g_autoslist()' doesn't support lists of 'char *' strings. Add a type alias 'virGSListString' so that we can register an 'autoptr' function for it for simple usage of GSList with strings. Signed-off-by:

Re: [PATCH 06/40] qemuNamespaceUnlinkPaths: Fix inconsistent cleanup handling

2021-02-09 Thread Ján Tomko
On a Saturday in 2021, Peter Krempa wrote: Some code paths return -1 directly while others jump to 'cleanup' which cleans the list of mounts. Since qemuDomainGetPreservedMounts now returns a NULL-terminated list, convert devMountsPath to g_auto(GStrv) and remove the cleanup altoghether;

Re: [libvirt PATCH 1/5] conf: define a new "maximum" CPU mode

2021-02-09 Thread Pavel Hrdina
On Tue, Feb 09, 2021 at 01:58:57PM +, Daniel P. Berrangé wrote: > For hardware virtualization this is functionally identical to the > existing host-passthrough mode so the same caveats apply. > > For emulated guest this exposes the maximum featureset supported by > the emulator. Note that

Re: [libvirt PATCH 5/5] qemu: wire up support for maximum CPU model

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 02:21:32PM +, Richard W.M. Jones wrote: > > Patch series looks fine to me, and we can certainly use this feature. > > One question I have about it: Does this apply to all architectures > equally, or will we need to detect it from capabilities? I mean to > say, if

Re: [libvirt PATCH 2/5] conf: add reporting of "maximum" CPU mode in domain caps

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 02:19:21PM +, Richard W.M. Jones wrote: > On Tue, Feb 09, 2021 at 01:58:58PM +, Daniel P. Berrangé wrote: > > +mode name='maximum' supported='yes' > > + enum name='maximumMigratable' > > +valueon/value > > +valueoff/value > > + /enum >

Re: [PATCH 08/40] qemu: namespace: Don't use 'virStringListAdd' inside loops

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: 'virStringListAdd' calculates the string list length on every invocation so constructing a string list using it results in O(n^2) complexity. Use a GSList which has cheap insertion and iteration and doesn't need failure handling. Signed-off-by: Peter

Re: [PATCH 01/40] qemuMonitorJSONObjectProperty: Make 'str' member const

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: The code only reads it. Is that so? qemuMonitorJSONGetObjectProperty() strdup()-s into ->str. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 07/40] util: Add helpers for auto-freeing GSList filled with strings

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: glib's 'g_autoslist()' doesn't support lists of 'char *' strings. Add a type alias 'virGSListString' so that we can register an 'autoptr' function for it for simple usage of GSList with strings. Signed-off-by: Peter Krempa --- src/libvirt_private.syms |

Re: [PATCH 15/40] qemu: Convert 'priv->dbusVMStateIds' to a GSList

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: The conversion removes the use of virStringListAdd/virStringListRemove which try to add dynamic properties to a string list which is really inefficient. Storing the dbus VMState ids in a GSList is pretty straightforward and the slightly increased

Re: [PATCH 29/40] qemufirmwaretest: Base iteration on string lists

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: Remove the need to calculate list lengths. Signed-off-by: Peter Krempa --- tests/qemufirmwaretest.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c index

Re: [PATCH 00/40] Replace various string helpers (and fixes for surrounding code)

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: This series mainly focuses on removal of virStringListAdd which tries to promote the use of a string list without counter variable as a dynamic array. This means that every operation counts the number of elements and when used in a loop resutls in O(n^2)

Re: [PATCH 30/40] qemuvhostusertest: Base iteration on string lists

2021-02-09 Thread Michal Privoznik
On 2/6/21 9:32 AM, Peter Krempa wrote: Remove the need to calculate list lengths. Signed-off-by: Peter Krempa --- tests/qemuvhostusertest.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qemuvhostusertest.c b/tests/qemuvhostusertest.c

Re: [libvirt PATCH 5/5] qemu: wire up support for maximum CPU model

2021-02-09 Thread Richard W.M. Jones
Patch series looks fine to me, and we can certainly use this feature. One question I have about it: Does this apply to all architectures equally, or will we need to detect it from capabilities? I mean to say, if this was added to libvirt version X, then I might mandate that you have to use

Re: [libvirt PATCH 2/5] conf: add reporting of "maximum" CPU mode in domain caps

2021-02-09 Thread Richard W.M. Jones
On Tue, Feb 09, 2021 at 01:58:58PM +, Daniel P. Berrangé wrote: > +mode name='maximum' supported='yes' > + enum name='maximumMigratable' > +valueon/value > +valueoff/value > + /enum > +/mode > mode name='host-model' supported='yes' Hmmm - that

[libvirt PATCH 4/5] qemu: probe for "-cpu max" support

2021-02-09 Thread Daniel P . Berrangé
This is a special CPU model similar to "-cpu host", so won't use our normal CPU model detection logic. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c | 11 +++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 12 insertions(+) diff --git

[libvirt PATCH 5/5] qemu: wire up support for maximum CPU model

2021-02-09 Thread Daniel P . Berrangé
The "max" model can be treated the same way as "host" model in general. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c| 17 - src/qemu/qemu_command.c | 10 +++--- src/qemu/qemu_domain.c

[libvirt PATCH 2/5] conf: add reporting of "maximum" CPU mode in domain caps

2021-02-09 Thread Daniel P . Berrangé
The data reported is the same as for "host-passthrough" Signed-off-by: Daniel P. Berrangé --- docs/formatdomaincaps.html.in | 6 ++ docs/schemas/domaincaps.rng | 13 + src/conf/domain_capabilities.c| 15

[libvirt PATCH 3/5] cpu: wire up support for maximum CPU mode

2021-02-09 Thread Daniel P . Berrangé
The logic applied in the ppc64 case isn't quite correct, as the interpretation of maximum mode depends on whether hardware virt is used or not. This is information the CPU driver doesn't have. Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu.c | 3 ++- src/cpu/cpu_ppc64.c | 10

[libvirt PATCH 0/5] qemu: support "max" CPU model

2021-02-09 Thread Daniel P . Berrangé
QEMU has supported a "max" CPU model for many releases now, but somehow we never got it wired up into libvirt. "max" is useful for applications which don't care about live migration and just want the best CPU model possible. Normally "host" would be used but this only works for KVM. "max" is

[libvirt PATCH 1/5] conf: define a new "maximum" CPU mode

2021-02-09 Thread Daniel P . Berrangé
For hardware virtualization this is functionally identical to the existing host-passthrough mode so the same caveats apply. For emulated guest this exposes the maximum featureset supported by the emulator. Note that despite being emulated this is not guaranteed to be migration safe, especially if

Re: generation of virtproxd socket files

2021-02-09 Thread Martin Kletzander
On Mon, Feb 08, 2021 at 04:09:16PM -0700, Jim Fehlig wrote: Hi All, I received a report [1] and verified that virtproxyd*.socket files have broken syntax. E.g. from virtproxyd.socket [Unit] Description=Libvirt proxy local socket Before=virtproxyd.service libvirtd.socket libvirtd-ro.socket

[libvirt PATCH 6/9] vircgroupv2: move task into cgroup before enabling controllers

2021-02-09 Thread Pavel Hrdina
When we create a new child cgroup and the parent cgroup has any process attached to it enabling controllers for the child cgroup fails with error. We need to move the process into the child cgroup first before enabling any controllers. Signed-off-by: Pavel Hrdina --- src/util/vircgroup.c

[libvirt PATCH 5/9] vircgroupv1: refactor virCgroupV1DetectPlacement

2021-02-09 Thread Pavel Hrdina
Remove one level of indentation by splitting the condition. Signed-off-by: Pavel Hrdina --- src/util/vircgroupv1.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index

[libvirt PATCH 9/9] tests: add cgroup nested tests

2021-02-09 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- tests/vircgroupdata/systemd-legacy.cgroups| 12 tests/vircgroupdata/systemd-legacy.mounts | 11 +++ .../vircgroupdata/systemd-legacy.self.cgroup | 11 +++ tests/vircgroupdata/systemd-unified.cgroups | 13

[libvirt PATCH 4/9] vircgroup: use DBus call to systemd for some APIs

2021-02-09 Thread Pavel Hrdina
When running on host with systemd we register VMs with machined. In this case systemd creates the root VM cgroup for us. This has some implications where one of them is that systemd owns all files inside the root VM cgroup and we should not touch them. If we change any value in file that systemd

[libvirt PATCH 7/9] vircgroup: introduce virCgroupV1Exists and virCgroupV2Exists

2021-02-09 Thread Pavel Hrdina
This will check if the cgroup actually exists on the system. Signed-off-by: Pavel Hrdina --- src/util/vircgroupbackend.h | 4 src/util/vircgroupv1.c | 27 +++ src/util/vircgroupv2.c | 15 +++ 3 files changed, 46 insertions(+) diff --git

[libvirt PATCH 3/9] virsystemd: introduce virSystemdGetMachineUnitByPID

2021-02-09 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/libvirt_private.syms | 1 + src/util/virsystemd.c| 51 src/util/virsystemd.h| 2 ++ tests/virsystemdtest.c | 39 ++ 4 files changed, 88 insertions(+), 5 deletions(-) diff --git

[libvirt PATCH 8/9] vircgroup: introduce nested cgroup to properly work with systemd

2021-02-09 Thread Pavel Hrdina
When running on host with systemd we register VMs with machined. In this case systemd creates the root VM cgroup for us. This has some implications where one of them is that systemd owns all files inside the root VM cgroup and we should not touch them. We already use DBus calls for some of the

[libvirt PATCH 0/9] fix cgroups on systemd hosts

2021-02-09 Thread Pavel Hrdina
When running on host with systemd there is an ownership issue of the root VM cgroup. When it is created for us by systemd using machined the owner of the root VM cgroup is systemd and we should not touch any of the files as systemd can and will modify any values configured there. Basically we had

[libvirt PATCH 1/9] virsystemd: export virSystemdHasMachined

2021-02-09 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/libvirt_private.syms | 1 + src/util/virsystemd.c| 2 +- src/util/virsystemd.h| 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0636b0d8c9..b2d2282ce0 100644 ---

[libvirt PATCH 2/9] virsystemd: introduce virSystemdGetMachineByPID

2021-02-09 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/util/virsystemd.c | 52 ++- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 58b5c650b5..d2fcf0bf0c 100644 --- a/src/util/virsystemd.c +++

Re: generation of virtproxd socket files

2021-02-09 Thread Daniel P . Berrangé
On Mon, Feb 08, 2021 at 04:09:16PM -0700, Jim Fehlig wrote: > Hi All, > > I received a report [1] and verified that virtproxyd*.socket files have > broken syntax. E.g. from virtproxyd.socket > > [Unit] > Description=Libvirt proxy local socket > Before=virtproxyd.service > libvirtd.socket

Re: generation of virtproxd socket files

2021-02-09 Thread Christian Ehrhardt
On Tue, Feb 9, 2021 at 12:09 AM Jim Fehlig wrote: > > Hi All, > > I received a report [1] and verified that virtproxyd*.socket files have broken > syntax. E.g. from virtproxyd.socket > > [Unit] > Description=Libvirt proxy local socket > Before=virtproxyd.service > libvirtd.socket

[PATCH v2 08/13] qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event

2021-02-09 Thread Michal Privoznik
As advertised in previous commit, this event is delivered to us when virtio-mem module changes the allocation inside the guest. It comes with one attribute - size - which holds the new size of the virtio-mem (well, allocated size), in bytes. Mind you, this is not necessarily the same number as

[PATCH v2 13/13] kbase: Document virtio-mem

2021-02-09 Thread Michal Privoznik
This commit adds new memorydevices.rst page which should serve all models of memory devices. Yet, I'm documenting virtio-mem quirks only. Signed-off-by: Michal Privoznik --- docs/kbase/index.rst | 4 + docs/kbase/memorydevices.rst | 160 +++

[PATCH v2 11/13] virsh: Introduce update-memory command

2021-02-09 Thread Michal Privoznik
New 'update-memory' command is introduced which aims on making it user friendly to change device. So far I just need to change so I'm introducing --requested-size only; but the idea is that this is extensible for other cases too. For instance, want to change ? A new --my-element argument can be

[PATCH v2 06/13] qemu: Build command line for virtio-mem

2021-02-09 Thread Michal Privoznik
Nothing special is happening here. All important changes were done when for 'virtio-pmem' (adjusting the code to put virtio memory on PCI bus, generating alias using qemuDomainDeviceAliasIndex(). The only bit that might look suspicious is no prealloc for virtio-mem. But if you think about it, the

[PATCH v2 05/13] conf: Introduce virtio-mem model

2021-02-09 Thread Michal Privoznik
The virtio-mem is paravirtualized mechanism of adding/removing memory to/from a VM. A virtio-mem-pci device is split into blocks of equal size which are then exposed (all or only a requested portion of them) to the guest kernel to use as regular memory. Therefore, the device has two important

[PATCH v2 12/13] news: document recent virtio memory addition

2021-02-09 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index c6ae6a6c60..6f8a4bb037 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -35,6 +35,13 @@ v7.1.0 (unreleased) ``virNetworkGetXMLDesc()``, and ``virDomainScreenshot()``,

[PATCH v2 04/13] qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI

2021-02-09 Thread Michal Privoznik
This commit introduces a new capability that reflects virtio-mem-pci device support in QEMU: QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI, /* -device virtio-mem-pci */ The virtio-mem-pci device was introduced in QEMU 5.1. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c

[PATCH v2 10/13] qemu: Refresh the actual size of virtio-mem on monitor reconnect

2021-02-09 Thread Michal Privoznik
If the QEMU driver restarts it loses the track of the actual size of virtio-mem (because it's runtime type of information and thus not stored in XML) and therefore, we have to refresh it when reconnecting to the domain monitor. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c |

[PATCH v2 03/13] qemu_process: Drop needless check in qemuProcessNeedMemoryBackingPath()

2021-02-09 Thread Michal Privoznik
The aim of this function is to return whether domain definition and/or memory device that user intents to hotplug needs a private path inside cfg->memoryBackingDir. The rule for the memory device that's being hotplug includes checking whether corresponding guest NUMA node needs memoryBackingDir.

[PATCH v2 09/13] Introduce MEMORY_DEVICE_SIZE_CHANGE event

2021-02-09 Thread Michal Privoznik
New event is introduced that is emitted whenever guest acknowledges allocation change request of a virtio-mem. The aim is to let applications know when that happens, because changes in allocation are not synchronous with issuing the request. Under the hood, the event is emitted whenever QEMU emits

[PATCH v2 01/13] virhostmem: Introduce virHostMemGetTHPSize()

2021-02-09 Thread Michal Privoznik
New virHostMemGetTHPSize() is introduced which allows caller to obtain THP PMD (Page Middle Directory) size, which is equal to the minimal size that THP can use, taken from kernel doc (Documentation/admin-guide/mm/transhuge.rst): Some userspace (such as a test program, or an optimized memory

[PATCH v2 07/13] qemu: Wire up live update

2021-02-09 Thread Michal Privoznik
As advertised in one of previous commits, we want to be able to change 'requested-size' attribute of virtio-mem on the fly. This commit does exactly that. Changing anything else is checked for and forbidden. Once guest has changed the allocation, QEMU emits an event which we will use to track the

[PATCH v2 02/13] qemu_process: Deduplicate code in qemuProcessNeedHugepagesPath()

2021-02-09 Thread Michal Privoznik
The aim of qemuProcessNeedHugepagesPath() is to return whether guest needs private path inside HugeTLBFS mounts (deducted from domain definition @def) or whether the memory device that user is hotplugging in needs the private path (deducted from the @mem argument). The actual creation of the path

[PATCH v2 00/13] Introduce virtio-mem model

2021-02-09 Thread Michal Privoznik
v2 of: https://listman.redhat.com/archives/libvir-list/2021-January/msg00965.html diff to v1: - Rebased onto current master - Introduced new MEMORY_DEVICE_SIZE_CHANGE event - Forbade using virtio-mem among with memballoon - Wrote kbase article - Hopefully, worked in all Peter's review

Re: [PATCH 0/4] tests: qemu: Update test data after dropping old machine types

2021-02-09 Thread Pavel Hrdina
On Sat, Feb 06, 2021 at 03:21:02PM +0100, Peter Krempa wrote: > qemu dropped pc-1.0/pc-1.1/pc-1.2 for the upcoming release, fix some > tests and update the data. > > The two other disk test updates bump the oldest qemu machine type in the > _LATEST tests to 2.9, which should be okay for some

Re: [PATCH 4/4] qemucapabilitiesdata: Update 6.0.0 x86_64 capability test data

2021-02-09 Thread Peter Krempa
On Sat, Feb 06, 2021 at 15:21:06 +0100, Peter Krempa wrote: > Update to qemu commit v5.2.0-1684-gd0dddab40e which includes the removal > of pc-1.0/pc-1.1/pc-1.2 machine types. > > Signed-off-by: Peter Krempa > --- > .../caps_6.0.0.x86_64.replies | 2485 + >

[libvirt PATCH] gitlab: Fix build container dependencies for build jobs

2021-02-09 Thread Andrea Bolognani
A couple of these were wrong, resulting in the build job not waiting for the correct container to be built before starting. Fixes: 77296c807b18d22286be4b0ba5595d13103910a1 Signed-off-by: Andrea Bolognani --- "How did this get past review?" O:-) Pushed as trivial. .gitlab-ci.yml | 4 ++-- 1

[PATCH v2 2/2] rpc: introduce macro MILLISECONDS_PER_SECOND

2021-02-09 Thread BiaoxiangYe
From: BiaoXiang Ye Use macro instead of magic number, keep the style consistent with MICROSEC_PER_SEC. Signed-off-by: BiaoXiang Ye --- src/rpc/virkeepalive.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rpc/virkeepalive.c b/src/rpc/virkeepalive.c

Re: tpm-tis device for ARM virt

2021-02-09 Thread Andrea Bolognani
On Mon, 2021-02-08 at 17:30 -0700, Jim Fehlig wrote: > Hi All, > > I received a private bug report that starting a VM with swtpm device fails > with > qemu-system-aarch64. The VM config has > > > > > > QEMU reports the following error > > error: internal error: process

[PATCH v2 1/2] rpc: avoid crash when system time jump back

2021-02-09 Thread BiaoxiangYe
From: BiaoXiang Ye Setting the system time backward would lead to a multiplication overflow in function virKeepAliveStart. The function virKeepAliveTimerInternal got the same bug too. Backtrace below: #0 0xae898470 in raise () from /usr/lib64/libc.so.6 #1 0xae89981c in

[PATCH v2 0/2] rpc: avoid crash when system time jump back

2021-02-09 Thread BiaoxiangYe
From: BiaoXiang Ye Using monotonic timer instead of detecting a jump backwards as suggested by Jano and Daniel, thanks for suggestions. BiaoXiang Ye (2): rpc: avoid crash when system time jump back rpc: introduce macro MILLISECONDS_PER_SECOND src/rpc/virkeepalive.c | 35