Re: [libvirt PATCH 2/2] conf: log error on attempts to modify ACPI index of active device

2021-09-16 Thread Laine Stump
On 9/13/21 11:38 AM, Peter Krempa wrote: On Fri, Sep 10, 2021 at 11:18:20 -0400, Laine Stump wrote: On 9/10/21 3:30 AM, Peter Krempa wrote: On Thu, Sep 09, 2021 at 13:46:41 -0400, Laine Stump wrote: The ACPI index of a device in a running guest can't be modified, and libvirt doesn't actually

Re: [PATCH RFC 0/5] Subject: [PATCH RFC 0/5] qapi: Add feature flags to enum members

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
16.09.2021 15:57, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Great! Thanks for working on this! 15.09.2021 22:24, Markus Armbruster wrote: PATCH 1+2 add feature flags to enum members. Awkward due to an introspection design mistake; see PATCH 1 for details. Feedback

[PATCH 08/14] vsh: Add completer for '--command' of 'help' command

2021-09-16 Thread Peter Krempa
Wrap 'vshReadlineCommandGenerator' into a function with proper prototype to provide a completer for the help command. Signed-off-by: Peter Krempa --- tools/vsh.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/vsh.c b/tools/vsh.c index 9c6783dad1..cf24586b25 100644 ---

[PATCH 07/14] virsh: Use 'virshStoragePoolNameCompleter' for two options

2021-09-16 Thread Peter Krempa
'--pool' of the 'pool-event' command and '--inputpool' of 'vol-create-from' use the above mentioned completer. Signed-off-by: Peter Krempa --- tools/virsh-pool.c | 1 + tools/virsh-volume.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index

[PATCH 11/14] virsh: completer: Introduce dummy completer for local files

2021-09-16 Thread Peter Krempa
For now the completion does the correct thing of completing a local path if NULL is returned. Introduce 'virshCompletePathLocalExisting' and use it in the 'VIRSH_COMMON_OPT_FILE' macro. This for now serves as an annotation for the function which want to read a file on the host running virsh. In

[PATCH 13/14] virsh: Introduce virshCompleteEmpty and use it for places where we can't suggest anything

2021-09-16 Thread Peter Krempa
For now this serves just as an annotation because readline and also the bash completion script insist on completing local paths when an empty list is returned. This will serve for future reference once we'll be able to properly refuse to suggest anything. The completer is used for fields such as

[PATCH 10/14] virsh: Expand VIRSH_COMMON_OPT_FILE for cases when it's not a local file used by virsh

2021-09-16 Thread Peter Krempa
In cases such as the APIs for managed save management, the file path provided via the '--file' option is passed to the API. We'll need to make them distinct from cases for when virsh is using the file so that different completers can be used. Signed-off-by: Peter Krempa ---

[PATCH 09/14] virsh: Provide completers for options taking comma separated list of disk targets

2021-09-16 Thread Peter Krempa
'--storage' of the 'undefine' command and '--migrate-disks' of the 'migrate' command take a list of disk targets as an argument. We can simply combine 'virshDomainDiskTargetCompleter' with 'virshCommaStringListComplete' to provide the completions. Signed-off-by: Peter Krempa ---

[PATCH 06/14] virsh-snapshot: Use 'virshSnapshotNameCompleter' for '--from' of 'snapshot-list'

2021-09-16 Thread Peter Krempa
When listing a snapshot tree, the '--from' option takes a name of a snapshot to limit the subset. Use virshSnapshotNameCompleter as completer for the option. Signed-off-by: Peter Krempa --- tools/virsh-snapshot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-snapshot.c

[PATCH 05/14] vsh: Introduce '--completers-missing' for 'self-test' command

2021-09-16 Thread Peter Krempa
Make it simple to spot which options of which commands are missing autocompletion functions by introducing this hidden option. In the future when we'll have completers for everything this can be also used as a hard fail so that completers are always added. Signed-off-by: Peter Krempa ---

[PATCH 04/14] vshCmddefCheckInternals: Sanitize command alias validation

2021-09-16 Thread Peter Krempa
We don't need to validate the real command twice, but it's better to check that the real command name exists and it's not an alias to prevent loops. Signed-off-by: Peter Krempa --- tools/vsh.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/vsh.c

[PATCH 12/14] virsh: Use 'virshCompletePathLocalExisting' for options reading local files

2021-09-16 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tools/virsh-backup.c | 2 ++ tools/virsh-checkpoint.c | 1 + tools/virsh-domain.c | 10 ++ tools/virsh-network.c| 1 + tools/virsh-pool.c | 1 + tools/virsh-secret.c | 1 + tools/virsh-snapshot.c | 1 + 7 files changed, 17

[PATCH 14/14] virsh-completer: Provide completer for '--top' and '--base' for blockjobs

2021-09-16 Thread Peter Krempa
Complete with the indexed targets (e.g. vda[3]) based on existing indexes. Signed-off-by: Peter Krempa --- tools/virsh-completer-domain.c | 100 + tools/virsh-completer-domain.h | 5 ++ tools/virsh-domain.c | 3 + 3 files changed, 108 insertions(+)

[PATCH 01/14] virshCheckpointNameCompleter: Sanitize forward declaration use

2021-09-16 Thread Peter Krempa
Include the proper header instead of duplicating the declaration. Signed-off-by: Peter Krempa --- tools/virsh-completer.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h index 7edb8e2f7e..874813335d 100644 ---

[PATCH 02/14] virsh-completer*.h: Use modern header style

2021-09-16 Thread Peter Krempa
Prevent the need to edit the function declarations to put them into the header. There was even inconsistent use. Signed-off-by: Peter Krempa --- tools/virsh-completer-checkpoint.h | 7 +- tools/virsh-completer-domain.h | 155 + tools/virsh-completer-host.h

[PATCH 00/14] virsh: Completion improvements and checking tool

2021-09-16 Thread Peter Krempa
When inspecting whether https://gitlab.com/libvirt/libvirt/-/issues/9 is still valid I wrote a tool which outputs command options missing completers. Now that I had a bit of time with lot of interruptions which is ideal for going through such a thing I decided to clean up the tool and post it

[PATCH 03/14] virsh: Remove hack using 'VSH_CMD_FLAG_ALIAS' to hide virsh commands

2021-09-16 Thread Peter Krempa
Introduce a proper flag 'VSH_CMD_FLAG_HIDDEN' for hiding commands from output so that we can validate that there aren't any loops or misconfigured commands. Signed-off-by: Peter Krempa --- tools/virsh.c | 3 ++- tools/virt-admin.c | 3 ++- tools/vsh.c| 9 ++--- tools/vsh.h

Re: [PATCH 5/8] qdev: improve find_device_state() to distinguish simple not found case

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
16.09.2021 13:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: We'll need this for realizing qdev_find_child() in the next commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- softmmu/qdev-monitor.c | 48 +- 1 file changed, 33

Re: RFC: revert to external snapshot API

2021-09-16 Thread Nikolay Shirokovskiy
[...] > > > > One thing you've missed though is that deletion of snapshots now > becomes > > > quite a challenge. > > > > > > > Yeah I did not consider implementing deleting at that moment. However to > > make > > external snapshots usable it should be implemented as well. > > Yeah, both need to

Re: [PATCH v2 0/5] network create: add support for validation against schema

2021-09-16 Thread Michal Prívozník
On 9/15/21 1:07 PM, Kristina Hanicova wrote: > This is v2 of: > https://listman.redhat.com/archives/libvir-list/2021-August/msg00871.html > > diff to v1: > - rebased onto the current master > - changed the way of working with flags to make the code more readable > (suggested by Jano and

Re: [PATCH v2 3/5] api: add virNetworkCreateFlags

2021-09-16 Thread Kristina Hanicova
On Thu, Sep 16, 2021 at 4:02 PM Michal Prívozník wrote: > On 9/15/21 1:07 PM, Kristina Hanicova wrote: > > Signed-off-by: Kristina Hanicova > > --- > > include/libvirt/libvirt-network.h | 4 > > src/libvirt-network.c | 2 +- > > 2 files changed, 5 insertions(+), 1 deletion(-)

Re: [PATCH 2/8] block: add BlockParentClass class

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
16.09.2021 11:34, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add a class that will unify block parents for blockdev-replace functionality we are going to add. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-parent.h | 32 +

Re: [PATCH RFC 0/5] Subject: [PATCH RFC 0/5] qapi: Add feature flags to enum members

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 16.09.2021 15:57, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> Great! Thanks for working on this! >>> >>> 15.09.2021 22:24, Markus Armbruster wrote: PATCH 1+2 add feature flags to enum members. Awkward due to an

Re: [PATCH v2 3/5] api: add virNetworkCreateFlags

2021-09-16 Thread Michal Prívozník
On 9/15/21 1:07 PM, Kristina Hanicova wrote: > Signed-off-by: Kristina Hanicova > --- > include/libvirt/libvirt-network.h | 4 > src/libvirt-network.c | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/include/libvirt/libvirt-network.h >

Re: [PATCH] tools/virsh-pool: refactor smaller functions

2021-09-16 Thread Michal Prívozník
On 9/15/21 4:27 PM, Kristina Hanicova wrote: > I think these functions look much more readable with just simple > if conditions. > > Signed-off-by: Kristina Hanicova > --- > tools/virsh-pool.c | 68 -- > 1 file changed, 30 insertions(+), 38

Re: [PATCH RFC 0/5] Subject: [PATCH RFC 0/5] qapi: Add feature flags to enum members

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Great! Thanks for working on this! > > 15.09.2021 22:24, Markus Armbruster wrote: >> PATCH 1+2 add feature flags to enum members. Awkward due to an >> introspection design mistake; see PATCH 1 for details. Feedback >> welcome, in particular from

[PATCH 1/3] schemas: Make for capscsi type optional

2021-09-16 Thread Michal Privoznik
The element for part of nodedev XML is optional (see udevProcessSCSIDevice()) and as such might not be formatted into nodedev XML (see virNodeDeviceCapSCSIDefFormat()). Reflect this in our RNG. Signed-off-by: Michal Privoznik --- docs/schemas/nodedev.rng | 8 +--- 1 file changed, 5

[PATCH 2/3] schemas: Provide grammar for scsi_generic capabilities

2021-09-16 Thread Michal Privoznik
A nodedev can have 'scsi_generic' capabilities but corresponding RNG is missing. Fortunately, it's very simple - there's only one mandatory child element . Signed-off-by: Michal Privoznik --- docs/schemas/nodedev.rng | 11 +++ 1 file changed, 11 insertions(+) diff --git

[PATCH 3/3] schemas: Allow to be zero

2021-09-16 Thread Michal Privoznik
The value of zero is valid (see virNodeDeviceGetSCSIHostCaps()) but our RNG does not think so. Switching the type to 'unsignedInt' does allow value of zero. Signed-off-by: Michal Privoznik --- docs/schemas/nodedev.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/3] schemas: Couple of nodedev related fixes

2021-09-16 Thread Michal Privoznik
These three patches address the first three problems raised in https://bugzilla.redhat.com/show_bug.cgi?id=1999420 The fourth one is a bit different because I'm failing to find a path in the code that would allow empty for vdpa. Michal Prívozník (3): schemas: Make for capscsi type

Re: [PATCH RFC 0/5] Subject: [PATCH RFC 0/5] qapi: Add feature flags to enum members

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
Great! Thanks for working on this! 15.09.2021 22:24, Markus Armbruster wrote: PATCH 1+2 add feature flags to enum members. Awkward due to an introspection design mistake; see PATCH 1 for details. Feedback welcome, in particular from management application guys. PATCH 3+4 implement policy

Re: [PATCH 5/8] qdev: improve find_device_state() to distinguish simple not found case

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > We'll need this for realizing qdev_find_child() in the next commit. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > softmmu/qdev-monitor.c | 48 +- > 1 file changed, 33 insertions(+), 15 deletions(-) > >

Re: [PATCH 2/8] block: add BlockParentClass class

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Add a class that will unify block parents for blockdev-replace > functionality we are going to add. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > include/block/block-parent.h | 32 + > block/block-parent.c | 66

Re: [libvirt PATCH 2/2] docs: update nodedev driver docs for new mdev features

2021-09-16 Thread Michal Prívozník
On 9/15/21 10:16 PM, Jonathon Jongsma wrote: > Add up-to-date information about creating and defining mediated devices > in libvirt. > > Signed-off-by: Jonathon Jongsma > --- > docs/drvnodedev.html.in | 83 ++--- > 1 file changed, 62 insertions(+), 21

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

2021-09-16 Thread Michal Privoznik
When guest has NUMA nodes and QEMU is new enough to report default RAM ID then ideally we would use -numa memdev= combined with memory-backend-* combo becasue -mem-path/-mem-prealloc/-numa mem are deprecated. Well, there is one problem - the .memdev= attribute is machine type dependent (just look

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

2021-09-16 Thread Michal Privoznik
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): qemuxml2argvtest: Introduce another numa-topology

[PATCH 1/2] qemuxml2argvtest: Introduce another numa-topology test

2021-09-16 Thread Michal Privoznik
This test shows a bug we have: even though the XML says: there is no -mem-prealloc nor .prealloc=yes anywhere on the cmd line. This will be fixed in the next commit. Signed-off-by: Michal Privoznik --- ...d-memory-numa-topology4.x86_64-latest.args | 33 +

[PATCH] qemu: Fix typo in qemuBuilNumaCellCache

2021-09-16 Thread Michal Privoznik
The function should be named qemuBuildNumaCellCache (note the missing 'd' in Build). Signed-off-by: Michal Privoznik --- Pushed as trivial. src/qemu/qemu_command.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c