Re: [libvirt PATCH 08/13] ch_cgroup: methods for cgroup mgmt in ch driver

2021-11-15 Thread Praveen K Paladugu
On 10/29/2021 7:31 AM, Michal Prívozník wrote: On 10/22/21 5:37 PM, Praveen K Paladugu wrote: From: Vineeth Pillai Signed-off-by: Vineeth Pillai Signed-off-by: Praveen K Paladugu --- po/POTFILES.in | 1 + src/ch/ch_cgroup.c | 457

[libvirt PATCH v3 1/1] Ignore EPERM on attempts to clear VF VLAN ID

2021-11-15 Thread Dmitrii Shcherbakov
SmartNIC DPUs may not expose some privileged eswitch operations to the hypervisor hosts. For example, this happens with Bluefield devices running in the ECPF (default) mode for security reasons. While VF MAC address programming is possible via an RTM_SETLINK operation, trying to set a VLAN ID in

[libvirt PATCH v3 0/1] Ignore EPERM on attempts to clear a VF VLAN ID

2021-11-15 Thread Dmitrii Shcherbakov
SmartNIC DPUs may not expose some privileged eswitch operations to the hypervisor hosts. For example, this happens with Bluefield devices running in the ECPF (default) mode [1] for security reasons. While VF MAC address programming is possible via an RTM_SETLINK operation, trying to set a VLAN ID

[libvirt PATCH 3/5] qemu: Rename interop locations

2021-11-15 Thread Andrea Bolognani
Use abstract names that more closely match the Meson nomenclature. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_interop_config.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_interop_config.c b/src/qemu/qemu_interop_config.c index

[libvirt PATCH 0/5] meson: Introduce qemu_datadir option

2021-11-15 Thread Andrea Bolognani
This is mostly useful to macOS users (see [1] for background). The first two commits are fixes for small issues discovered while looking into this. Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/409294109 [1] https://gitlab.com/libvirt/libvirt/-/issues/168 Andrea Bolognani (5):

[libvirt PATCH 5/5] spec: Explicitly provide locations for QEMU data

2021-11-15 Thread Andrea Bolognani
These are the defaults, but we prefer to be explicit. Signed-off-by: Andrea Bolognani --- libvirt.spec.in | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5f1773ef93..80770a41bb 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -190,6 +190,10

[libvirt PATCH 2/5] qemu: Set QEMU data location correctly

2021-11-15 Thread Andrea Bolognani
While datadir must live under prefix, there is no requirement that its name must necessarily be "share": a different, arbitrary name could have been provided by the user. Fixes: 3c876d2428ee3abbb11a50698a9e225cffb72cbc Signed-off-by: Andrea Bolognani --- src/qemu/qemu_interop_config.c | 2 +- 1

[libvirt PATCH 4/5] meson: Introduce qemu_datadir option

2021-11-15 Thread Andrea Bolognani
There is no guarantee that QEMU and libvirt have been configured with the same prefix. In particular, Homebrew on macOS will pass a different, private prefix for each package version and then use symlinks to make the files for a specific version appear in the usual locations. This works

[libvirt PATCH 1/5] meson: Define qemu_moddir correctly

2021-11-15 Thread Andrea Bolognani
We can't hardcode /usr here, because the user might have configured whatever arbitrary prefix. Everything appeared to be okay because when joining paths Meson will drop any component that precedes an absolute path and libdir happens to be absolute, but we should still do things correctly instead

[libvirt PATCH 09/11] test: snapshot revert: fix emitting events

2021-11-15 Thread Pavel Hrdina
Now that we always emulate restarting the VM process events are emitted differently so we need to update the code and the comment as well. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 42 +- 1 file changed, 9 insertions(+), 33 deletions(-)

[libvirt PATCH 08/11] test: snapshot revert: drop unused code

2021-11-15 Thread Pavel Hrdina
Now that we always emulate VM process stop we can drop the unused code and simply the logic. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 33 - 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/test/test_driver.c

[libvirt PATCH 02/11] qemu_snapshot: revert: always restart QEMU process for running VM

2021-11-15 Thread Pavel Hrdina
Our compatibility check code isn't complete and there are cases where it fails to detect incompatible configuration and the revert fails. In addition future support for external snapshot will always require restarting the QEMU process. To unify the behavior drop the compatibility check code and

[libvirt PATCH 06/11] test: snapshot revert: always error out if VM XML is missing

2021-11-15 Thread Pavel Hrdina
We should have this check even if FORCE flag is used because later we unconditionally copy the `snap->def->dom` and error out if there is no copy created. The test driver will always save the VM XML when creating new snapshot. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 13

[libvirt PATCH 05/11] qemu_snapshot: revert: drop error that QEMU process must be restarted

2021-11-15 Thread Pavel Hrdina
This will always happen so there is no need to error out and require usage of FORCE flag. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 9 - 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index e08959a754..9e975e0eaa 100644

[libvirt PATCH 01/11] qemu_snapshot: revert: always error out if VM XML is missing

2021-11-15 Thread Pavel Hrdina
The support to revert snapshots was introduced in libvirt 0.8.0 but saving the whole VM XML was implemented later in libvirt 0.9.5. That is more then 10 years ago so we can safely assume that nobody will try reverting to snapshot created by that old libvirt. In the unlikely scenario where someone

[libvirt PATCH 04/11] qemu_snapshot: revert: fix emitting events

2021-11-15 Thread Pavel Hrdina
Now that we always restart the QEMU process events are emitted differently so we need to update the code and the comment as well. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 37 ++--- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git

[libvirt PATCH 07/11] test: snapshot revert: always emulate VM process stop

2021-11-15 Thread Pavel Hrdina
Reflect the same change in test driver as in QEMU driver because the compatibility check code isn't perfect. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/test/test_driver.c

[libvirt PATCH 11/11] domain_snapshot: update virDomainRevertToSnapshot description

2021-11-15 Thread Pavel Hrdina
We've changed the behavior of this API that from now on it will always restart the VM process and we are no longer able to revert to snapshots created by libvirt older then 0.9.5. Signed-off-by: Pavel Hrdina --- src/libvirt-domain-snapshot.c | 5 + 1 file changed, 5 insertions(+) diff

[libvirt PATCH 10/11] test: snapshot revert: drop error the VM must be restarted

2021-11-15 Thread Pavel Hrdina
This will always happen so there is no need to error out and require usage of FORCE flag. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 12 1 file changed, 12 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 333b5e8bfc..2871c8ebac 100644

[libvirt PATCH 03/11] qemu_snapshot: revert: drop unused loadvm code

2021-11-15 Thread Pavel Hrdina
Now that we always restart QEMU process the loadvm code is unused and can be dropped. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 96 +++- 1 file changed, 26 insertions(+), 70 deletions(-) diff --git a/src/qemu/qemu_snapshot.c

[libvirt PATCH 00/11] improve and cleanup internal snapshot revert

2021-11-15 Thread Pavel Hrdina
This fixes few issues with reverting internal snapshot where the VM was modified and our compatibility check code failed to detect it, for example changing one of the VM disks. It also cleanups the code significantly as a preparation for other cleanups and future external snapshot implementation.

Re: [PATCH 00/18] qemu: command: Convert '-compat' and '-audiodev' to use JSON

2021-11-15 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: In line of the previous work to use the long-term stable versions of the commandline interface. Peter Krempa (18): virJSONValueObjectAdd: Convert @obj argument to double pointer virJSONValueObjectAddVArgs: Take double pointer

Re: [PATCH 18/18] qemu: command: Use JSON for parameters of -audiodev

2021-11-15 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: '-audiodev' as a modern implementation based on QAPI already takes JSON as the argument. Convert our code to use it directly. The (lenghty) declaration of the QAPI types can be found in *lengthy (or just drop the word completely) Jano

Re: [PATCH 17/18] qemu: command: Use JSON for parameters of -compat

2021-11-15 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: '-compat' as a modern implementation based on QAPI already takes JSON as the argument. Convert our code to use it directly. QEMU declares the ised QAPI types as: { 'enum': 'CompatPolicyInput', 'data': [ 'accept', 'reject', 'crash' ] } { 'enum':

[PATCH 09/18] qemuDiskSourceGetProps: Initialize 'ret'

2021-11-15 Thread Peter Krempa
Upcomming patch will convert virJSONValueObjectCreate which didn't check the value of the passed argument to virJSONValueObjectAdd which will and this would lead to crashes. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 13/18] qemu: migration_params: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_params.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 11/18] qemublocktest: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c

[PATCH 10/18] qemu: command: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 480 1 file changed, 240 insertions(+), 240 deletions(-) diff --git

[PATCH 02/18] virJSONValueObjectAddVArgs: Take double pointer

2021-11-15 Thread Peter Krempa
Pass in the double pointer from the wrappers directly to virJSONValueObjectAddVArgs, which will allow us to directly allocate the new objects inside the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 2 +- src/util/virjson.c | 9 + src/util/virjson.h | 2

[PATCH 17/18] qemu: command: Use JSON for parameters of -compat

2021-11-15 Thread Peter Krempa
'-compat' as a modern implementation based on QAPI already takes JSON as the argument. Convert our code to use it directly. QEMU declares the ised QAPI types as: { 'enum': 'CompatPolicyInput', 'data': [ 'accept', 'reject', 'crash' ] } { 'enum': 'CompatPolicyOutput', 'data': [ 'accept',

[PATCH 16/18] util: json: Remove virJSONValueObjectCreate(VArgs)

2021-11-15 Thread Peter Krempa
The functions were obsoleted by virJSONValueObjectAdd(VArgs) Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 2 -- src/util/virjson.c | 24 src/util/virjson.h | 4 3 files changed, 30 deletions(-) diff --git a/src/libvirt_private.syms

[PATCH 15/18] Replace virJSONValueObjectCreateVArgs with virJSONValueObjectAddVArgs

2021-11-15 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_agent.c| 2 +- src/qemu/qemu_monitor_json.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 8d470b090c..c3b02569cd 100644 --- a/src/qemu/qemu_agent.c +++

[PATCH 14/18] virsh: domain: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c

[PATCH 12/18] virjsontest: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- tests/virjsontest.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/virjsontest.c

[PATCH 08/18] qemu: migration_cookie: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration_cookie.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git

[PATCH 07/18] qemu: monitor: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_monitor.c

[PATCH 04/18] qemu: block: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 342 +- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git

[PATCH 06/18] qemu: monitor_json: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 41 1 file changed, 23 insertions(+), 18 deletions(-) diff --git

[PATCH 05/18] qemu: agent: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

2021-11-15 Thread Peter Krempa
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_agent.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_agent.c

[PATCH 03/18] virJSONValueObjectAddVArgs: Allocate new object if passed pointer is NULL

2021-11-15 Thread Peter Krempa
Until now the code would crash if virJSONValueObjectAdd is used without a valid object. Adding the functionality of allocating it if it's NULL will allow us to replace all uses of virJSONValueObjectCreate with this single function. Signed-off-by: Peter Krempa --- src/util/virjson.c | 19

[PATCH 00/18] qemu: command: Convert '-compat' and '-audiodev' to use JSON

2021-11-15 Thread Peter Krempa
In line of the previous work to use the long-term stable versions of the commandline interface. Peter Krempa (18): virJSONValueObjectAdd: Convert @obj argument to double pointer virJSONValueObjectAddVArgs: Take double pointer virJSONValueObjectAddVArgs: Allocate new object if passed pointer

[PATCH 01/18] virJSONValueObjectAdd: Convert @obj argument to double pointer

2021-11-15 Thread Peter Krempa
Change the first argument to a double pointer so that later the function can be unified with virJSONValueObjectCreate and fix all callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c| 36 +- src/qemu/qemu_command.c | 124 +--

Re: [PATCH 0/2] qemu_command: Generate -mem-prealloc in one corner case more

2021-11-15 Thread Ján Tomko
On a Thursday in 2021, Michal Privoznik wrote: This is a result of mu discussion with Jing: https://listman.redhat.com/archives/libvir-list/2021-September/msg00407.html Turns out, the problem has nothing to do with my virtio-mem patches so I'm sending fix separately. Michal Prívozník (2):

Re: [PATCH] lib: Drop needless one line labels

2021-11-15 Thread Ján Tomko
On a Friday in 2021, Michal Privoznik wrote: In some cases we have a label that contains nothing but a return statement. The amount of such labels rises as we use automagic cleanup. Anyway, such labels are pointless and can be dropped. Signed-off-by: Michal Privoznik ---

Re: [PATCH] lib: Drop needless one line labels

2021-11-15 Thread Daniel Henrique Barboza
On 11/12/21 13:22, Michal Privoznik wrote: In some cases we have a label that contains nothing but a return statement. The amount of such labels rises as we use automagic cleanup. Anyway, such labels are pointless and can be dropped. Signed-off-by: Michal Privoznik --- Reviewed-by:

[PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-15 Thread Koichi Murase
--- tools/bash-completion/vsh.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in index 70ade50a02..4399ff0a64 100644 --- a/tools/bash-completion/vsh.in +++ b/tools/bash-completion/vsh.in @@ -4,7 +4,7 @@

[PATCH 0/1] tools/bash-completion: fix variable leaks of "IFS" and "word"

2021-11-15 Thread Koichi Murase
Description: The bash-completion function for virsh, which is defined in /usr/share/bash-completion/completions/virsh (generated from libvirt tools/bash-completion/vsh.in), overwrites the shell variables "IFS" and "word" on query for completions. Repeat-By: I am testing it with Fedora