Re: [libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Michal Prívozník
On 8/30/19 5:19 PM, Daniel P. Berrangé wrote: > On Fri, Aug 30, 2019 at 05:08:52PM +0200, Michal Privoznik wrote: >> On 8/30/19 2:30 PM, Roman Kagan wrote: >>> On Fri, Aug 30, 2019 at 10:09:06AM +0100, Daniel P. Berrangé wrote: On Fri, Aug 30, 2019 at 08:44:03AM +, Nikolay Shirokovskiy

Re: [libvirt] Fwd: libvirtd failing on MacOS in setgroups

2019-08-30 Thread Bruno Haible
Hi Eric, > I wonder if gnulib could provide a workaround setgroups() that overcomes > this issue I don't see how a workaround could look like. The problem is not the value of NGROUPS_MAX in user-space, but the same value NGROUPS_MAX in the kernel. More precisely, in the Darwin kernel file

[libvirt] [PATCH v2 09/10] tests: Introduce resolution test for Bochs model

2019-08-30 Thread jcfaracco
From: Julio Faracco New test case was added to cover 'xres' and 'yres' properties for Bochs model due to latest QEMU version. Signed-off-by: Julio Faracco --- ...ochs-display-resolution.x86_64-latest.args | 35 +++ .../video-bochs-display-resolution.xml| 33

[libvirt] [PATCH v2 07/10] tests: Introduce resolution test for QXL model

2019-08-30 Thread jcfaracco
From: Julio Faracco New test case was added to cover 'xres' and 'yres' properties for QXL model due to latest QEMU version. Signed-off-by: Julio Faracco --- .../video-qxl-resolution.x86_64-latest.args | 35 +++ .../qemuxml2argvdata/video-qxl-resolution.xml | 33

[libvirt] [PATCH v2 01/10] docs: Adding 'xres' and 'yres' into video XML definition

2019-08-30 Thread jcfaracco
From: Julio Faracco This commit adds resolution element with parameters 'x' and 'y' into video XML domain group definition. Both, properties were added into an element called 'resolution' and it was added inside 'model' element. They are set as optional. This element does not follow QEMU

[libvirt] [PATCH v2 04/10] qemu: Include {xres, yres} for QEMU command line

2019-08-30 Thread jcfaracco
From: Julio Faracco Display devices can use now properties 'xres' and 'yres' by QEMU command line. Only models specified by their QEMU capabilities. This commit includes VGA, QXL, Virtio and Bochs. Signed-off-by: Julio Faracco --- src/qemu/qemu_command.c | 20 1 file

[libvirt] [PATCH v2 10/10] tests: Introduce resolution test for VGA model

2019-08-30 Thread jcfaracco
From: Julio Faracco New test case was added to cover 'xres' and 'yres' properties for VGA model due to latest QEMU version. Signed-off-by: Julio Faracco --- tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/qemuxml2argvtest.c

[libvirt] [PATCH v2 03/10] conf: Adding resolution property for model element

2019-08-30 Thread jcfaracco
From: Julio Faracco New element 'resolution' with parameters 'x' and 'y' were added to support this settings for VGA, QXL, Virtio and Bochs XMLs. A new structure was created as Acceleration element has. It is easy to parse this property. Example: Signed-off-by: Julio Faracco

[libvirt] [PATCH v2 02/10] qemu: Include {xres, yres} QEMU capabilities for video models

2019-08-30 Thread jcfaracco
From: Julio Faracco New QEMU capabilities for display resolution were added: xres and yres. Some models supports like VGA, QXL, Virtio and Bochs support set resolution for driver. The capabilities mentioned above were added into those models. Signed-off-by: Julio Faracco ---

[libvirt] [PATCH v2 06/10] tests: Include bochs-display as capability test too

2019-08-30 Thread jcfaracco
From: Julio Faracco The display model 'bochs-display' should be added into capability test case of command 'device-list-properties' because we are supporting this display now. It is listed by 'virQEMUCapsDeviceProps'. See src/qemu/qemu_capabilities.c:1378. Signed-off-by: Julio Faracco ---

[libvirt] [PATCH v2 08/10] tests: Introduce resolution test for Virtio model

2019-08-30 Thread jcfaracco
From: Julio Faracco New test case was added to cover 'xres' and 'yres' properties for Virtio model due to latest QEMU version. Signed-off-by: Julio Faracco --- ...o-virtio-gpu-resolution.x86_64-latest.args | 35 +++ .../video-virtio-gpu-resolution.xml | 33

[libvirt] [PATCH v2 05/10] tests: Include {xres, yres} QEMU capabilities into tests

2019-08-30 Thread jcfaracco
From: Julio Faracco Both resolution capabilities were added for QEMU versions: 2.10, 2.11, 2.12, 3.0.0, 3.10 and 4.0.0. Signed-off-by: Julio Faracco --- tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 2 ++

[libvirt] [PATCH v2 00/10] Adding resolution properties for video models

2019-08-30 Thread jcfaracco
From: Julio Faracco This serie adds 'xres' and 'yres' QEMU display properties into a new element called 'resolution'. This element is covered by model element: Only types VGA, QXL, Virtio and Bochs support passing resolution to driver. That's why some test cases were added

Re: [libvirt] [PATCH] qemu: Validate arg in qemuAgentErrorComandUnsupported()

2019-08-30 Thread John Ferlan
On 8/30/19 12:09 PM, Jonathon Jongsma wrote: > Coverity noted that 'reply' can be NULL after calling > qemuAgentCommand(). Avoid dereferencing reply in > qemuAgentErrorComandUnsupported() in that case. > > Signed-off-by: Jonathon Jongsma > --- > src/qemu/qemu_agent.c | 7 ++- > 1 file

Re: [libvirt] [BUG] When PLUG a bridge interface to an active VM, the generated LIVE and CONFIG mac address are different

2019-08-30 Thread Martin Kletzander
On Fri, Aug 30, 2019 at 10:14:17AM +0200, Michal Privoznik wrote: On 8/30/19 8:51 AM, wujing (O) wrote: On 8/28/19 11:42 AM, wujing (O) wrote: On 8/22/19 10:43 AM, Xu Yandong (Yandong Xu) wrote: That possibly might be out of scope, but autofilling the mac address as early as

Re: [libvirt] [Qemu-devel] [PATCH 2/2] qapi: deprecate implicit filters

2019-08-30 Thread John Snow
On 8/30/19 6:07 AM, Christophe de Dinechin wrote: > > John Snow writes: > >> On 8/29/19 12:45 PM, Christophe de Dinechin wrote: >>> > [...] > >>> Sorry for catching up late, this mail thread happened during my PTO. >>> >>> I remember bringing up at the time [1] that the correct solution

[libvirt] [PATCH v3 19/19] tests: add vhost-user-gpu xml2argv tests

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- ...host-user-gpu-secondary.x86_64-latest.args | 43 + .../vhost-user-gpu-secondary.xml | 46 +++ .../vhost-user-vga.x86_64-latest.args | 40

[libvirt] [PATCH v3 18/19] tests: mock execv/execve

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Learn to override the paths to the program to execute (vhost-user helpers are executed to check for runtime capabilities). Signed-off-by: Marc-André Lureau --- tests/virfilewrapper.c | 22 ++ 1 file changed, 22 insertions(+) diff --git

[libvirt] [PATCH v3 17/19] qemu: build vhost-user GPU devices

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau For each vhost-user GPUs, - build a socket chardev, and pass the vhost-user socket to it - build a vhost-user video device and associate it with the chardev Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c| 56 +++---

[libvirt] [PATCH v3 14/19] qemu: add vhost-user-gpu helper unit

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Similar to the qemu_tpm.c, add a unit with a few functions to start/stop and setup the cgroup of the external vhost-user-gpu process. See function documentation. The vhost-user connection fd is set on qemuDomainVideoPrivate struct. Signed-off-by: Marc-André Lureau ---

[libvirt] [PATCH v3 15/19] qemu: prepare domain for vhost-user GPU

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Call qemuExtVhostUserGPUPrepareDomain() to fill the domain with the location of the vhost-user binary to start. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 29 + src/qemu/qemu_extdevice.h | 5 +

[libvirt] [PATCH v3 16/19] qemu: start/stop the vhost-user-gpu external device

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Each vhost-user-gpu needs its own helper gpu process. Start/stop them, and apply the emulator cgroup controller. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 44 +++ 1 file changed, 40 insertions(+), 4

[libvirt] [PATCH v3 13/19] qemu: add qemuDomainVideoPrivate

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 36 src/qemu/qemu_domain.h | 14 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH v3 12/19] conf: add privateData to virDomainVideoDef

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c | 26 +- src/conf/domain_conf.h | 7 +-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH v3 11/19] qemu: add qemuSecurityStartVhostUserGPU helper

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau See function documentation. Used in a following patch. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_security.c | 40 src/qemu/qemu_security.h | 6 ++ 2 files changed, 46 insertions(+) diff --git

[libvirt] [PATCH v3 10/19] qemu: add vhost-user helpers

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Add qemuVhostUserFetchConfigs() to discover vhost-user helpers. qemuVhostUserFillDomainGPU() will find the first matching GPU helper with the required capabilities and set the associated vhost_user_binary. Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c

[libvirt] [PATCH v3 08/19] qemu: validate virtio-gpu with vhost-user

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Check qemu capability, and accept 3d acceleration. 3d acceleration support is checked when looking for a suitable vhost-user helper. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_process.c | 57 +++- tests/qemuxml2argvtest.c |

[libvirt] [PATCH v3 07/19] qemu: check that qemu is vhost-user-vga capable

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau To support virtio VGA with vhost-user, vhost-user-vga device is necessary. Signed-off-by: Marc-André Lureau Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c

[libvirt] [PATCH v3 09/19] qemu: restrict 'virgl=' option to non-vhostuser video type

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau vhost-user device doesn't have a virgl option, it is passed to the vhost-user-gpu helper process instead. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c| 9 ++--- tests/qemuxml2argvdata/virtio-options.args | 2 +- 2 files changed,

[libvirt] [PATCH v3 05/19] qemu-cgroup: allow accel rendernode access

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Ján Tomko --- src/qemu/qemu_cgroup.c | 24 1 file changed, 24 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index ecd96efb0a..eb6f993d8e 100644 ---

[libvirt] [PATCH v3 03/19] conf: format/parse/rng/docs for video

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Accept a new driver name attribute to specify usage of helper process, ex: Signed-off-by: Marc-André Lureau --- docs/formatdomain.html.in | 12 ++- docs/schemas/domaincommon.rng | 8 + src/conf/domain_conf.c

[libvirt] [PATCH v3 04/19] domain: add rendernode attribute on

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau vhost-user-gpu helper takes --render-node option to specify on which GPU should the renderning be done. Signed-off-by: Marc-André Lureau --- docs/formatdomain.html.in | 6 ++ docs/schemas/domaincommon.rng | 5 +

[libvirt] [PATCH v3 02/19] util: ignore EACCESS in virDirOpenIfExists

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Whether a directory exists or is not readable shouldn't make a big diffence. This removes errors when firmare or vhost-user config is looked up from a user session libvirt if /etc/libvirt is not readable. Signed-off-by: Marc-André Lureau --- src/util/virfile.c | 13

[libvirt] [PATCH v3 06/19] qemu: add vhost-user-gpu capabilities checks

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Those new devices are available since QEMU 4.1. Signed-off-by: Marc-André Lureau Reviewed-by: Ján Tomko --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 2 ++

[libvirt] [PATCH v3 01/19] qemu: generalize qemuFetchConfigs

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau The same config files disovery & priority rules are used for vhost-user backends. No functional change, the only difference is that qemuInteropFetchConfigs() takes a "name" argument and construct paths with it (ex: "firmware"). Signed-off-by: Marc-André Lureau ---

[libvirt] [PATCH v3 00/19] Add vhost-user-gpu support

2019-08-30 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series adds support for running virtio GPUs in seperate processes, thanks to vhost-user backend. The QEMU support landed for 4.1. There are several benefits of running the GPU/virgl in an external process, since Mesa is rather heavy on the qemu main loop, and

Re: [libvirt] Fwd: libvirtd failing on MacOS in setgroups

2019-08-30 Thread Eric Blake
[adding gnulib] On 8/21/19 1:34 PM, Roman Bolshakov wrote: > I get the following error when running libvirtd on MacOS as root: > > 2019-07-11 00:12:33.673+: 123145573953536: error : > qemuProcessQMPLaunch:8501 : internal error: Failed to start QEMU > binary

[libvirt] [PATCH] qemu: Validate arg in qemuAgentErrorComandUnsupported()

2019-08-30 Thread Jonathon Jongsma
Coverity noted that 'reply' can be NULL after calling qemuAgentCommand(). Avoid dereferencing reply in qemuAgentErrorComandUnsupported() in that case. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_agent.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

Re: [libvirt] [PATCH v2 03/16] domain: add rendernode attribute on

2019-08-30 Thread Marc-André Lureau
Hi On Fri, Aug 23, 2019 at 9:05 PM Cole Robinson wrote: > > On 8/23/19 12:21 PM, Cole Robinson wrote: > > From: Marc-André Lureau > > > > vhost-user-gpu helper may accept --render-node option to specify on > > which GPU should the renderning be done. > > > > What does it do if the user doesn't

Re: [libvirt] Fwd: libvirtd failing on MacOS in setgroups

2019-08-30 Thread Daniel P . Berrangé
On Fri, Aug 30, 2019 at 11:42:50AM -0400, Marcus Furlong wrote: > On Thu, 22 Aug 2019 at 05:34, Daniel P. Berrangé wrote: > > > > On Wed, Aug 21, 2019 at 09:34:05PM +0300, Roman Bolshakov wrote: > > > On Wed, Aug 21, 2019 at 05:55:51PM +0100, Daniel P. Berrangé wrote: > > > > On Wed, Aug 21, 2019

Re: [libvirt] [PATCH 2/3] tests: qemublock: Use bigger numbers as dummy capacity/physical

2019-08-30 Thread Ján Tomko
On Fri, Aug 30, 2019 at 05:30:35PM +0200, Christophe de Dinechin wrote: Peter Krempa writes: Actually test that the full range is available. [...] return -1; diff --git a/tests/qemublocktestdata/imagecreate/luks-encopts.json b/tests/qemublocktestdata/imagecreate/luks-encopts.json

Re: [libvirt] Fwd: libvirtd failing on MacOS in setgroups

2019-08-30 Thread Marcus Furlong
On Thu, 22 Aug 2019 at 05:34, Daniel P. Berrangé wrote: > > On Wed, Aug 21, 2019 at 09:34:05PM +0300, Roman Bolshakov wrote: > > On Wed, Aug 21, 2019 at 05:55:51PM +0100, Daniel P. Berrangé wrote: > > > On Wed, Aug 21, 2019 at 12:47:03PM -0400, Marcus Furlong wrote: > > > > On Wed, 21 Aug 2019 at

Re: [libvirt] [PATCH 2/3] tests: qemublock: Use bigger numbers as dummy capacity/physical

2019-08-30 Thread Christophe de Dinechin
Peter Krempa writes: > Actually test that the full range is available. > [...] > return -1; > diff --git a/tests/qemublocktestdata/imagecreate/luks-encopts.json > b/tests/qemublocktestdata/imagecreate/luks-encopts.json > index f065ad89a7..c5ca863f5b 100644 > ---

Re: [libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Daniel P . Berrangé
On Fri, Aug 30, 2019 at 05:08:52PM +0200, Michal Privoznik wrote: > On 8/30/19 2:30 PM, Roman Kagan wrote: > > On Fri, Aug 30, 2019 at 10:09:06AM +0100, Daniel P. Berrangé wrote: > > > On Fri, Aug 30, 2019 at 08:44:03AM +, Nikolay Shirokovskiy wrote: > > > > Hi, all! > > > > > > > >We use

Re: [libvirt] [PATCH for 5.7.0 v2 3/3] qemu_blockjob: Remove secdriver metadata more frequently

2019-08-30 Thread Peter Krempa
On Fri, Aug 30, 2019 at 16:56:10 +0200, Michal Privoznik wrote: > If a block job reaches failed/cancelled state, or is completed > without pivot then we must remove security driver metadata > associated to the backing chain so that we don't leave any > metadata behind. > > Resolves:

Re: [libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Michal Privoznik
On 8/30/19 2:30 PM, Roman Kagan wrote: On Fri, Aug 30, 2019 at 10:09:06AM +0100, Daniel P. Berrangé wrote: On Fri, Aug 30, 2019 at 08:44:03AM +, Nikolay Shirokovskiy wrote: Hi, all! We use an interesting approach when starting/migrating/etc domain with usb hostdev with

Re: [libvirt] [PATCH 1/3] qemu: block: Use correct type when creating image size JSON entries

2019-08-30 Thread Ján Tomko
On Fri, Aug 30, 2019 at 04:45:03PM +0200, Peter Krempa wrote: The 'u' modifier creates a unsigned int JSON attribute but the disk size an unsigned and capacity fields are unsigned long long. If the size of the created image would be more than 4GiB we'd overflow and create sub-4G image.

Re: [libvirt] [PATCH 3/3] qemu: monitor: Fix formatting of 'offset' in qemuMonitorJSONSaveMemory

2019-08-30 Thread Ján Tomko
On Fri, Aug 30, 2019 at 04:45:05PM +0200, Peter Krempa wrote: The offset is unsigned long long thus 'U' must be used. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description:

Re: [libvirt] [PATCH 2/3] tests: qemublock: Use bigger numbers as dummy capacity/physical

2019-08-30 Thread Ján Tomko
On Fri, Aug 30, 2019 at 04:45:04PM +0200, Peter Krempa wrote: Actually test that the full range is available. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 4 ++-- tests/qemublocktestdata/imagecreate/luks-encopts.json | 4 ++--

[libvirt] [PATCH for 5.7.0 v2 3/3] qemu_blockjob: Remove secdriver metadata more frequently

2019-08-30 Thread Michal Privoznik
If a block job reaches failed/cancelled state, or is completed without pivot then we must remove security driver metadata associated to the backing chain so that we don't leave any metadata behind. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741456 Signed-off-by: Michal Privoznik ---

[libvirt] [PATCH for 5.7.0 v2 2/3] qemu_blockjob: Print image path on failed security metadata move too

2019-08-30 Thread Michal Privoznik
When a block job is completed, the security image metadata are moved to the new image. If this fails an warning is printed, but the message contains only domain name and lacks image paths. Put them both into the warning message. Signed-off-by: Michal Privoznik ACKed-by: Peter Krempa ---

[libvirt] [PATCH for 5.7.0 v2 1/3] qemu_blockjob: Move active commit failed state handling into a function

2019-08-30 Thread Michal Privoznik
Currently, there are only a few lines of code so a separate function was not necessary, but this will change. So instead of putting all the new code under 'case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT' create a separate function. Just like every other case has one. Signed-off-by: Michal Privoznik

[libvirt] [PATCH for 5.7.0 v2 0/3] qemu_blockjob: Remove secdriver metadata more frequently

2019-08-30 Thread Michal Privoznik
v2 of: https://www.redhat.com/archives/libvir-list/2019-August/msg01418.html Patches 1/3 and 2/3 were ACKed but I did not pushed them yet - I'd like to push these all at once. diff to v1: - Instead of restoring seclabels on the backing chain, remove the metadata as we can't know if somebody

[libvirt] [PATCH 1/3] qemu: block: Use correct type when creating image size JSON entries

2019-08-30 Thread Peter Krempa
The 'u' modifier creates a unsigned int JSON attribute but the disk size and capacity fields are unsigned long long. If the size of the created image would be more than 4GiB we'd overflow and create sub-4G image. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 12 ++-- 1 file

[libvirt] [PATCH 2/3] tests: qemublock: Use bigger numbers as dummy capacity/physical

2019-08-30 Thread Peter Krempa
Actually test that the full range is available. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 4 ++-- tests/qemublocktestdata/imagecreate/luks-encopts.json | 4 ++-- tests/qemublocktestdata/imagecreate/luks-noopts.json | 4 ++--

[libvirt] [PATCH 3/3] qemu: monitor: Fix formatting of 'offset' in qemuMonitorJSONSaveMemory

2019-08-30 Thread Peter Krempa
The offset is unsigned long long thus 'U' must be used. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index da1e89dded..e4404f0199 100644 ---

[libvirt] [PATCH 0/3] qemu: Fix formatting of (some) unsigned long long values to JSON (blockdev-add saga)

2019-08-30 Thread Peter Krempa
Currently, libvirt would regress to computer-middle-ages by not being able to use more than 4GiB images for snapshots without corrupting data. Fix it by using the proper formatting modifier. Peter Krempa (3): qemu: block: Use correct type when creating image size JSON entries tests:

Re: [libvirt] [PATCH for 5.7.0 3/3] qemu_blockjob: Restore seclabels more frequently on job events

2019-08-30 Thread Michal Privoznik
On 8/30/19 3:42 PM, Peter Krempa wrote: On Fri, Aug 30, 2019 at 15:19:08 +0200, Michal Privoznik wrote: If a block job reaches failed/cancelled state, or is completed without pivot then qemu no longer uses the mirror image. Since we've set its seclabels we must restore them back to avoid

Re: [libvirt] [PATCH] vircgroupv2: fix abort in VIR_AUTOFREE

2019-08-30 Thread Peter Krempa
On Fri, Aug 30, 2019 at 16:26:23 +0200, Pavel Hrdina wrote: > Introduced by commit that > tried to fix an issue where we would fail to parse values from files. > > We cannot change the original pointer that is going to be used by > VIR_AUTOFREE. > > Resolves:

[libvirt] [PATCH] vircgroupv2: fix abort in VIR_AUTOFREE

2019-08-30 Thread Pavel Hrdina
Introduced by commit that tried to fix an issue where we would fail to parse values from files. We cannot change the original pointer that is going to be used by VIR_AUTOFREE. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1747440 Signed-off-by: Pavel Hrdina --- Sigh, shame on me!

Re: [libvirt] [PATCH for 5.7.0 3/3] qemu_blockjob: Restore seclabels more frequently on job events

2019-08-30 Thread Peter Krempa
On Fri, Aug 30, 2019 at 15:19:08 +0200, Michal Privoznik wrote: > If a block job reaches failed/cancelled state, or is completed > without pivot then qemu no longer uses the mirror image. Since > we've set its seclabels we must restore them back to avoid > leaking perms/XATTRs. > > Resolves:

Re: [libvirt] [PATCH for 5.7.0 2/3] qemu_blockjob: Print image path on failed security metadata move too

2019-08-30 Thread Peter Krempa
On Fri, Aug 30, 2019 at 15:19:07 +0200, Michal Privoznik wrote: > When a block job is completed, the security image metadata are > moved to the new image. If this fails an warning is printed, but > the message contains only domain name and lacks image paths. Put > them both into the warning

Re: [libvirt] [PATCH for 5.7.0 1/3] qemu_blockjob: Move active commit failed state handling into a function

2019-08-30 Thread Peter Krempa
On Fri, Aug 30, 2019 at 15:19:06 +0200, Michal Privoznik wrote: > Currently, there are only a few lines of code so a separate > function was not necessary, but this will change. So instead of > putting all the new code under 'case > QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT' create a separate function. >

Re: [libvirt] [PATCH v1 1/3] adding unplug_timeout QEMU conf

2019-08-30 Thread Daniel Henrique Barboza
On 8/30/19 8:15 AM, Christophe de Dinechin wrote: Daniel P. Berrangé writes: The reason for this timeout is that we originally promised something that we cannot deliver - a synchronous device detach API, while the operation itself is asynchronous. I'm not a fan of exposing it and making it

[libvirt] [PATCH for 5.7.0 0/3] qemu_blockjob: Restore seclabels more frequently

2019-08-30 Thread Michal Privoznik
At some points in blockjob code we were not restoring seclabels on backing chain qemu deceased to use. This leads to perms/XATTRs leak problem. Michal Prívozník (3): qemu_blockjob: Move active commit failed state handling into a function qemu_blockjob: Print image path on failed security

[libvirt] [PATCH for 5.7.0 2/3] qemu_blockjob: Print image path on failed security metadata move too

2019-08-30 Thread Michal Privoznik
When a block job is completed, the security image metadata are moved to the new image. If this fails an warning is printed, but the message contains only domain name and lacks image paths. Put them both into the warning message. Signed-off-by: Michal Privoznik --- src/qemu/qemu_blockjob.c | 6

[libvirt] [PATCH for 5.7.0 3/3] qemu_blockjob: Restore seclabels more frequently on job events

2019-08-30 Thread Michal Privoznik
If a block job reaches failed/cancelled state, or is completed without pivot then qemu no longer uses the mirror image. Since we've set its seclabels we must restore them back to avoid leaking perms/XATTRs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741456 Signed-off-by: Michal

[libvirt] [PATCH for 5.7.0 1/3] qemu_blockjob: Move active commit failed state handling into a function

2019-08-30 Thread Michal Privoznik
Currently, there are only a few lines of code so a separate function was not necessary, but this will change. So instead of putting all the new code under 'case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT' create a separate function. Just like every other case has one. Signed-off-by: Michal Privoznik ---

Re: [libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Roman Kagan
On Fri, Aug 30, 2019 at 10:09:06AM +0100, Daniel P. Berrangé wrote: > On Fri, Aug 30, 2019 at 08:44:03AM +, Nikolay Shirokovskiy wrote: > > Hi, all! > > > > We use an interesting approach when starting/migrating/etc domain with usb > > hostdev with startupPolicy=optional. We add qemu

[libvirt] [PATCH] docs: rewrite hvsupport.html page generator in python

2019-08-30 Thread Daniel P . Berrangé
As part of an goal to eliminate Perl from libvirt build tools, rewrite the hvsupport.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. The new impl generates

Re: [libvirt] [PATCH v2 09/16] qemu: add vhost-user helpers

2019-08-30 Thread Ján Tomko
On Fri, Aug 30, 2019 at 04:04:14PM +0400, Marc-André Lureau wrote: Hi On Tue, Aug 27, 2019 at 12:29 PM Ján Tomko wrote: On Fri, Aug 23, 2019 at 12:21:53PM -0400, Cole Robinson wrote: >From: Marc-André Lureau > >Add qemuVhostUserFetchConfigs() to discover vhost-user helpers. >

[libvirt] [PATCH 6/6] qemu: handle hostdev add/del when libvirtd is down

2019-08-30 Thread Nikolay Shirokovskiy
Somebody can easily detach hostdev on node while libvirtd is being stopped. Also hostdev can be attached or detached and attached back and so forth. Let's handle such cases. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_process.c | 49 + 1 file

[libvirt] [PATCH 1/6] qemu: track hostdev delete cause

2019-08-30 Thread Nikolay Shirokovskiy
qemuDomainDetachDeviceLive is called when client asks for detaching a device. We are going to call this function when usb device is detached on node itself. The function itself requests qemu to detach device from guest but as device detaching is asynchronous libvirt config changes are done in

[libvirt] [PATCH 3/6] qemu: handle usb hostdev add/del on device DELETED_EVENT

2019-08-30 Thread Nikolay Shirokovskiy
Now device DELETED_EVENT can have 2 causes. First is detaching device by client just as before. Second is attaching/detaching hostdev assigned to guest on node. In the latter case we reattach hostdev to guest. When device is detached from node we remove device from qemu and insert new dummy one

[libvirt] [PATCH 5/6] qemu: handle libvirtd restarts during hostdev reattaching

2019-08-30 Thread Nikolay Shirokovskiy
We need to handle case when libvirtd is restarted after qemu device is deleted in order to reattach hostdev and before device deleted event is delivired. First we need to save delete_cause in status xml so that if event is delivered after libvirtd started back we can proceed with reattaching.

[libvirt] [PATCH 2/6] qemu: handle usb hostdev add/del udev events

2019-08-30 Thread Nikolay Shirokovskiy
In either case detach qemu hostdev device (it is dummy in case node hostdev is absent). Meaningful processing will be in DEVICE_DELETED event handler. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/Makefile.inc.am | 2 + src/qemu/qemu_conf.h | 3 + src/qemu/qemu_domain.c | 2 +

[libvirt] [PATCH 0/6] hostdev: handle usb detach/attach on node

2019-08-30 Thread Nikolay Shirokovskiy
Hi, all. This patch series aims to handle case when hostdev usb is detached and then attached back on node. Currently libvirtd does not track these events so that in the result hostdev usb is not usable. On the first glace it make sense to delete device from qemu when hostdev is detached on node

[libvirt] [PATCH 4/6] conf: parse hostdev missing flag

2019-08-30 Thread Nikolay Shirokovskiy
We want to keep this flag across libvirtd restarts. Signed-off-by: Nikolay Shirokovskiy --- src/conf/domain_conf.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b7a342bb91..9a2385e31c 100644 --- a/src/conf/domain_conf.c +++

Re: [libvirt] [PATCH v2 09/16] qemu: add vhost-user helpers

2019-08-30 Thread Marc-André Lureau
Hi On Tue, Aug 27, 2019 at 12:29 PM Ján Tomko wrote: > > On Fri, Aug 23, 2019 at 12:21:53PM -0400, Cole Robinson wrote: > >From: Marc-André Lureau > > > >Add qemuVhostUserFetchConfigs() to discover vhost-user helpers. > > > >qemuVhostUserFillDomainGPU() will find the first matching GPU helper >

Re: [libvirt] [PATCH v2 09/16] qemu: add vhost-user helpers

2019-08-30 Thread Marc-André Lureau
Hi On Tue, Aug 27, 2019 at 12:30 AM Cole Robinson wrote: > > On 8/23/19 12:21 PM, Cole Robinson wrote: > > From: Marc-André Lureau > > > > Add qemuVhostUserFetchConfigs() to discover vhost-user helpers. > > > > qemuVhostUserFillDomainGPU() will find the first matching GPU helper > > with the

Re: [libvirt] [PATCH v4 2/4] qemu: guestinfo: handle unsupported agent commands

2019-08-30 Thread John Ferlan
On 8/27/19 4:35 PM, Jonathon Jongsma wrote: > When we're collecting guest information, older agents may not support > all agent commands. In the case where the user requested all info > types (i.e. types == 0), ignore unsupported command errors and gather as > much information as possible. If

Re: [libvirt] [PATCH v1 1/3] adding unplug_timeout QEMU conf

2019-08-30 Thread Christophe de Dinechin
Daniel P. Berrangé writes: >> > >> >> The reason for this timeout is that we originally promised something >> that we cannot deliver - a synchronous device detach API, while the >> operation itself is asynchronous. I'm not a fan of exposing it and >> making it configurable. > > I'm especially

Re: [libvirt] [PATCH trivial] qemu_conf.c: removing unused virQEMUDriverConfigPtr variable

2019-08-30 Thread Christophe de Dinechin
Daniel Henrique Barboza writes: > 'virQEMUDriverConfigPtr cfg' is declared, initiated, but never > used in virQEMUDriverCreateCapabilities(). > > Signed-off-by: Daniel Henrique Barboza > --- > > Accidental discovery while reading code. > > src/qemu/qemu_conf.c | 3 --- > 1 file changed, 3

Re: [libvirt] [PATCH trivial] qemu_conf.c: removing unused virQEMUDriverConfigPtr variable

2019-08-30 Thread Erik Skultety
On Fri, Aug 30, 2019 at 07:03:55AM -0300, Daniel Henrique Barboza wrote: > 'virQEMUDriverConfigPtr cfg' is declared, initiated, but never > used in virQEMUDriverCreateCapabilities(). > > Signed-off-by: Daniel Henrique Barboza > --- Reviewed-by: Erik Skultety and safe for freeze -- libvir-list

Re: [libvirt] [Qemu-devel] [PATCH 2/2] qapi: deprecate implicit filters

2019-08-30 Thread Christophe de Dinechin
John Snow writes: > On 8/29/19 12:45 PM, Christophe de Dinechin wrote: >> [...] >> Sorry for catching up late, this mail thread happened during my PTO. >> >> I remember bringing up at the time [1] that the correct solution needs >> to take into account usage models that vary from >> >> - a

[libvirt] [PATCH trivial] qemu_conf.c: removing unused virQEMUDriverConfigPtr variable

2019-08-30 Thread Daniel Henrique Barboza
'virQEMUDriverConfigPtr cfg' is declared, initiated, but never used in virQEMUDriverCreateCapabilities(). Signed-off-by: Daniel Henrique Barboza --- Accidental discovery while reading code. src/qemu/qemu_conf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_conf.c

Re: [libvirt] [PATCH v1 1/3] adding unplug_timeout QEMU conf

2019-08-30 Thread Daniel Henrique Barboza
On 8/30/19 5:24 AM, Daniel P. Berrangé wrote: On Mon, Aug 19, 2019 at 11:16:24AM +0200, Ján Tomko wrote: On Sun, Aug 18, 2019 at 06:45:29PM -0300, Daniel Henrique Barboza wrote: For some architectures and setups, device removal can take longer than the default 5 seconds. This results in

Re: [libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Daniel P . Berrangé
On Fri, Aug 30, 2019 at 08:44:03AM +, Nikolay Shirokovskiy wrote: > Hi, all! > > We use an interesting approach when starting/migrating/etc domain with usb > hostdev with startupPolicy=optional. We add qemu usb-host device with > missing hostaddr/hostbus parameters (dummy device). I guess

Re: [libvirt] [PATCH] selinux: Do not report an error when not returning -1

2019-08-30 Thread Michal Privoznik
On 8/29/19 5:39 PM, Martin Kletzander wrote: I guess the reason for that was the automatic interpretation/stringification of setfilecon_errno, but the code was not nice to read and it was a bit confusing. Also, the logs and error states get cleaner this way. Signed-off-by: Martin Kletzander

[libvirt] [RFC] On present using dummy hostdev usb device

2019-08-30 Thread Nikolay Shirokovskiy
Hi, all! We use an interesting approach when starting/migrating/etc domain with usb hostdev with startupPolicy=optional. We add qemu usb-host device with missing hostaddr/hostbus parameters (dummy device). I guess there are 2 reasons why we do it. First without dummy device migration will fail

Re: [libvirt] [PATCH v1 1/3] adding unplug_timeout QEMU conf

2019-08-30 Thread Daniel P . Berrangé
On Mon, Aug 19, 2019 at 11:16:24AM +0200, Ján Tomko wrote: > On Sun, Aug 18, 2019 at 06:45:29PM -0300, Daniel Henrique Barboza wrote: > > For some architectures and setups, device removal can take > > longer than the default 5 seconds. This results in commands > > such as 'virsh setvcpus' to fire

Re: [libvirt] [BUG] When PLUG a bridge interface to an active VM, the generated LIVE and CONFIG mac address are different

2019-08-30 Thread Michal Privoznik
On 8/30/19 8:51 AM, wujing (O) wrote: On 8/28/19 11:42 AM, wujing (O) wrote: On 8/22/19 10:43 AM, Xu Yandong (Yandong Xu) wrote: That possibly might be out of scope, but autofilling the mac address as early as virDomainNetDefParseXML also is not ideal. We have pushed a patch bellow that can

Re: [libvirt] [PATCH] qemu: use 'bochs' video type by default for UEFI domains

2019-08-30 Thread Fabiano Fidêncio
On Thu, Aug 29, 2019 at 12:21 PM Gerd Hoffmann wrote: > > Hi, > > > Incidentally, and I haven't followed this closely so apologies if I'm > > asking a silly question, if the point of bochs-display is to have a > > video device without legacy VGA emulation then why aren't we using > > the

Re: [libvirt] [BUG] When PLUG a bridge interface to an active VM, the generated LIVE and CONFIG mac address are different

2019-08-30 Thread wujing (O)
> On 8/28/19 11:42 AM, wujing (O) wrote: > > On 8/22/19 10:43 AM, Xu Yandong (Yandong Xu) wrote: > That possibly might be out of scope, but autofilling the mac > address as early as virDomainNetDefParseXML also is not ideal. > >>> > >>> We have pushed a patch bellow that can restore