Re: [libvirt] New QEMU daemon for persistent reservations

2017-11-26 Thread Michal Privoznik
On 11/26/2017 09:32 AM, Peter Krempa wrote: > On Fri, Nov 24, 2017 at 15:38:54 +0100, Michal Privoznik wrote: >> On 08/22/2017 06:27 PM, Paolo Bonzini wrote: >>> Hi all, >>> >> >> Sorry for resurrecting old thread but seems like there was no agreement >> reached. >> >> We don't want to expose any

Re: [libvirt] [PATCH] qemu: Add support for hot unplug redirdev device

2017-11-26 Thread Chen Hanxiao
At 2017-11-20 11:08:54, "Chen Hanxiao" wrote: > >At 2017-11-10 16:35:59, "Chen Hanxiao" wrote: >>From: Chen Hanxiao >> >> We lacked of hot unplugging redirdev device. >> This patch adds support for it. >> We could use

[libvirt] [PATCH] virsh: fixing virsh prompt when connection changes to readonly mode.

2017-11-26 Thread Julio Faracco
This commit, fixes the virsh prompt when reconnection to the same URI is called: `virsh # connect --readonly` (Reconnect). The problem is happening because the code is considering URI (name) as a mandatory parameter to change the prompt. This commit remove the assignment into `priv->readonly` from

[libvirt] [PATCH v3] qemu: network user/direct/hostdev do not support backend.

2017-11-26 Thread Julio Faracco
The tag backend is not supported for user/direct/hostdev network when you try to define them inside the domain XML. So, other ways to include devices cannot be permitted too. But the attach-device command is wrongly adding unsupported features. This commit fixes this bug. After the patch: virsh

[libvirt] [PATCH v3 05/28] conf: Drop virDomainChrDeviceType.targetTypeAttr

2017-11-26 Thread Andrea Bolognani
This attribute was used to decide whether to format the type attribute of the element, but the logic didn't take into account all possible cases and as such could lead to unexpected results. Moreover, it's one more thing to keep track of, and can easily fall out of sync with other attributes.

[libvirt] [PATCH v3 19/28] qemu: Support usb-serial and pci-serial on pSeries

2017-11-26 Thread Andrea Bolognani
The existing implementation set the address type for all serial devices to spapr-vio, which made it impossible to use other devices such as usb-serial and pci-serial; moreover, some decisions were made based on the address type rather than the device type. Resolves:

[libvirt] [PATCH v3 06/28] conf: Introduce virDomainChrTargetDefFormat()

2017-11-26 Thread Andrea Bolognani
Move formatting of the element for char devices out of virDomainChrDefFormat() and into its own function. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 67 ++ 1

[libvirt] [PATCH v3 16/28] qemu: Format targetModel for serial devices

2017-11-26 Thread Andrea Bolognani
Now that we've created a distinction between target type and target model, with the latter being the concrete device name, it's time to switch to formatting the model instead of the type. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina ---

[libvirt] [PATCH v3 11/28] qemu: Introduce qemuDomainChrTargetDefValidate()

2017-11-26 Thread Andrea Bolognani
Instead of waiting until we get to command line generation, we can validate the target for a char device much earlier. Move all the checks out of qemuBuildSerialChrDeviceStr() and into the new fuction. This will later allow us to validate the target for platform devices. Signed-off-by: Andrea

[libvirt] [PATCH v3 25/28] qemu: Add QEMU_CAPS_DEVICE_ISA_SERIAL

2017-11-26 Thread Andrea Bolognani
All other serial devices have an associated capability. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml

[libvirt] [PATCH v3 17/28] qemu: Remove redundancy in qemuBuildSerialChrDeviceStr()

2017-11-26 Thread Andrea Bolognani
Instead duplicating the capability check for each possible target model, introduce a small helper that matches the target model with the corresponding capability and collapse all existing checks into a single one. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c

[libvirt] [PATCH v3 23/28] conf: convert sclp/sclplm as

2017-11-26 Thread Andrea Bolognani
From: Pino Toscano In case we are allowed to break the ABI of a s390/s390x guest, then convert the first sclp/sclplm console from to , just like it is done on other architectures. Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani

[libvirt] [PATCH v3 12/28] qemu: Improve qemuDomainChrTargetDefValidate()

2017-11-26 Thread Andrea Bolognani
Instead of validating each target type / address type combination separately, create a small helper to perform the matching and collapse all existing checks into a single one. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 50

[libvirt] [PATCH v3 26/28] qemu: Require QEMU_CAPS_DEVICE_ISA_SERIAL for isa-serial

2017-11-26 Thread Andrea Bolognani
We should make sure the isa-serial device is available before formatting it on the QEMU command line. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 7 +++ tests/qemuxml2argvtest.c | 29 +++-- 2 files changed, 30 insertions(+), 6

[libvirt] [PATCH v3 08/28] conf: Check virDomainChrSourceDefFormat() return value

2017-11-26 Thread Andrea Bolognani
The function can fail, but none of the caller were accounting for that. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 34 -- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH v3 13/28] conf: Parse and format virDomainChrSerialTargetModel

2017-11-26 Thread Andrea Bolognani
This information will be used to select, and store in the guest configuration in order to guarantee ABI stability, the concrete (hypervisor-specific) model for serial devices. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 16 --

[libvirt] [PATCH v3 10/28] conf: Remove ATTRIBUTE_FALLTHROUGH from virDomainChrTargetDefFormat()

2017-11-26 Thread Andrea Bolognani
Formatting the element for serial devices will become a bit more complicated later on, and leaving the fallthrough behavior there would do nothing but complicate it further. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina ---

[libvirt] [PATCH v3 21/28] conf: add VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP

2017-11-26 Thread Andrea Bolognani
From: Pino Toscano Introduce specific a target types with two models for the console devices (sclp and sclplm) used in s390 and s390x guests, so isa-serial is no more used for them. This makes usable on s390 and s390x guests, with at most only a single sclpconsole and one

[libvirt] [PATCH v3 01/28] docs: Improve documentation for serial consoles

2017-11-26 Thread Andrea Bolognani
Our current documentation is missing some information and doesn't do a great job at explaining how the and elements are connected. Let's try to fix that. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 210 +- 1

[libvirt] [PATCH v3 28/28] news: Update for serial console fixes

2017-11-26 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/news.xml | 12 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 104668ce9..397e382b9 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -148,6 +148,18 @@ can prepare the files

[libvirt] [PATCH v3 18/28] conf: Add target type and model for spapr-vty

2017-11-26 Thread Andrea Bolognani
We can finally introduce a specific target model for the spapr-vty device used by pSeries guests, which means isa-serial will no longer show up to confuse users. We make sure migration works in both directions by interpreting the isa-serial target type, or the lack of target type, appropriately

[libvirt] [PATCH v3 02/28] qemu: Introduce qemuDomainChrDefPostParse()

2017-11-26 Thread Andrea Bolognani
Having a separate function for char device handling is better than adding even more code to qemuDomainDeviceDefPostParse(). Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina Reviewed-by: Marc Hartmayer ---

[libvirt] [PATCH v3 15/28] qemu: Validate target model for serial devices

2017-11-26 Thread Andrea Bolognani
Target model and target type must agree for the configuration to make sense, so check that's actually the case and error out otherwise. Signed-off-by: Andrea Bolognani --- src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.c | 41

[libvirt] [PATCH v3 27/28] qemu: Limit isa-serial usage to x86 guests

2017-11-26 Thread Andrea Bolognani
The ISA bus is x86 specific, so we should limit usage of isa-serial to x86 guests only, just like we already do eg. with sclpconsole and s390x guests. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[libvirt] [PATCH v3 14/28] qemu: Set targetModel based on targetType for serial devices

2017-11-26 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 20 .../qemuargv2xmldata/qemuargv2xml-console-compat.xml | 4 +++-

[libvirt] [PATCH v3 09/28] conf: Improve virDomainChrTargetDefFormat()

2017-11-26 Thread Andrea Bolognani
Make the switch statement type-aware, avoid calling virDomainChrTargetTypeToString() more than once and check its return value before using it. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 29

[libvirt] [PATCH v3 00/28] Fix serial console behavior on non-x86 architectures

2017-11-26 Thread Andrea Bolognani
Happy birthday to me. Changes from [v2]: * don't drop -serial suffix from existing target types; * add capability and machine type checks for isa-serial; * reduce code duplication; * improve documentation. Changes from [v1]: * introduce target model to go along with target type and

[libvirt] [PATCH v3 20/28] conf: Add target type and model for pl011

2017-11-26 Thread Andrea Bolognani
We can finally introduce a specific target model for the pl011 device used by mach-virt guests, which means isa-serial will no longer show up to confuse users. We make sure migration works in both directions by interpreting the isa-serial target type, or the lack of target type, appropriately

[libvirt] [PATCH v3 07/28] conf: Improve error handling in virDomainChrDefFormat()

2017-11-26 Thread Andrea Bolognani
We don't need to store the return value since we never modify it. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c0e239def..cb98631fb

[libvirt] [PATCH v3 24/28] qemu: switch s390/s390x default console back to serial

2017-11-26 Thread Andrea Bolognani
From: Pino Toscano Now that and on s390/s390x behave a bit more like the other architectures, remove this extra differentation, and use sclp console by default for new guests. New virtio consoles can still be added, and it is actually needed because of the limited number

[libvirt] [PATCH v3 04/28] conf: Introduce VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE

2017-11-26 Thread Andrea Bolognani
This is the first step in getting rid of the assumption that isa-serial is the default target type for serial devices. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 8 +--- src/conf/domain_conf.h

[libvirt] [PATCH v3 22/28] conf: pass parseFlags down to virDomainDefAddConsoleCompat

2017-11-26 Thread Andrea Bolognani
From: Pino Toscano Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani --- src/conf/domain_conf.c | 10 ++ src/conf/domain_conf.h | 3 ++- src/vz/vz_sdk.c| 2 +- 3 files changed, 9 insertions(+), 6

[libvirt] [PATCH v3 03/28] conf: Run devicePostParse() again for the first serial device

2017-11-26 Thread Andrea Bolognani
The devicePostParse() callback is invoked for all devices so that drivers have a chance to set their own specific values; however, virDomainDefAddImplicitDevices() runs *after* the devicePostParse() callbacks have been invoked and can add new devices, in which case the driver wouldn't have a

Re: [libvirt] New QEMU daemon for persistent reservations

2017-11-26 Thread Peter Krempa
On Fri, Nov 24, 2017 at 15:38:54 +0100, Michal Privoznik wrote: > On 08/22/2017 06:27 PM, Paolo Bonzini wrote: > > Hi all, > > > > Sorry for resurrecting old thread but seems like there was no agreement > reached. > > We don't want to expose any paths because the fact that PR helper is a >