Re: [PATCH] lxcxml2xmltest: Substitute 'inactive' variable with 'active'

2021-08-24 Thread Kristina Hanicova
On Wed, Jul 21, 2021 at 10:33 AM Kristina Hanicova wrote: > I removed negation from the name of a variable to make the code > more readable. > > Signed-off-by: Kristina Hanicova > --- > tests/lxcxml2xmltest.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/

[PATCH 4/4] virsh: add support for '--validate' option in define storage pool

2021-08-24 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/manpages/virsh.rst | 4 +++- tools/virsh-pool.c | 11 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 850a862fd9..2204bed3bb 100644 --- a/docs/manpages/virsh.rst +++

[PATCH 3/4] storage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag

2021-08-24 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/storage/storage_driver.c | 4 ++-- src/test/test_driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 37b84d038a..51daf6a05d 100644 --- a/src/storage/stora

[PATCH 1/4] api: add virStoragePoolDefineFlags

2021-08-24 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-storage.h | 4 src/libvirt-storage.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-storage.h b/include/libvirt/libvirt-storage.h index 089e1e0bd1..b459fe3e8e 100644 --- a

[PATCH 2/4] storage_conf: add validation against schema in pool define

2021-08-24 Thread Kristina Hanicova
We need to validate the XML against schema if option '--validate' was passed to the virsh command. This patch also includes propagation of flags into the virStoragePoolDefParse() function. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 2 +- src/conf/storage_conf.c | 1

[PATCH 0/4] storage pool define: add support for validation against schema

2021-08-24 Thread Kristina Hanicova
Kristina Hanicova (4): api: add virStoragePoolDefineFlags storage_conf: add validation against schema in pool define storage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag virsh: add support for '--validate' option in define storage pool docs/manpages/virsh.rst

[PATCH 22/22] qemu: process: Ignore 'RESET' event during startup

2021-08-24 Thread Peter Krempa
In cases when we are adding a disk with sharing backend (and thus hotplugging it) we need to re-initialize ACPI tables so that the VM boots from the correct device. This has a side-effect of emitting the RESET event and forwarding it to the clients which is not correct. Fix this by ignoring RESE

[PATCH 06/22] qemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'

2021-08-24 Thread Peter Krempa
Some actions are not supported by qemu. Use the recently added 'qemuValidateLifecycleAction' helper to ensure that the API does the same validation as we do on startup in the validation callbacks. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 35 +++ 1

[PATCH 21/22] qemuDomainSetLifecycleAction: Properly update 'onReboot' action in qemu

2021-08-24 Thread Peter Krempa
When qemu supports 'set-action' command we can update what happens on reboot. Additionally we can fully relax the checks as we now properly update the lifecycle actions. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 69 ++ 1 file changed, 63 ins

[PATCH 15/22] qemu: domain: Remove qemuDomainIsUsingNoShutdown

2021-08-24 Thread Peter Krempa
Directly use 'priv->allowReboot' as we now document what the behaiour is to avoid another lookup. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 4 +--- src/qemu/qemu_domain.c | 16 src/qemu/qemu_domain.h | 3 --- src/qemu/qemu_process.c | 3 +-- 4 files changed,

[PATCH 14/22] qemu: migration: Don't transfer 'allowReboot' flag

2021-08-24 Thread Peter Krempa
The original idea was to ensure that the destination has the same original state of the '-no-reboot' flag to ensure identical behaviour of the 'vidDomainModifyLifecycleAction' API. With newer qemu's we'll be able to modify the behaviour using the monitor so old daemons won't be able to keep up any

[PATCH 17/22] qemuProcessHandleReset: Don't emulate lifecycle actions for RESET event

2021-08-24 Thread Peter Krempa
The RESET event is delivered by qemu only when the guest OS is actually allowed to reboot ('-no-reboot' or equivalent is not used) and due to the nature of async handling of the events VM is actually already executing guest code after the reboot, until our code gets to killing it. In general it sh

[PATCH 02/22] qemuDomainSetLifecycleAction: Add a note about argument range-check

2021-08-24 Thread Peter Krempa
The public API wrapper range-checks the arguments. Save the next reader the hassle of looking it up. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 444e9e5cbc..2de17aaa4e 100644 --

[PATCH 13/22] qemuDomainObjPrivate: Annotate 'allowReboot' field

2021-08-24 Thread Peter Krempa
Save further readers the headache of determining what it actually does and note that it's not used with qemu version supporting the 'set-action' command. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.h | 8 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_domain.h b/sr

[PATCH 20/22] qemu: process: Don't set 'allowReboot' when qemu supports 'set-action'

2021-08-24 Thread Peter Krempa
We don't use the value of the flag when the new handling is in place so we don't have to initialize it. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bbcef47885..e2bcd23954

[PATCH 19/22] qemu: command: Always use '-no-shutdown'

2021-08-24 Thread Peter Krempa
The '-no-shutdown' flag prevents qemu from terminating if a shutdown was requested. Libvirt will handle the termination of the qemu process anyways and using this consistently will allow greater flexibility for the virDomainSetLifecycleAction API as well as will allow using the 'system-reset' QMP c

[PATCH 18/22] qemuProcessLaunch: Setup handling of 'on_reboot' via QMP when starting the process

2021-08-24 Thread Peter Krempa
Rather than using '-no-reboot' use the QMP command to update the lifecycle action of 'on_reboot'. This will be identical to how we set the behaviour during lifetime and also avoids problems with use of the 'system-reset' QMP command during bringup of the VM (used to update the firmware table of di

[PATCH 16/22] qemuDomainSetLifecycleAction: Forbid live update of 'on_reboot'

2021-08-24 Thread Peter Krempa
Without the ability to tell qemu to change the behaviour on reboot of the guest it's fundamentally unsafe to change the action as the guest would be able to execute instructions after the reboot before libvirt terminates it due to the async nature of QMP events. Stricten the code for now until we

[PATCH 11/22] qemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported

2021-08-24 Thread Peter Krempa
If current qemu supports 'set-action' use it instead of the single-use command. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 54 +++-- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c

[PATCH 12/22] qemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case

2021-08-24 Thread Peter Krempa
Upcoming patches will modify how '-no-reboot' is handled when qemu supports the 'set-action' QMP command. Add a test for it. Signed-off-by: Peter Krempa --- .../misc-no-reboot.x86_64-latest.args | 35 +++ tests/qemuxml2argvtest.c | 1 + 2 files chang

[PATCH 09/22] qemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION

2021-08-24 Thread Peter Krempa
The 'set-action' QMP command allows modifying the behaviour when the guest resets. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 + tests/qem

[PATCH 10/22] qemu: monitor: Implement monitor code for 'set-action' command

2021-08-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 16 src/qemu/qemu_monitor.h | 49 ++ src/qemu/qemu_monitor_json.c | 79 src/qemu/qemu_monitor_json.h | 7 tests/qemumonitorjsontest.c | 6 +++ 5 files chan

[PATCH 08/22] qemu: Honor 'restart' action for 'on_poweroff'

2021-08-24 Thread Peter Krempa
We simply terminate qemu instead of issuing a reset as the semantics of the setting dictate. Fix it by handling it identically to 'fake reboot'. We need to forbid the combination of 'onReboot' -> 'destroy' and 'onPoweroff' -> reboot though as the handling would be hairy and it honetly makes no se

[PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-08-24 Thread Peter Krempa
The qemu driver didn't ever implement any meaningful handling for the 'preserve' action. Forbid the flag in the qemu def validator and update the documentation to be factual. Signed-off-by: Peter Krempa --- docs/formatdomain.rst| 3 +-- src/qemu/qemu_validate.c | 10 ++ 2 files cha

[PATCH 05/22] qemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-08-24 Thread Peter Krempa
The qemu driver didn't ever implement any meaningful handling for the 'rename-restart' action. At this point the following handling would take place: 'on_reboot' set to 'rename-restart' is ignored on guest-initiated reboots, the guest simply reboots. For on_poweroff set to 'rename-restart' the f

[PATCH 04/22] qemu: validate: Reformat header and purge unused includes

2021-08-24 Thread Peter Krempa
Use the new style header formatting. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.h | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_validate.h b/src/qemu/qemu_validate.h index 271460d019..19629ac3af 100644 --- a/src/qemu/qe

[PATCH 03/22] qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML

2021-08-24 Thread Peter Krempa
We've got multiple random open-coded versions. Switch to the helper function which doesn't report errors as they'd be mostly wrong as the operation was indeed successful. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 96 -- 1 file changed, 26 in

[PATCH 01/22] qemuMonitorJSONSetWatchdogAction: Use automatic memory clearing

2021-08-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8e5af9f79a..8fb2bf4dc3 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu

[PATCH 00/22] qemu: Fix mess with lifecycle actions and unbreak transient disks

2021-08-24 Thread Peter Krempa
While investigating how to fix issue with transient disks breaking when -no-shutdown is not used I've ended up figuring out that lifecycle action handling in the qemu driver is very broken. Unbreak the handling by rejecting some actions which were never implemented, add support for 'set-action' qm

[libvirt PATCH 05/11] scripts: group-qemu-caps: split lines in regroup_caps

2021-08-24 Thread Ján Tomko
For consistency, operate on split lines and re-add the newlines later. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index ee33f1cf16..ca5f9b7

[libvirt PATCH 11/11] scripts: group-qemu-caps: remove Errs variable

2021-08-24 Thread Ján Tomko
Use ret and exit with it directly. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index bcda29a6ca..356d9e8d06 100755 --- a/scripts/group-qemu-caps.py

[libvirt PATCH 10/11] scripts: group-qemu-caps: reorder arguments

2021-08-24 Thread Ján Tomko
Make some arguments optional. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index 36a7d7602f..bcda29a6ca 100755 --- a/scripts/group-qemu-caps.py +++ b/

[libvirt PATCH 09/11] scripts: group-qemu-caps: only pass relevant lines to regroup_caps

2021-08-24 Thread Ján Tomko
This makes reconstructing the fixed version of the file a bit more difficult, but lets us get rid of a cryptic bool. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 63 +- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/scripts/group-

[libvirt PATCH 08/11] scripts: group-qemu-caps: introduce check_wrapping

2021-08-24 Thread Ján Tomko
Remove the logic that compares the expected and actual output. Also split out reading of the file - letting regroup_caps deal with just the lines for now. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 51 ++ 1 file changed, 29 insertions(+), 22 de

[libvirt PATCH 07/11] scripts: group-qemu-caps: introduce find_markers

2021-08-24 Thread Ján Tomko
Get indexes of the two marker strings. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index 2eaaf06bb4..29ab268c4c 100755 --- a/scripts/gro

[libvirt PATCH 06/11] scripts: group-qemu-caps: introduce load_file

2021-08-24 Thread Ján Tomko
Turn a file into a list of split lines. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index ca5f9b7247..2eaaf06bb4 100755 --- a/scripts/group-q

[libvirt PATCH 02/11] scripts: group-qemu-caps: store paths in helper variables

2021-08-24 Thread Ján Tomko
Avoid repetition and specifying the path to the header file twice. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index ec10f24384..bd22dd992a 100755 ---

[libvirt PATCH 04/11] scripts: group-qemu-caps: remove unnecessary regexes

2021-08-24 Thread Ján Tomko
regroup_caps uses these to filter out lines that should not increase the counter. Here, we only care about the capability constants, so we can let the final matching regex take care of the matching. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 6 +- 1 file changed, 1 insertion(+

[libvirt PATCH 01/11] scripts: group-qemu-caps: read file separately in load_caps_flags

2021-08-24 Thread Ján Tomko
Split the file by lines and store it in a list. Switch the rest of the function to operate on this list, to prepare for splitting out the fire reading logic. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 30 -- 1 file changed, 16 insertions(+), 14 deletion

[libvirt PATCH 03/11] scripts: group-qemu-caps: remove cryptic bool from load_caps_flags

2021-08-24 Thread Ján Tomko
Enumerate over lines early to find out the position of the starting and ending markers. Then run the actual function on the lines between those markers. Signed-off-by: Ján Tomko --- scripts/group-qemu-caps.py | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(

[libvirt PATCH 00/11] Attempt to rewrite group-qemu-caps.py in Python

2021-08-24 Thread Ján Tomko
Disclaimer: I don't really know Python Ján Tomko (11): scripts: group-qemu-caps: read file separately in load_caps_flags scripts: group-qemu-caps: store paths in helper variables scripts: group-qemu-caps: remove cryptic bool from load_caps_flags scripts: group-qemu-caps: remove unnecessary

Re: [libvirt PATCH 0/6] qemu: capabilities: use g_auto (glib chronicles)

2021-08-24 Thread Ján Tomko
On a Tuesday in 2021, Michal Prívozník wrote: On 8/24/21 3:22 PM, Martin Kletzander wrote: On Mon, Aug 23, 2021 at 05:26:43PM +0200, Kristina Hanicova wrote: On Mon, Aug 23, 2021 at 4:38 PM Ján Tomko wrote: This is not a cover letter. Ján Tomko (6):   qemu: refactor virQEMUCapsNewForBinaryI

[libvirt PATCH 1/1] Add a PCI/PCIe device VPD Capability

2021-08-24 Thread Dmitrii Shcherbakov
Add support for deserializing the binary PCI/PCIe VPD format and exposing VPD resources as XML elements in a new nested capability of PCI/PCIe devices called 'vpd'. The VPD format is specified in "I.3. VPD Definitions" in PCI specs (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in PCIe 4

[libvirt PATCH 0/1] Add a PCI/PCIe device VPD Capability

2021-08-24 Thread Dmitrii Shcherbakov
Add support for deserializing the binary PCI/PCIe VPD format and exposing VPD resources as XML elements in a new nested capability of PCI/PCIe devices called 'vpd'. The VPD format is specified in "I.3. VPD Definitions" in PCI specs (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in PCIe 4

Re: [PATCHv2 0/2] Support VM core dump to block device

2021-08-24 Thread Michal Prívozník
On 8/23/21 5:40 PM, Simon Rowe wrote: > When the destination of a VM core dump is a block device (e.g. NBD) > avoid file operations that are unnecessary. > > Simon Rowe (2): > iohelper: skip lseek() and ftruncate() on block devices > qemu: check unlink hint from virQEMUFileOpenAs() > > src/q

Re: [PATCHv2 1/2] iohelper: skip lseek() and ftruncate() on block devices

2021-08-24 Thread Simon Rowe
That's fine with me, thanks Simon From: Michal Prívozník Sent: 24 August 2021 14:37 To: Simon Rowe ; libvir-list@redhat.com Subject: Re: [PATCHv2 1/2] iohelper: skip lseek() and ftruncate() on block devices On 8/23/21 5:40 PM, Simon Rowe wrote: > Signed-off-by

Re: [libvirt PATCH 0/6] qemu: capabilities: use g_auto (glib chronicles)

2021-08-24 Thread Michal Prívozník
On 8/24/21 3:22 PM, Martin Kletzander wrote: > On Mon, Aug 23, 2021 at 05:26:43PM +0200, Kristina Hanicova wrote: >> On Mon, Aug 23, 2021 at 4:38 PM Ján Tomko wrote: >> >>> This is not a cover letter. >>> >>> Ján Tomko (6): >>>   qemu: refactor virQEMUCapsNewForBinaryInternal >>>   qemu: refactor

Re: [PATCH 0/7] network define: add support for validation against schema

2021-08-24 Thread Michal Prívozník
On 8/23/21 6:50 PM, Kristina Hanicova wrote: > > Kristina Hanicova (7): > api: add public virNetworkDefineXMLFlags() and remote protocol > vbox_network: add flags to vboxNetworkDefineCreateXML() > src: add driver support for networkDefineXMLFlags() > api: add virNetworkDefineFlags > src

Re: [PATCHv2 1/2] iohelper: skip lseek() and ftruncate() on block devices

2021-08-24 Thread Michal Prívozník
On 8/23/21 5:40 PM, Simon Rowe wrote: > Signed-off-by: Simon Rowe > --- > src/util/iohelper.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/src/util/iohelper.c b/src/util/iohelper.c > index b8810d16d3..e6eb178fde 100644 > --- a/src/util/iohelper.c > +++ b/sr

Re: [PATCHv2 0/2] Support VM core dump to block device

2021-08-24 Thread Michal Prívozník
On 8/23/21 5:40 PM, Simon Rowe wrote: > When the destination of a VM core dump is a block device (e.g. NBD) > avoid file operations that are unnecessary. > > Simon Rowe (2): > iohelper: skip lseek() and ftruncate() on block devices > qemu: check unlink hint from virQEMUFileOpenAs() > > src/q

Re: [libvirt PATCH] qemu: simplify machine-type check for implicit floppy controller

2021-08-24 Thread Martin Kletzander
On Mon, Aug 23, 2021 at 01:15:34PM +0200, Ján Tomko wrote: Q35 machine types 2.3 and older had an integrated floppy controller. Support for these machine types was removed by QEMU commit commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe q35: Remove old machine versions git describe: v2.5.0

Re: [libvirt PATCH 0/6] qemu: capabilities: use g_auto (glib chronicles)

2021-08-24 Thread Martin Kletzander
On Mon, Aug 23, 2021 at 05:26:43PM +0200, Kristina Hanicova wrote: On Mon, Aug 23, 2021 at 4:38 PM Ján Tomko wrote: This is not a cover letter. Ján Tomko (6): qemu: refactor virQEMUCapsNewForBinaryInternal qemu: refactor virQEMUCapsLoadFile qemu: refactor virQEMUCapsInit qemu: refacto

Re: [libvirt PATCHv2] API: discourage usage of non-ListAll APIs

2021-08-24 Thread Martin Kletzander
On Mon, Aug 23, 2021 at 02:16:51PM +0200, Ján Tomko wrote: They require the caller to provide the maximum number of array elements upfront, leading to either incomplete results or violations of the zero-one-infinity rule. Signed-off-by: Ján Tomko Reviewed-by: Martin Kletzander signature.as

Re: [PATCH V2] qemu: Set label on vhostuser net device when hotplugging

2021-08-24 Thread Michal Prívozník
On 8/19/21 12:57 AM, Jim Fehlig wrote: > Attaching a newly created vhostuser port to a VM fails due to an > apparmor denial > > internal error: unable to execute QEMU command 'chardev-add': Failed > to bind socket to /run/openvswitch/vhu838c4d29-c9: Permission denied > > In the case of a net devi