[libvirt PATCH] qemu_hotplug: don't forget to add hostdev interfaces to the interface list

2021-06-16 Thread Laine Stump
Originally qemuDomainAttachNetDevice() would wait until the cleanup at the very end of the function to add newly hotplugged interfaces to the domain's nets list. commit 7b8bec4560 modified it to add the new interface to the nets list earlier (but not all the way at the beginning of the function

[PATCH] ch_domain: Add handler for virDomainDeviceDefPostParseCallback

2021-06-16 Thread William Douglas
Instead of trying to match devices passed in based on the monitor detecting the number of devices that were used in the domain definition, use the devicesPostParseCallback to evaluate if unsupported devices are used. This allows the compiler to detect when new device types are added that need to

Re: [PATCH v1] meson: fix xenstore and xentoollog detection

2021-06-16 Thread Jim Fehlig
On 6/16/21 8:50 AM, Olaf Hering wrote: Am Mon, 14 Jun 2021 14:38:19 +0100 schrieb Daniel P. Berrangé : Based on this policy, it is clear that the Xen minimum should be 4.9 based on version information we can see for the distros. Just to wrap up here: The LIBXL_API_VERSION needs to stay at

Re: [PATCH 1/3] Apparmor: Add profile for virtqemud

2021-06-16 Thread Jim Fehlig
On 6/16/21 11:23 AM, Christian Boltz wrote: Hello, [I'm not subscribed to the libvirt list, please CC me in replies] Am Mittwoch, 16. Juni 2021, 05:41:02 CEST schrieb Jim Fehlig: diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu index 85c9e61d6c..990bb0b2ba

Re: [PATCH 0/3] Apparmor: Add profiles for hypervisor daemons

2021-06-16 Thread Jim Fehlig
On 6/16/21 11:21 AM, Christian Boltz wrote: Hello, [I'm not subscribed to the libvirt list, please CC me in replies] Am Mittwoch, 16. Juni 2021, 05:41:01 CEST schrieb Jim Fehlig: This series is a first attempt at creating apparmor profiles for the modular daemons. It introduces profiles for

Re: [PATCH v1] meson: fix xenstore and xentoollog detection

2021-06-16 Thread Olaf Hering
Am Wed, 16 Jun 2021 14:30:45 -0600 schrieb Jim Fehlig : > Opinions? I'm fine with that patch. Olaf pgp5cUqM_Fjad.pgp Description: Digitale Signatur von OpenPGP

Re: [PATCH] qemu: Don't set NVRAM label when creating it

2021-06-16 Thread Daniel Henrique Barboza
On 6/9/21 12:19 PM, Michal Privoznik wrote: The NVRAM label is set in qemuSecuritySetAllLabel(). There's no need to set its label upfront. In fact, setting it twice creates an imbalance because it's unset only once which mangles seclabel remembering. However, plain removal of the

[PATCH 1/1] domain_validate.c: fix virDomainDefFSValidate() when fs->dst is NULL

2021-06-16 Thread Daniel Henrique Barboza
Commit 56dcdec1ac81 ("conf: reject duplicate virtiofs tags") added validation code to reject duplicated virtiofs tags. But the element is not always present, meaning that fs->dst can be NULL at that point. If there is no "" tag then the validation will fail in virHashAddEntry() because fs->dst

Re: Add options to device xml to skip reattach of pci passthrough devices.

2021-06-16 Thread Daniel Henrique Barboza
On 6/9/21 4:38 PM, Manish Mishra wrote: Hi Everyone, We want to add extra options to device xml to skip reattach of pci passthrough devices. Following is xml format for pci passthrough devices added to domain as of now.       When we pass managed=’yes’ flag through xml,

Re: [libvirt PATCHv2 2/2] conf: require target for external virtiofsd

2021-06-16 Thread Boris Fiuczynski
On 6/16/21 5:09 PM, Ján Tomko wrote: When adding support for externally launched virtiofsd, I was too liberal and did not require a target. But the target is required, because it's passed to the QEMU device, not to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=1969232 Fixes:

Re: Migration capabilities is not reset after the libvirtd service restart

2021-06-16 Thread Daniel Henrique Barboza
On 6/11/21 9:40 AM, Huangzhichao wrote: Hi Everyone, We find migration capabilities is not reset after restarting libvirtd, it would cause problem in the following scene: Version: libvirt release 7.4.0 Step 1.  create a VM and query migration capabilities, mark the return content as “Cap

Re: [libvirt PATCHv2 1/2] conf: move filesystem target validation

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 17:09:06 +0200, Ján Tomko wrote: > Check the presence of the target in the validation phase. > > Signed-off-by: Ján Tomko > --- > src/conf/domain_conf.c | 6 -- > src/conf/domain_validate.c | 8 > 2 files changed, 8 insertions(+), 6 deletions(-)

Re: [libvirt PATCHv2 2/2] conf: require target for external virtiofsd

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 17:09:07 +0200, Ján Tomko wrote: > When adding support for externally launched virtiofsd, > I was too liberal and did not require a target. > > But the target is required, because it's passed to the > QEMU device, not to virtiofsd. > >

[libvirt PATCHv2 2/2] conf: require target for external virtiofsd

2021-06-16 Thread Ján Tomko
When adding support for externally launched virtiofsd, I was too liberal and did not require a target. But the target is required, because it's passed to the QEMU device, not to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=1969232 Fixes: 12967c3e1333a6e106110f449ccb1e96279b9527

[libvirt PATCHv2 1/2] conf: move filesystem target validation

2021-06-16 Thread Ján Tomko
Check the presence of the target in the validation phase. Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 6 -- src/conf/domain_validate.c | 8 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt PATCHv2 0/2] Small virtiofs fixes (virtio-fs epopee)

2021-06-16 Thread Ján Tomko
Ján Tomko (2): conf: move filesystem target validation conf: require target for external virtiofsd docs/formatdomain.rst | 1 + docs/kbase/virtiofs.rst | 1 + src/conf/domain_conf.c| 6 -- src/conf/domain_validate.c

[PATCH 5/7] qemuSnapshotPrepareDiskExternal: Refactor existing file check

2021-06-16 Thread Peter Krempa
Use the snapshot disk type from the definition now that we validate that it matches. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index

[PATCH 2/7] qemuSnapshotPrepareDiskExternal: Avoid condition squashing

2021-06-16 Thread Peter Krempa
Separate the 'else if' branches into nested conditions so that it's more obvious when we'll be adding additional checks later. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git

[PATCH 7/7] qemuSnapshotCreateActiveExternal: Don't unlink memory snapshot image if it was existing before

2021-06-16 Thread Peter Krempa
When writing the memory snapshot into an existing file don't remove it if the snapshot fails later. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index

[PATCH 6/7] conf: snapshot: rename variable holding memory snapshot file location

2021-06-16 Thread Peter Krempa
'file' is too generic to know what's going on. Rename it to 'memorysnapshotfile'. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 10 +- src/conf/snapshot_conf.h | 2 +- src/qemu/qemu_snapshot.c | 8 3 files changed, 10 insertions(+), 10 deletions(-) diff --git

[PATCH 3/7] qemuSnapshotPrepareDiskExternal: Reject creation of block devices sooner

2021-06-16 Thread Peter Krempa
In case when the snapshot target is of VIR_STORAGE_TYPE_BLOCK type and doesn't exist libvirt won't be able to create it. Reject such a config sooner. 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 4/7] qemuSnapshotPrepareDiskExternal: Enforce match between snapshot type and existing file type

2021-06-16 Thread Peter Krempa
The code executed later when creating a snapshot makes all decisions based on the configured type rather than the actual type of the existing file, while the check whether the file exists is based solely on the on-disk type. Since a block device is allowed to exist even when not reusing existing

[PATCH 1/7] qemuSnapshotPrepareDiskExternal: Move temp variables into the block using them

2021-06-16 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 29e86342d6..67180a2b10 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -541,9

[PATCH 0/7] qemu: snapshot: Fix removal of output files on failure

2021-06-16 Thread Peter Krempa
Peter Krempa (7): qemuSnapshotPrepareDiskExternal: Move temp variables into the block using them qemuSnapshotPrepareDiskExternal: Avoid condition squashing qemuSnapshotPrepareDiskExternal: Reject creation of block devices sooner qemuSnapshotPrepareDiskExternal: Enforce match

Re: [PATCH v1] meson: fix xenstore and xentoollog detection

2021-06-16 Thread Olaf Hering
Am Mon, 14 Jun 2021 14:38:19 +0100 schrieb Daniel P. Berrangé : > Based on this policy, it is clear that the Xen minimum should be > 4.9 based on version information we can see for the distros. Just to wrap up here: The LIBXL_API_VERSION needs to stay at 4.5, because this is the only thing

Re: [libvirt PATCH 3/3] conf: reject duplicate virtiofs tags

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 15:58:32 +0200, Ján Tomko wrote: > https://gitlab.com/libvirt/libvirt/-/issues/178 > > Signed-off-by: Ján Tomko > --- > src/conf/domain_validate.c | 30 ++ > 1 file changed, 30 insertions(+) Reviewed-by: Peter Krempa

Re: [libvirt PATCH 2/3] docs: fix filesystem schema indentation

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 15:58:31 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > docs/schemas/domaincommon.rng | 32 > 1 file changed, 16 insertions(+), 16 deletions(-) Reviewed-by: Peter Krempa

Re: [libvirt PATCH 1/3] conf: require target for external virtiofsd

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 15:58:30 +0200, Ján Tomko wrote: > When adding support for externally launched virtiofsd, > I was too liberal and did not require a target. > > But the target is required, because it's passed to the > QEMU device, not to virtiofsd. > >

[libvirt PATCH 3/3] conf: reject duplicate virtiofs tags

2021-06-16 Thread Ján Tomko
https://gitlab.com/libvirt/libvirt/-/issues/178 Signed-off-by: Ján Tomko --- src/conf/domain_validate.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 98202a3adc..9422b00964 100644 ---

[libvirt PATCH 2/3] docs: fix filesystem schema indentation

2021-06-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- docs/schemas/domaincommon.rng | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 233805cb66..5ea14b6dbf 100644 --- a/docs/schemas/domaincommon.rng

[libvirt PATCH 1/3] conf: require target for external virtiofsd

2021-06-16 Thread Ján Tomko
When adding support for externally launched virtiofsd, I was too liberal and did not require a target. But the target is required, because it's passed to the QEMU device, not to virtiofsd. https://bugzilla.redhat.com/show_bug.cgi?id=1969232 Fixes: 12967c3e1333a6e106110f449ccb1e96279b9527

[libvirt PATCH 0/3] Small virtiofs fixes (virtio-fs epopee)

2021-06-16 Thread Ján Tomko
Today we fix a bug: https://bugzilla.redhat.com/show_bug.cgi?id=1969232 and an issue: https://gitlab.com/libvirt/libvirt/-/issues/178 Ján Tomko (3): conf: require target for external virtiofsd docs: fix filesystem schema indentation conf: reject duplicate virtiofs tags

Re: [libvirt PATCH 6/7] nodedev: Implement virNodeDeviceIsPersistent()/IsActive()

2021-06-16 Thread Boris Fiuczynski
On 6/14/21 10:46 PM, Jonathon Jongsma wrote: On Mon, Jun 14, 2021 at 12:27 PM Boris Fiuczynski wrote: On 6/3/21 10:11 PM, Jonathon Jongsma wrote: Implement these new API functions in the nodedev driver. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 50

Re: [PATCH] ci: Also perform `brew upgrade` on MacOS

2021-06-16 Thread Andrea Bolognani
On Tue, Jun 15, 2021 at 12:43:39PM +0200, Martin Kletzander wrote: > ci: Also perform `brew upgrade` on MacOS s/MacOS/macOS/ But see below for why we might have to change the subject even further. > @Andrea: if you have a good explanation you'd like to put in the commit > message, > I'd me

[libvirt] [PATCH v2 4/5] virsh-volume: Apply virshStorageVolKeyCompleter to vol-{name, pool} commands

2021-06-16 Thread Lin Ma
Signed-off-by: Lin Ma --- tools/virsh-volume.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 41b366a833..daa205ea67 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -1552,11 +1552,7 @@ static

[libvirt] [PATCH v2 2/5] virsh-volume: Introduce virshStorageVolKeyCompleter

2021-06-16 Thread Lin Ma
Signed-off-by: Lin Ma --- tools/virsh-completer-volume.c | 47 ++ tools/virsh-completer-volume.h | 5 2 files changed, 52 insertions(+) diff --git a/tools/virsh-completer-volume.c b/tools/virsh-completer-volume.c index 301ee982a5..a29c5eca41 100644 ---

[libvirt] [PATCH v2 0/5] virsh bash completion improvement

2021-06-16 Thread Lin Ma
v1 -> v2: * 01-08 were merged, So remove them. * Reworked virshStorageVolKeyCompleter to avoid leaking objects. Thanks to Michal Privoznik for helping reviewing these patches. Lin Ma (5): virsh-pool: Remove static from virshStoragePoolList{Free,Collect} virsh-volume: Introduce

[libvirt] [PATCH v2 3/5] virsh-volume: Add macros VIRSH_COMMON_OPT_VOL_*

2021-06-16 Thread Lin Ma
Signed-off-by: Lin Ma --- tools/virsh-volume.c | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index c7d5ab8c3b..41b366a833 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@

[libvirt] [PATCH v2 1/5] virsh-pool: Remove static from virshStoragePoolList{Free, Collect}

2021-06-16 Thread Lin Ma
The functions will be used by next patch. Signed-off-by: Lin Ma --- tools/virsh-pool.c | 10 ++ tools/virsh-pool.h | 11 +++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 34ed86152e..18f3839a4c 100644 ---

[libvirt] [PATCH v2 5/5] virsh-volume: Apply virshStorageVolNameCompleter to vol-{key, path} commands

2021-06-16 Thread Lin Ma
Signed-off-by: Lin Ma --- tools/virsh-volume.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index daa205ea67..1da9b7217f 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -1643,11 +1643,7 @@ static

Re: [libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found

2021-06-16 Thread Peter Krempa
On Wed, Jun 16, 2021 at 10:00:16 +0100, Lee Yarwood wrote: > On Tue, 15 Jun 2021 at 09:28, Peter Krempa wrote: > > > > On Mon, Jun 14, 2021 at 11:18:37 +0100, Lee Yarwood wrote: > > > 126db34a81bc9f9f9710408f88cceaa1e34bbbd7 had previously switched various > > > flows over to this from

Re: set custom loglevel for external libraries

2021-06-16 Thread Daniel P . Berrangé
On Wed, Jun 16, 2021 at 12:19:16PM +0200, Olaf Hering wrote: > In src/libxl/libxl_conf.c:libxlDriverConfigInit, virLogGetDefaultPriority > is used to specify the (private) loglevel of an external library. This > value could be controlled via "log_level=N" in libvirtd.conf. But doing > it that way

set custom loglevel for external libraries

2021-06-16 Thread Olaf Hering
In src/libxl/libxl_conf.c:libxlDriverConfigInit, virLogGetDefaultPriority is used to specify the (private) loglevel of an external library. This value could be controlled via "log_level=N" in libvirtd.conf. But doing it that way will affect libvirtd itself, instead of libxenlight.so as

Re: [PATCH] test_driver: Implement virDomainGetMessages

2021-06-16 Thread Luke Yue
On Tue, 2021-06-15 at 10:09 +0200, Martin Kletzander wrote: > On Mon, Jun 14, 2021 at 09:13:17PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > src/test/test_driver.c | 53 > > ++ > > 1 file changed, 53 insertions(+) > > > > Similarly to

Re: [PATCH] test_driver: Implement virDomainGetSecurityLabelList

2021-06-16 Thread Luke Yue
On Tue, 2021-06-15 at 10:08 +0200, Martin Kletzander wrote: > On Mon, Jun 14, 2021 at 09:12:57PM +0800, Luke Yue wrote: > > Signed-off-by: Luke Yue > > --- > > src/test/test_driver.c | 41 > > + > > 1 file changed, 41 insertions(+) > > > > This patch looks

Re: [libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found

2021-06-16 Thread Lee Yarwood
On Tue, 15 Jun 2021 at 09:28, Peter Krempa wrote: > > On Mon, Jun 14, 2021 at 11:18:37 +0100, Lee Yarwood wrote: > > 126db34a81bc9f9f9710408f88cceaa1e34bbbd7 had previously switched various > > flows over to this from VIR_ERR_OPERATION_FAILED. > > > > This change simply does the same for

Re: [libvirt] [PATCH v2 0/5] virsh bash completion improvement

2021-06-16 Thread Michal Prívozník
On 6/16/21 10:02 AM, Lin Ma wrote: > v1 -> v2: > * 01-08 were merged, So remove them. > * Reworked virshStorageVolKeyCompleter to avoid leaking objects. > > Thanks to Michal Privoznik for helping reviewing these patches. > > Lin Ma (5): > virsh-pool: Remove static from

Re: [libvirt] [PATCH v2 2/5] virsh-volume: Introduce virshStorageVolKeyCompleter

2021-06-16 Thread Michal Prívozník
On 6/16/21 10:02 AM, Lin Ma wrote: > Signed-off-by: Lin Ma > --- > tools/virsh-completer-volume.c | 47 ++ > tools/virsh-completer-volume.h | 5 > 2 files changed, 52 insertions(+) > > diff --git a/tools/virsh-completer-volume.c

[PATCH 3/3] Apparmor: Add profile for virtxend

2021-06-16 Thread Jim Fehlig
A new apparmor profile derived from the libvirtd profile, with non-Xen related rules removed. Signed-off-by: Jim Fehlig --- src/security/apparmor/meson.build | 1 + src/security/apparmor/usr.sbin.virtxend.in | 78 ++ 2 files changed, 79 insertions(+) diff --git

[PATCH 1/3] Apparmor: Add profile for virtqemud

2021-06-16 Thread Jim Fehlig
A new apparmor profile derived from the libvirtd profile, with non-QEMU related rules removed. Adopt the libvirt-qemu abstraction to work with the new profile. Signed-off-by: Jim Fehlig --- src/security/apparmor/libvirt-qemu | 6 + src/security/apparmor/meson.build | 1 +

[PATCH 0/3] Apparmor: Add profiles for hypervisor daemons

2021-06-16 Thread Jim Fehlig
This series is a first attempt at creating apparmor profiles for the modular daemons. It introduces profiles for virt{lxc,qemu,xen}d, which AFAIK are the only hypervisors supported by apparmor. The profiles are copies of the libvirtd profile, with all the non hypervisor-specific rules removed.

[PATCH 2/3] Apparmor: Add profile for virtlxcd

2021-06-16 Thread Jim Fehlig
A new apparmor profile derived from the libvirtd profile, with non-LXC related rules removed. Adopt the libvirt-lxc abstraction to work with the new profile. Signed-off-by: Jim Fehlig --- src/security/apparmor/libvirt-lxc | 4 +- src/security/apparmor/meson.build | 1 +

Re: [PATCH 2/3] tests: qemuxml2*: Add QEMU_CAPS_EGL_HEADLESS to fake-caps tests using egl-headless graphics

2021-06-16 Thread Thomas Huth
On 15/06/2021 18.04, Peter Krempa wrote: Next commit will modify the code so that it validates whether egl-headless is present. Certain tests need to get the egl-headless capability to keep working properly. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 9 ++---

Re: [PATCH 1/3] qemu: capabilities: Un-retire QEMU_CAPS_EGL_HEADLESS

2021-06-16 Thread Thomas Huth
On 15/06/2021 18.04, Peter Krempa wrote: egl-headless graphics can be compiled out in qemu so we need to be able to know whether the given qemu version support it. Base the capability on the presence of the 'egl-headless' member in 'query-display-options' or imply it if 'query-display-options'

Re: [PATCH] gitlab-ci: Don't build docs in 'sanitizer' jobs

2021-06-16 Thread Tim Wiederhake
On Tue, 2021-06-15 at 17:45 +0200, Peter Krempa wrote: > Docs are not sanitized, thus there's no point in building them. > > Signed-off-by: Peter Krempa Reviewed-by: Tim Wiederhake > --- >  .gitlab-ci.yml | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/.gitlab-ci.yml

Re: [PATCH 3/3] qemu: capabilities: Fill SDL graphics support only when it's really supported

2021-06-16 Thread Peter Krempa
On Tue, Jun 15, 2021 at 21:40:16 +0200, Thomas Huth wrote: > On 15/06/2021 18.05, Peter Krempa wrote: > > virQEMUCapsFillDomainDeviceGraphicsCaps fills data needed both for > > validation of the graphics type and also for correct display in the > > (dom)capablities XML. > > > > Signal the support