To start multiple KVM guests from one qcow2 image with transient disk option

2020-12-11 Thread Masayoshi Mizuma
Hello, I would like to start multiple KVM guests from one qcow2 image, and discard the changes which the KVM guests done. transient disk option is useful for discarding the changes, however, we cannot start multiple KVM guest from one qcow2 image because the image is write-locked by the first

[PATCH 11/12] domain_validate.c: put IOMMU validation into a new function

2020-12-11 Thread Daniel Henrique Barboza
All other validations from virDomainDefValidateInternal() are done in their own functions. Take IOMMU validation out of the function body and into its own function. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_validate.c | 41 -- 1 file changed,

[PATCH 08/12] domain_conf: move all DeviceDefValidateInternal() helpers to domain_validate

2020-12-11 Thread Daniel Henrique Barboza
Moving all remaining static helpers of virDomainDeviceDefValidateInternal() will allow the next patch to move the function itself, and virDomainDeviceDefValidate(), to domain_validate.c. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 150

[PATCH 10/12] domain_validate.c: make virDomainDeviceDefValidateInternal() helpers static

2020-12-11 Thread Daniel Henrique Barboza
After the move from the previous patch, these functions are now all used in domain_validate.c and doesn't need to be public. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_validate.c | 27 ++- src/conf/domain_validate.h | 20 2 files

[PATCH 04/12] domain_conf: move all virDomainDefValidateInternal() helpers to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
This patches moves the remaining static functions that virDomainDefValidateInternal() uses to domain_validate.c. This allows the next patch to move virDomainDefValidateInternal(), and virDomainDefValidate(), without too much hassle. Signed-off-by: Daniel Henrique Barboza ---

[PATCH 06/12] domain_validate.c: make local functions static

2020-12-11 Thread Daniel Henrique Barboza
virDomainDefValidateInternal() helpers can now be made static again since they're all in the same file. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_validate.c | 22 +++--- src/conf/domain_validate.h | 13 - 2 files changed, 11 insertions(+), 24

[PATCH 07/12] domain_conf: move net device validation to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
The next objective is to move virDomainDeviceDefValidate() to domain_validate.c. First let's move all the static helpers. The net device validation functions are used across multiple drivers, so let's move them separately first. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c

[PATCH 00/12] move validations from domain_conf.c to

2020-12-11 Thread Daniel Henrique Barboza
Hi, This is a continuation of what we started in [1]. The changes are all trivial, but done in parts to make the review less annoying. domain_conf.c is still a huge beast, but here we're putting it on a diet, losing ~1k lines. [1]

[PATCH 05/12] domain_conf.c: move virDomainDeviceDefValidate() to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
Move virDomainDeviceDefValidate() and all its helper functions to domain_validate.c. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 137 + src/conf/domain_conf.h | 16 +++-- src/conf/domain_validate.c | 129

[PATCH 12/12] domain_validate.c: use VIR_ERR_CONFIG_UNSUPPORTED in validate functions

2020-12-11 Thread Daniel Henrique Barboza
Some functions in domain_validate.c are throwing VIR_ERR_XML_ERROR, when in reality none of these errors are exclusive to XML parsing. Change to VIR_ERR_CONFIG_UNSUPPORTED to be more adequate. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_validate.c | 34

[PATCH 09/12] domain_conf.c: move virDomainDeviceDefValidate() to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 88 -- src/conf/domain_conf.h | 6 +-- src/conf/domain_validate.c | 88 ++ src/conf/domain_validate.h | 5 +++ 4 files changed, 94 insertions(+),

[PATCH 01/12] domain_conf: move duplicate check functions to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
virDomainDefCheckDuplicateDiskInfo() and virDomainDefCheckDuplicateDriveAddresses() are static functions used by virDomainDefValidateInternal(). Let's move them to domain_validate.c to start clearing up the path to move virDomainDefValidateInternal(). Change the functions name slightly to be

[PATCH 03/12] domain_conf: move address validation functions to domain_validate.c

2020-12-11 Thread Daniel Henrique Barboza
virDomainDefValidateAliases() is one of the static functions that needs to be handled before moving virDomainDefValidateInternal(). Let's move all related validate functions to domain_validate.c at the same time. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 144

[PATCH 02/12] domain_conf.c: rename virDomainDeviceInfoIterateInternal()

2020-12-11 Thread Daniel Henrique Barboza
Next patch will move virDomainDefValidateAliases() to domain_validate.c, which uses virDomainDeviceInfoIterateInternal(), meaning that this function will be made public. Rename it now to remove the 'Internal' of its name. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 52

Re: RFC: don't store backing filename in qcow2 image

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 12:44, Peter Krempa wrote: On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote: Hi all! Hi, I have an idea, that not storing backing filename in qcow2 image at all may be a good thing. I'll give some reasons and want to know what do you think about it.

Re: [libvirt PATCH v2 0/7] fix PCI vs PCIe detection when running libvirtd as root, but unprivileged

2020-12-11 Thread Michal Privoznik
On 12/11/20 4:47 PM, Laine Stump wrote: danpb had asked for some documentation on the changes to the APIs of internal functions in V1. I've added some standard function header docs in patches 5 & 6. Everything else is completely unchanged (and already reviewed by mprivozn). Laine Stump (7):

[libvirt PATCH v2 7/7] qemu: remove now-redundant check for file length when determining PCIe vs. PCI

2020-12-11 Thread Laine Stump
Now that virPCIDeviceIsPCIExpress() checks the length of the file when the process lacks sufficient privilege to read the entire PCI config file in sysfs, we can remove the open-coding for that case from its consumer. Signed-off-by: Laine Stump --- src/qemu/qemu_domain_address.c | 38

[libvirt PATCH v2 6/7] util: make virPCIDeviceIsPCIExpress() more intelligent

2020-12-11 Thread Laine Stump
Until now there has been an extra bit of code in qemuDomainDeviceCalculatePCIConnectFlag() (one of the two callers of virPCIDeviceIsPCIExpress()) that tries to determine if a device is PCIe by looking at the *length* of its sysfs config file; it only does this when libvirt is running as a non-root

[libvirt PATCH v2 5/7] util: change call sequence for virPCIDeviceFindCapabilityOffset()

2020-12-11 Thread Laine Stump
Previously there was no way to differentiate between this function 1) encountering an error while reading the pci config, and 2) determining that the device in question is a conventional PCI device, and so has no Express Capabilities. The difference between these two conditions is important,

[libvirt PATCH v2 4/7] util: make read error of PCI config file more detailed

2020-12-11 Thread Laine Stump
The new message is more verbose/useful, but only logged at debug level instead of as a warning (since it could easily happen in a non-error situation). Signed-off-by: Laine Stump --- src/util/virpci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virpci.c

[libvirt PATCH v2 2/7] util: simplify calling of virPCIDeviceDetectFunctionLevelReset()

2020-12-11 Thread Laine Stump
This function returned an int, and that int was being checked for < 0 in its solitary caller, but within the function it would only ever return 0 or 1. Change the function itself to return a bool, and the caller to just directly set the flag in the virPCIDevice. Signed-off-by: Laine Stump ---

[libvirt PATCH v2 3/7] util: simplify call to virPCIDeviceDetectPowerManagementReset()

2020-12-11 Thread Laine Stump
This function returned an int, but would only return 0 or 1, and the one place it was called would just use !! to convert that value to a bool. Change the function to directly return bool instead. Signed-off-by: Laine Stump --- src/util/virpci.c | 8 1 file changed, 4 insertions(+), 4

[libvirt PATCH v2 1/7] qemu: use g_autoptr for a virPCIDevice

2020-12-11 Thread Laine Stump
The one instance of a virPCIDevice in qemuDomainDeviceCalculatePCIConnectFlags() needs to be converted to use g_autoptr as a prerequisite for a bugfix. It's in this patch by itself (rather than in a patch converting all virPCIDevice usages to g_autoptr) to simplify any backport of said bugfix.

[libvirt PATCH v2 0/7] fix PCI vs PCIe detection when running libvirtd as root, but unprivileged

2020-12-11 Thread Laine Stump
danpb had asked for some documentation on the changes to the APIs of internal functions in V1. I've added some standard function header docs in patches 5 & 6. Everything else is completely unchanged (and already reviewed by mprivozn). Laine Stump (7): qemu: use g_autoptr for a virPCIDevice

Re: [PATCH] node_device: pacify grumpy coverity due to addr override

2020-12-11 Thread Michal Privoznik
On 12/11/20 3:46 PM, Boris Fiuczynski wrote: On 12/11/20 3:33 PM, Michal Privoznik wrote: On 12/10/20 6:32 PM, Boris Fiuczynski wrote: With commit 09364608b4 node_device: refactor address retrieval of node device "if-else if" was replaced by "switch". The contained break statement now is no

Re: [PATCH] node_device: pacify grumpy coverity due to addr override

2020-12-11 Thread Boris Fiuczynski
On 12/11/20 3:33 PM, Michal Privoznik wrote: On 12/10/20 6:32 PM, Boris Fiuczynski wrote: With commit 09364608b4 node_device: refactor address retrieval of node device "if-else if" was replaced by "switch". The contained break statement now is no longer in context of the for loop but instead

Re: [PATCH] node_device: pacify grumpy coverity due to addr override

2020-12-11 Thread Michal Privoznik
On 12/10/20 6:32 PM, Boris Fiuczynski wrote: With commit 09364608b4 node_device: refactor address retrieval of node device "if-else if" was replaced by "switch". The contained break statement now is no longer in context of the for loop but instead of the switch causing the legitimate grumpiness

Re: [libvirt PATCH 0/3] tests: Add capabilities for QEMU 5.2

2020-12-11 Thread Michal Privoznik
On 12/10/20 4:07 PM, Andrea Bolognani wrote: As usual, this is an abridged version of the changes. For the full version, run $ git fetch https://gitlab.com/abologna/libvirt.git caps-5.2 or browse https://gitlab.com/abologna/libvirt/-/commits/caps-5.2 Andrea Bolognani (3): tests:

Re: RFC PATCH: Issue 90

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 14:00:01 -0600, Ryan Gahagan wrote: > This is a request for comments on our patch for Issue 90. We didn't add > in the test yet because we've had a ton of trouble getting the testing > suite to work with our new test files, so they've omitted for now. We > also did not add

Re: RFC: don't store backing filename in qcow2 image

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote: > Hi all! Hi, > > I have an idea, that not storing backing filename in qcow2 image at all may > be a good thing. I'll give some reasons and want to know what do you think > about it. > > 1. Libvirt has to manage and

Re: [RFC PATCH 1/6] compatibilities: added in flags for NFS support

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 14:00:02 -0600, Ryan Gahagan wrote: In subject/summary. We don't have anything which we'd prefix with 'compatibilities:'. A better summary will be: conf: Add NFS disk protocol > Signed-off-by: Ryan Gahagan > --- > src/libxl/libxl_conf.c| 1 + > src/libxl/xen_xl.c

Re: [RFC PATCH 5/6] qemu: added NFS JSON props methods

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 14:00:06 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/qemu/qemu_block.c | 42 +- > src/qemu/qemu_domain.c | 42 ++ > 2 files changed, 83 insertions(+), 1 deletion(-) >

Re: [RFC PATCH 6/6] util: Added a backing store NFS parser

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 14:00:07 -0600, Ryan Gahagan wrote: > Signed-off-by: Ryan Gahagan > --- > src/util/virstoragefile.c | 42 +++ > 1 file changed, 42 insertions(+) > > diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c > index

Re: [RFC PATCH 2/6] util: Added nfs params to virStorageSource

2020-12-11 Thread Peter Krempa
On Fri, Dec 11, 2020 at 12:19:10 +0800, Han Han wrote: > On Fri, Dec 11, 2020 at 4:01 AM Ryan Gahagan wrote: > > > Signed-off-by: Ryan Gahagan > > --- > > src/util/virstoragefile.c | 8 > > src/util/virstoragefile.h | 5 + > > 2 files changed, 13 insertions(+) > > > > diff --git