Re: RFC: Qemu backup interface plans

2021-05-21 Thread Vladimir Sementsov-Ogievskiy
17.05.2021 15:07, Vladimir Sementsov-Ogievskiy wrote: 3.1 and make it possible to modify the bitmap externally, so that consumer of fleecing can say to backup-top filter: I've already copied these blocks, don't bother with copying them to temp image". This is to solve [2]. Still, how consumer

Re: Qemu block filter insertion/removal API

2021-05-21 Thread Vladimir Sementsov-Ogievskiy
21.05.2021 21:32, Vladimir Sementsov-Ogievskiy wrote: 19.05.2021 17:14, Vladimir Sementsov-Ogievskiy wrote: 19.05.2021 16:02, Kevin Wolf wrote: Am 19.05.2021 um 14:19 hat Vladimir Sementsov-Ogievskiy geschrieben: 19.05.2021 14:44, Kevin Wolf wrote: Am 17.05.2021 um 14:44 hat Vladimir

Re: Qemu block filter insertion/removal API

2021-05-21 Thread Vladimir Sementsov-Ogievskiy
19.05.2021 17:14, Vladimir Sementsov-Ogievskiy wrote: 19.05.2021 16:02, Kevin Wolf wrote: Am 19.05.2021 um 14:19 hat Vladimir Sementsov-Ogievskiy geschrieben: 19.05.2021 14:44, Kevin Wolf wrote: Am 17.05.2021 um 14:44 hat Vladimir Sementsov-Ogievskiy geschrieben: Hi all! I'd like to be sure

Re: [PATCH v1] libxl: remove libxl_domain_build_info_init from libxlMakeDomBuildInfo

2021-05-21 Thread Jim Fehlig
On 5/20/21 5:26 AM, Olaf Hering wrote: The used libxl_domain_build_info, which is contained in libxl_domain_config, is owned and already initialized by the caller. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Jim Fehlig diff

Re: [PATCH v2] libxl: adjust handling of libxl_device_disk objects

2021-05-21 Thread Jim Fehlig
On 5/20/21 4:17 AM, Olaf Hering wrote: libxl objects are supposed to be initialized and disposed. Correct the usage of libxl_device_disk objects which are allocated on the stack. Initialize each one prior usage, and dispose them once done. Adjust libxlMakeDisk to use an already initialized

Re: [PATCH v1] libxl: remove libxl_domain_create_info_init from libxlMakeDomCreateInfo

2021-05-21 Thread Jim Fehlig
On 5/20/21 4:58 AM, Olaf Hering wrote: The passed libxl_domain_create_info is owned, and already initialized, by the caller. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Jim Fehlig diff --git a/src/libxl/libxl_conf.c

Re: [PATCH v3] libxl: adjust handling of libxl_device_nic objects

2021-05-21 Thread Jim Fehlig
On 5/20/21 4:31 AM, Olaf Hering wrote: libxl objects are supposed to be initialized and disposed. Adjust libxlMakeNic to use an already initialized object, it is owned by the caller. Adjust libxlMakeNicList to initialize the list of objects, before they are filled by libxlMakeNic. In case of

[libvirt PATCH 4/4] qemu: adjust the maxmemlock limit when hotplugging a vDPA device

2021-05-21 Thread Laine Stump
and re-adjust if the hotplug fails. This fixes a bug found during testing of https://bugzilla.redhat.com/1939776, which was supposed to be resolved by commit 98e22ff749, but failed to account for the case of device hotplug. Signed-off-by: Laine Stump --- src/qemu/qemu_hotplug.c | 12

[libvirt PATCH 3/4] qemu_hotplug.c: add net devices to the domain list earlier

2021-05-21 Thread Laine Stump
An upcoming patch will be checking if the addition of a new net device requires adjusting the domain locked memory limit, which must be done prior to sending the command to qemu to add the new device. But qemuDomainAdjustMaxMemLock() checks all (and only) the devices that are currently in the

[libvirt PATCH 1/4] qemu_hotplug.c: don't skip cleanup on failures of qemuDomainAttachNetDevice

2021-05-21 Thread Laine Stump
We have many places where the earliest error returns from a function skip any cleanup label at the bottom (the assumption being that it is so early in the function that there isn't yet anything that needs to be explicitly undone on failure). But in general it is a bad sign if there are any direct

[libvirt PATCH 2/4] conf: new function virDomainNetRemoveByObj()

2021-05-21 Thread Laine Stump
virDomainNetRemove() requires the index of the net device you want to remove from the list, but in some cases you may not have the index handy, only the object itself (or the object may not have been added to the domain's list). virDomainNetRemoveByObj() first tries to find the given object in the

[libvirt PATCH 0/4] adjust max memlock limit when hotplugging a vDPA device

2021-05-21 Thread Laine Stump
see patch 4 for the why. Found during testing of https://bugzilla.redhat.com/1939776 Laine Stump (4): qemu_hotplug.c: don't skip cleanup on failures of qemuDomainAttachNetDevice conf: new function virDomainNetRemoveByObj() qemu_hotplug.c: add net devices to the domain list earlier

Re: [PATCH v2] conf: Report alias name of the detached device in error

2021-05-21 Thread Laine Stump
On 5/20/21 10:13 AM, Kristina Hanicova wrote: This is v2 from: https://listman.redhat.com/archives/libvir-list/2021-May/msg00481.html I have reworked the code a bit to have only one error report instead of multiple ones with different combinations of possible matching items. Suggested by Laine.

Re: [libvirt PATCH] Revert "qemuDomainSetNumaParamsLive: set nodeset for root cgroup"

2021-05-21 Thread Michal Prívozník
On 5/21/21 3:40 PM, Pavel Hrdina wrote: > This reverts commit <1b22dd6dd44202094e0f78f887cbe790c00e9ebc>. > > First of all, the reverted commit is incomplete. It only sets > cpuset.mems in the VM root cgroup when the API is used but there is no > code that would do the same when the VM is

RFC: qemu log permissions

2021-05-21 Thread Kristina Hanicova
Hello everyone, I came across this issue: https://gitlab.com/libvirt/libvirt/-/issues/71 and I would like your opinion on implementing support to define mode (maybe even user/group/other?) in config, which the qemu log files would be created with. In this case, it is desired so that this tool

Re: How to hot plugin a new vhost-user-blk-pci device to running VM?

2021-05-21 Thread 梁朝军
Thanks all of you for your help. One more question regarding vhost-user-blk-pci type device, how to identify a vhost-blk disk in QEUM VM ? for example, disk name looks like vda,vdb,..., but that some application in VM want to detect that a certain entry is really the device it is waiting

Re: [PATCH v2] Add SELinux policy for virt

2021-05-21 Thread Daniel P . Berrangé
On Fri, May 21, 2021 at 04:22:59PM +0200, Vit Mojzis wrote: > > On 4/30/21 10:28 PM, Vit Mojzis wrote: > > > > On 4/26/21 7:31 PM, Daniel P. Berrangé wrote: > > > On Wed, Apr 07, 2021 at 06:14:58AM -0700, Vit Mojzis wrote: > > > > Sorry for the long delay. This is our first request to ship a > >

Re: [PATCH v2] Add SELinux policy for virt

2021-05-21 Thread Vit Mojzis
On 4/30/21 10:28 PM, Vit Mojzis wrote: On 4/26/21 7:31 PM, Daniel P. Berrangé wrote: On Wed, Apr 07, 2021 at 06:14:58AM -0700, Vit Mojzis wrote: Sorry for the long delay. This is our first request to ship a policy for multiple selinux stores (targeted, mls and minimum). Changes: * Replace

Re: [PATCH] schema: Allow '0' offset for a of

2021-05-21 Thread Pavel Hrdina
On Fri, May 21, 2021 at 02:57:16PM +0200, Peter Krempa wrote: > Using slice to cut off the end of the image is a perfectly vaid > configuration. Use 'unsignedInt' instead of 'positiveInteger' for the > 'offset' attribute in the XML schema and modify one test case to cover > this use case. > >

[libvirt PATCH] Revert "qemuDomainSetNumaParamsLive: set nodeset for root cgroup"

2021-05-21 Thread Pavel Hrdina
This reverts commit <1b22dd6dd44202094e0f78f887cbe790c00e9ebc>. First of all, the reverted commit is incomplete. It only sets cpuset.mems in the VM root cgroup when the API is used but there is no code that would do the same when the VM is started. Libvirt never places any process into the VM

[PATCH] schema: Allow '0' offset for a of

2021-05-21 Thread Peter Krempa
Using slice to cut off the end of the image is a perfectly vaid configuration. Use 'unsignedInt' instead of 'positiveInteger' for the 'offset' attribute in the XML schema and modify one test case to cover this use case. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1960993 Signed-off-by:

[PATCH 10/35] qemu: Move bootindex usage logic into qemuBuildDiskDeviceStr

2021-05-21 Thread Peter Krempa
We can skip the formatting of the bootindex for floppies directly at the place where it's being formatted. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 23 --- src/qemu/qemu_command.h | 1 - src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 9 insertions(+), 17

[PATCH 31/35] qemuDomainAttachDiskGeneric: Pass the qemu async job type

2021-05-21 Thread Peter Krempa
The qemuDomainAttachDiskGeneric will also be used on startup for transient disks which share the overlay. The VM startup code passes the asyncJob around so we need to pass it into qemuDomainAttachDiskGeneric. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 23 ++-

[PATCH 30/35] qemuDomainAttachDiskGeneric: Implement hotplug of disk

2021-05-21 Thread Peter Krempa
Add code which creates the transient overlay after hotplugging the disk backend before attaching the disk frontend. The state of the topmost image is modified to be already read-only to prevent the need to open the image in read-write mode. Signed-off-by: Peter Krempa ---

[PATCH 21/35] qemuDomainAttachDeviceDiskLiveInternal: Simplify call to qemuDomainAttachDiskGeneric

2021-05-21 Thread Peter Krempa
We can call it in one place as all per-device-type subcases use the same code. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8d0ee1c659..33c6feea3e

[PATCH 32/35] qemuDomainAttachDiskGeneric: Export

2021-05-21 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_hotplug.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 03649634c5..b91cab08ac 100644 --- a/src/qemu/qemu_hotplug.c +++

[PATCH 35/35] tests: Add qemuxml2argv and qemuxml2xml test for

2021-05-21 Thread Peter Krempa
Signed-off-by: Peter Krempa --- .../disk-transient.x86_64-4.1.0.err | 2 +- .../disk-transient.x86_64-latest.args | 4 +- tests/qemuxml2argvdata/disk-transient.xml | 6 +++ .../disk-transient.x86_64-latest.xml | 48 +++ tests/qemuxml2xmltest.c

[PATCH 11/35] qemuxml2argvtest: Remove pointless tests for keywrapping on s390

2021-05-21 Thread Peter Krempa
There were two negative tests for the keywrapping feature on s390 when the feature flag was missing. For now both shared the error message thus worked fine, but with the upcoming patch to move some disk validation code from the command line formatter to validation code will change the error

[PATCH 33/35] conf: Introduce 'shareBacking' for disks

2021-05-21 Thread Peter Krempa
In case the user wants to share the disk image between multiple VMs the qemu driver needs to hotplug such disks to instantiate the backends. Since that doesn't work for all disk configs add a switch to force this behaviour. Signed-off-by: Peter Krempa --- docs/formatdomain.rst | 6

[PATCH 28/35] qemuDomainAttachDiskGeneric: Split up frontend and backend attachment

2021-05-21 Thread Peter Krempa
Split up the monitor contexts to attach the backend of the disk and the frontend device in preparation for hotplugging transient disks where we'll need to add the code for adding the transient overlay between these two steps. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 17

[PATCH 07/35] qemu: snapshot: move transient snapshot code to qemu_process

2021-05-21 Thread Peter Krempa
The code deals with the startup of the VM and just uses the snapshot code to achieve the desired outcome. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 61 +- src/qemu/qemu_snapshot.c | 82 +++-

[PATCH 23/35] qemu: hotplug: Move post-insertion steps of disk hotplug to qemuDomainAttachDeviceDiskLiveInternal

2021-05-21 Thread Peter Krempa
Move the auditing entry and insertion into the disk definition from the function which deals with qemu to 'qemuDomainAttachDeviceDiskLiveInternal' which deals with the hotplug related specifics. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 11 +++ 1 file changed, 7

[PATCH 27/35] qemuDomainAttachDiskGeneric: Refactor rollback handling

2021-05-21 Thread Peter Krempa
Modify the rollback section to use it's own monitor context so that we can later split up the hotplug into multiple steps and move the detachment of the extension device into the rollback section rather than doing it inline. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 28

[PATCH 34/35] qemu: Allow disks with images shared accross VMs

2021-05-21 Thread Peter Krempa
Implement this behaviour by skipping the disks on traditional commandline and hotplug them before resuming CPUs. That allows to use the support for hotplugging of transient disks which inherently allows sharing of the backing image as we open it read-only. This commit implements the validation

[PATCH 24/35] qemuDomainAttachDiskGeneric: Fix whitespace

2021-05-21 Thread Peter Krempa
Remove two empty lines. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9b7067110e..b1d3ee8e7a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -701,7 +701,6

[PATCH 17/35] qemuDomainRemoveDiskDevice: Move 'copy-on-read' handling to qemuBlockStorageSourceChainData

2021-05-21 Thread Peter Krempa
Unify the handling of the copy-on-read filter by changing the handling to use qemuBlockStorageSourceChainData. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[PATCH 19/35] qemuDomainAttachDeviceDiskLiveInternal: Absorb qemuDomainAttachVirtioDiskDevice

2021-05-21 Thread Peter Krempa
Move the specific device setup and address reservation code into the main hotplug helper as it's just one extra function call. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 32 1 file changed, 8 insertions(+), 24 deletions(-) diff --git

[PATCH 22/35] qemuDomainAttachDiskGeneric: Move setup of disk into qemuDomainAttachDeviceDiskLiveInternal

2021-05-21 Thread Peter Krempa
qemuDomainAttachDeviceDiskLiveInternal already sets up certain pieces of the disk definition so it's better suited to move the setup of the virStorageSource structs, granting access to the storage and allocation of the alias from qemuDomainAttachDiskGeneric which will be just handling the qemu

[PATCH 29/35] qemu: Track creation of disk overlay individually

2021-05-21 Thread Peter Krempa
In preparation for hotplug of disks we'll need to track whether the overlay file was created individually per-disk. Add 'transientOverlayCreated' to 'struct _qemuDomainDiskPrivate' and remove 'inhibitDiskTransientDelete' from 'qemuDomainObjPrivate' and adjust the code for the change.

[PATCH 26/35] qemuDomainAttachDiskGeneric: Move PR helper attach into qemuDomainAttachDeviceDiskLiveInternal

2021-05-21 Thread Peter Krempa
Similarly to previous refactors we want to move all hotplug related setup which isn't strictly relevant to attaching the disk into qemuDomainAttachDeviceDiskLiveInternal. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-)

[PATCH 25/35] qemuDomainAttachDiskGeneric: Refactor cleanup

2021-05-21 Thread Peter Krempa
Remove the 'ret' variable and 'cleanup' label in favor of directly returning the value since we don't have anything under the 'cleanup:' label. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff

[PATCH 20/35] qemuDomainAttachDeviceDiskLiveInternal: Absorb qemuDomainAttachSCSIDisk

2021-05-21 Thread Peter Krempa
Move the validation of the SCSI device address and the attachment of the controller into qemuDomainAttachDeviceDiskLiveInternal as there's no specific need for a special helper. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 69 - 1 file

[PATCH 15/35] qemuBlockStorageSourceChainData: Add handling of 'copy-on-read' filter layer

2021-05-21 Thread Peter Krempa
qemuBlockStorageSourceChainData encapsulates the backend of the disk for startup and hotplug operations. Add the handling for the copy-on-read filter so that the hotplug code doesn't need to have separate cleanup. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 12

[PATCH 16/35] qemuDomainAttachDiskGeneric: Move 'copy-on-read' handling to qemuBlockStorageSourceChainData

2021-05-21 Thread Peter Krempa
Fill in the required fields in qemuBlockStorageSourceChainData to handle the hotplug so that we can simplify the cleanup code. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git

[PATCH 18/35] qemuDomainAttachDeviceDiskLiveInternal: Absorb qemuDomainAttachUSBMassStorageDevice

2021-05-21 Thread Peter Krempa
Move the specific device setup and address reservation code into the main hotplug helper as it's just one extra function call. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 35 +++ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git

[PATCH 13/35] Replace virDomainDiskInsertPreAlloced by virDomainDiskInsert

2021-05-21 Thread Peter Krempa
Pre-extending the disk array size is pointless nowadays since we've switched to memory APIs which don't return failure. Switch all uses of reallocation of the array followed by 'virDomainDiskInsertPreAlloced' with direct virDomainDiskInsert. Signed-off-by: Peter Krempa ---

[PATCH 14/35] conf: remove virDomainDiskInsertPreAlloced

2021-05-21 Thread Peter Krempa
Replace the last use of the function by virDomainDiskInsert and remove the unused helper. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 16 ++-- src/conf/domain_conf.h | 2 -- src/libvirt_private.syms | 1 - 3 files changed, 2 insertions(+), 17 deletions(-) diff

[PATCH 12/35] qemu: Move iothread and s390 address validation for disk devices into the validator

2021-05-21 Thread Peter Krempa
The "machine-loadparm-multiple-disks-nets-s390" case now requires the QEMU_CAPS_CCW feature to pass validation. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 50 src/qemu/qemu_validate.c | 49 +++

[PATCH 09/35] qemu: Move 'bootindex' handling for disks out of command line formatter

2021-05-21 Thread Peter Krempa
The logic assigning the bootindices from the legacy boot orded configuration was spread through the command line formatters for the disk device and for the floppy controller. This patch adds 'effectiveBootindex' property to the disk private data which holds the calculated boot index and moves the

[PATCH 05/35] qemuSnapshotDiskPrepareOne: Use data from qemuSnapshotDiskContext

2021-05-21 Thread Peter Krempa
Remove all the arguments which are present in qemuSnapshotDiskContext. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index

[PATCH 06/35] qemuSnapshotDiskCreate: Use 'cfg' from the qemuSnapshotDiskContext

2021-05-21 Thread Peter Krempa
We store the virQEMUDriverConfig object in the context. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 0a93621b75..8855a019cb 100644 ---

[PATCH 08/35] qemu_snapshot: Add the guest name to the transient disk path

2021-05-21 Thread Peter Krempa
From: Masayoshi Mizuma Later patches will implement sharing of the backing file, so we'll need to be able to discriminate the overlays per VM. Signed-off-by: Masayoshi Mizuma Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 2 +- src/qemu/qemu_snapshot.c | 6 --

[PATCH 03/35] qemuSnapshotDiskPrepareOne: Pass in qemuSnapshotDiskContext

2021-05-21 Thread Peter Krempa
Rather than filling various parts of the context from arguments pass in the whole context. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c

[PATCH 04/35] qemuSnapshotDiskContext: Store virQEMUDriverConfig in the struct

2021-05-21 Thread Peter Krempa
The config is used both with the preparation and execution functions, so we can store it in the context to simplify other helpers. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_snapshot.c

[PATCH 00/35] qemu: Implement support for transient disk hotplug and backing store sharing

2021-05-21 Thread Peter Krempa
This series refactors the qemu disk hotplug code so that it can be easily extended for hotplug of transient disks and then also used at startup to plug in disks where the users want to share the backing image. Masayoshi Mizuma (1): qemu_snapshot: Add the guest name to the transient disk path

[PATCH 01/35] qemu: snapshot: Extract setup of snapshot disk definition for transient disks

2021-05-21 Thread Peter Krempa
The code will be later reused when adding support for sharing the backing image of the snapshot. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_snapshot.c

[PATCH 02/35] qemu: process: Setup transient disks only when starting a fresh VM

2021-05-21 Thread Peter Krempa
Creating the overlay for the disk is needed when starting a new VM only. Additionally for now migration with transient disks is forbidden anyways. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

Re: [PATCH v3 2/3] conf: Parse/format XML input type 'evdev'

2021-05-21 Thread Michal Prívozník
On 5/21/21 1:01 PM, Kristina Hanicova wrote: > Signed-off-by: Kristina Hanicova > --- > docs/formatdomain.rst| 37 - > docs/schemas/domaincommon.rng| 20 +++ > src/conf/domain_audit.c | 1 + > src/conf/domain_conf.c

Re: [PATCH 0/2] qemu: auto-create with defined permissions

2021-05-21 Thread Michal Prívozník
On 5/21/21 1:41 PM, Kristina Hanicova wrote: > > Kristina Hanicova (2): > qemu: Use qemuDomainOpenFile() in qemuPrepareNVRAM() > qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent > > src/qemu/qemu_domain.c | 2 +- > src/qemu/qemu_process.c | 21 +++-- > 2 files

Re: [PATCH v3 0/3] Introduce

2021-05-21 Thread Michal Prívozník
On 5/21/21 1:01 PM, Kristina Hanicova wrote: > This is v3 from: > https://listman.redhat.com/archives/libvir-list/2021-May/msg00324.html > > v1 here: > https://listman.redhat.com/archives/libvir-list/2021-April/msg01307.html > > Diff to v2: > - Fixed formatting > - Enable xml test call > >

Re: [libvirt PATCH v2 2/2] storage_file: add support to probe cluster_size from QCOW2 images

2021-05-21 Thread Pavel Hrdina
On Fri, May 21, 2021 at 09:40:21AM +0200, Peter Krempa wrote: > On Thu, May 20, 2021 at 17:14:32 +0200, Pavel Hrdina wrote: > > >From QEMU docs/interop/qcow2.txt : > > > >Byte 20 - 23: cluster_bits > > Number of bits that are used for addressing an offset > >

[PATCH 1/2] qemu: Use qemuDomainOpenFile() in qemuPrepareNVRAM()

2021-05-21 Thread Kristina Hanicova
Previously, nvram file was created with user/group owner as 'root', rather than specifications defined in libvirtd.conf. The solution is to call qemuDomainOpenFile(), which creates file with defined permissions and qemuSecurityDomainSetPathLabel() to set security label for created nvram file.

[PATCH 2/2] qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent

2021-05-21 Thread Kristina Hanicova
The description of the function says that the return value is a file descriptor on success and negative errno on failure which is not true. If the 'if' case with check on security labels fails, the return value is -1 not -errno. The solution is to return '-EINVAL' instead. Signed-off-by: Kristina

[PATCH 0/2] qemu: auto-create with defined permissions

2021-05-21 Thread Kristina Hanicova
Kristina Hanicova (2): qemu: Use qemuDomainOpenFile() in qemuPrepareNVRAM() qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_process.c | 21 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) -- 2.31.1

[PATCH v3 3/3] qemu: Build command line for object input-linux

2021-05-21 Thread Kristina Hanicova
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/142 Signed-off-by: Kristina Hanicova --- src/qemu/qemu_command.c | 32 - .../input-linux.x86_64-latest.args| 34 +++ tests/qemuxml2argvtest.c | 2 ++ 3

[PATCH v3 2/3] conf: Parse/format XML input type 'evdev'

2021-05-21 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/formatdomain.rst| 37 - docs/schemas/domaincommon.rng| 20 +++ src/conf/domain_audit.c | 1 + src/conf/domain_conf.c | 69 src/conf/domain_conf.h

[PATCH v3 0/3] Introduce

2021-05-21 Thread Kristina Hanicova
This is v3 from: https://listman.redhat.com/archives/libvir-list/2021-May/msg00324.html v1 here: https://listman.redhat.com/archives/libvir-list/2021-April/msg01307.html Diff to v2: - Fixed formatting - Enable xml test call Kristina Hanicova (3): qemu_capabilities: Add QEMU_CAPS_INPUT_LINUX

[PATCH v3 1/3] qemu_capabilities: Add QEMU_CAPS_INPUT_LINUX

2021-05-21 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 +

Re: [PATCH v2 1/4] Add SELinux policy for virt

2021-05-21 Thread Vit Mojzis
On 4/28/21 11:29 AM, Daniel P. Berrangé wrote: On Wed, Apr 28, 2021 at 10:48:09AM +0200, Vit Mojzis wrote: On 4/26/21 7:39 PM, Daniel P. Berrangé wrote: On Wed, Apr 07, 2021 at 07:08:34AM -0700, Vit Mojzis wrote: From: Nikola Knazekova SELinux policy was created for: Hypervisor drivers:

Re: [PATCH 4/4] conf: Deduplicate NUMA distance code

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:24:56 +0200, Michal Privoznik wrote: > After previous patches we have two structures: > virCapsHostNUMACellDistance and virNumaDistance which express the > same thing. And have the exact same members (modulo their names). > Drop the former in favor of the latter. > >

Re: [PATCH 3/4] numa_conf: Expose virNumaDistance formatter

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:24:55 +0200, Michal Privoznik wrote: > Expose virNumaDistance XML formatter so that it can be re-used by > other parts of the code. > > Signed-off-by: Michal Privoznik > --- > src/conf/numa_conf.c | 47 +--- >

Re: [PATCH 2/4] numa_conf: Rename virDomainNumaDistance to virNumaDistance

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:24:54 +0200, Michal Privoznik wrote: > There's nothing domain specific about NUMA distances. Rename the > virDomainNumaDistance structure to just virNumaDistance. > > Signed-off-by: Michal Privoznik > --- > src/conf/numa_conf.c | 22 +++--- > 1 file

Re: [PATCH 1/4] capabilities: Rename siblings to distances

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:24:53 +0200, Michal Privoznik wrote: > The virCapsHostNUMACellSiblingInfo structure really represents > distance to other NUMA node. Rename the structure and variables > of that type to make it more obvious. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt PATCH v2 1/2] storage: add support for QCOW2 cluster_size option

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:14:31 +0200, Pavel Hrdina wrote: > The default value hard-coded in QEMU (64KiB) is not always the ideal. > Having a possibility to set the cluster_size by user may in specific > use-cases improve performance for QCOW2 images. > > QEMU internally has some limits, the

Re: [libvirt PATCH v2 2/2] storage_file: add support to probe cluster_size from QCOW2 images

2021-05-21 Thread Peter Krempa
On Thu, May 20, 2021 at 17:14:32 +0200, Pavel Hrdina wrote: > >From QEMU docs/interop/qcow2.txt : > >Byte 20 - 23: cluster_bits > Number of bits that are used for addressing an offset > within a cluster (1 << cluster_bits is the cluster size). > >

Re: [PATCH v2] conf: Report alias name of the detached device in error

2021-05-21 Thread Michal Prívozník
On 5/20/21 4:13 PM, Kristina Hanicova wrote: > This is v2 from: > https://listman.redhat.com/archives/libvir-list/2021-May/msg00481.html This is something we usually put [1] > > I have reworked the code a bit to have only one error report > instead of multiple ones with different combinations

Re: [PATCH] qemu: Add check for needed paths for memory devices

2021-05-21 Thread Michal Prívozník
On 5/20/21 4:29 PM, Kristina Hanicova wrote: > When building a commandline for a DIMM memory device with > non-default access mode, the qemuBuildMemoryBackendProps() will > tell QEMU to allocate memory from per-domain memory backing dir. > But later, when preparing the host, the >