[libvirt] [PATCH] qemu: stop qemu progress when restore failed

2018-07-04 Thread Jie Wang
>From 29482622218f525f0133be0b7db74835174035d9 Mon Sep 17 00:00:00 2001 From: Jie Wang Date: Thu, 5 Jul 2018 09:52:03 +0800 Subject: [PATCH] qemu: stop qemu progress when restore failed if qemuProcessStartCPUs perform failed in qemuDomainSaveImageStartVM, we need to stop qemu progress, otherwise

Re: [libvirt] [PATCH] conf: initialize character pointer xml value to avoid random crash

2018-07-04 Thread Luyao Huang
What !! This can not be true :D Okay, looks like that github offline in a short time. BTW, CC libvirt-ci@ maybe better than libvirt-list@ (does this mail-list ever exist ?) BR, Luyao - Original Message - From: no-re...@patchew.org To: f...@redhat.com, lhu...@redhat.com Cc: libvir-list@

[libvirt] [PATCH] conf: initialize character pointer xml value to avoid random crash

2018-07-04 Thread Luyao Huang
If the code jump to the cleanup before assagin value to xml pointer, libvirtd may get crashed when try to free an uninitialized pointer. backtrace: 0 0x7428d59c in free () from /lib64/libc.so.6 1 0x7721314a in virFree (ptrptr=ptrptr@entry=0x7fffc67f1b00) at util/viralloc.c:582

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Peter Maydell
On 4 July 2018 at 14:34, Kevin Wolf wrote: > Essentially, what is important to me isn't getting these options dropped > exactly in 3.0, but not setting a bad precedence that deprecation isn't > actually worth anything. We may easily end up with this deprecation > process: > > depreate a feature >

[libvirt] [PATCH 2/2 v2] qemu: monitor: Make qemuMonitorAddObject more robust against programming errors

2018-07-04 Thread Peter Krempa
Document and check that @props contains a pointer to a json object and check that both necessary fields are present. Also mark @props as NONNULL. Signed-off-by: Peter Krempa --- Diff: - added the not commited fix to add "%s" to the error message so as a syntax-check fix - typo fix in commit messa

[libvirt] [PATCH 0/2] qemu: migration: Fix crash when adding TLS objects

2018-07-04 Thread Peter Krempa
Thankfully no other caller of qemuMonitorAddObject uses double pointers so the checks are correct. Peter Krempa (2): qemu: hotplug: Do not try to add secret object for TLS if it does not exist qemu: monitor: Make qemuMonitorAddObject more robust against programming errors src/qemu/qe

[libvirt] [PATCH 2/2] qemu: monitor: Make qemuMonitorAddObject more robust against programming errors

2018-07-04 Thread Peter Krempa
Document and check that @props contains a pointer to a json object and check that both necessary fields are present. Also marm @props as NONNULL. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 22 -- src/qemu/qemu_monitor.h | 3 ++- 2 files changed, 18 insertions(

[libvirt] [PATCH 1/2] qemu: hotplug: Do not try to add secret object for TLS if it does not exist

2018-07-04 Thread Peter Krempa
The check whether the object holding secret for decryption of the TLS environment was wrong and would always attempt to add the object. This lead to a crash due to recent refactors. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598015 Signed-off-by: Peter Krempa --- src/qemu/qemu_hotpl

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Kevin Wolf
Am 04.07.2018 um 15:43 hat Daniel P. Berrangé geschrieben: > On Wed, Jul 04, 2018 at 03:34:40PM +0200, Kevin Wolf wrote: > > I understand where you're coming from, but let's be honest: It's not as > > if disk geometry or serial numbers were features that absolutely need > > to be there to give QEMU

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Cornelia Huck
On Wed, 4 Jul 2018 15:34:40 +0200 Kevin Wolf wrote: > Am 04.07.2018 um 15:02 hat Cornelia Huck geschrieben: > > On Tue, 3 Jul 2018 13:32:29 +0200 > > Kevin Wolf wrote: > > > > > > > > Has serial/gemoetry been fixed meanwhile and will it make it into > > > > > > the > > > > > > next release?

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Christian Borntraeger
On 07/04/2018 03:34 PM, Kevin Wolf wrote: > Am 04.07.2018 um 15:02 hat Cornelia Huck geschrieben: >> On Tue, 3 Jul 2018 13:32:29 +0200 >> Kevin Wolf wrote: >> >> Has serial/gemoetry been fixed meanwhile and will it make it into the >> next release? > > I cannot find an archive

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 03:34:40PM +0200, Kevin Wolf wrote: > Am 04.07.2018 um 15:02 hat Cornelia Huck geschrieben: > > On Tue, 3 Jul 2018 13:32:29 +0200 > > Kevin Wolf wrote: > > > > > > > > Has serial/gemoetry been fixed meanwhile and will it make it into > > > > > > the > > > > > > next relea

[libvirt] ANNOUNCE: libvirt-dbus 1.2.0 released

2018-07-04 Thread Pavel Hrdina
I'm happy to announce the release of libvirt-dbus 1.2.0. libvirt-dbus wraps libvirt API to provide high-level object-oriented API better suited for dbus-based applications. You can download it here: https://libvirt.org/sources/dbus/libvirt-dbus-1.2.0.tar.xz * Bug fixes - Properly dere

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Kevin Wolf
Am 04.07.2018 um 15:02 hat Cornelia Huck geschrieben: > On Tue, 3 Jul 2018 13:32:29 +0200 > Kevin Wolf wrote: > > > > > > Has serial/gemoetry been fixed meanwhile and will it make it into the > > > > > next release? > > > > > > > > I cannot find an archive that has it, but it is on the libvirt

Re: [libvirt] [PATCH 2/5] AUTHORS: Fix entries disagreeing with mailmap

2018-07-04 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 02:47:44PM +0200, Andrea Bolognani wrote: > Based on which of the two files has been updated most > recently, and what name is used for recent commits. > > Signed-off-by: Andrea Bolognani > --- > AUTHORS.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Heh, tha

Re: [libvirt] [Qemu-devel] [PULL 25/26] block: Remove deprecated -drive option serial

2018-07-04 Thread Cornelia Huck
On Tue, 3 Jul 2018 13:32:29 +0200 Kevin Wolf wrote: > > > > Has serial/gemoetry been fixed meanwhile and will it make it into the > > > > next release? > > > > > > I cannot find an archive that has it, but it is on the libvirt mailing > > > list as "[libvirt] [PATCH v3] qemu: format serial and

Re: [libvirt] [PATCH 2/2] qemu: Check for guest NUMA nodes properly when validating hugepages

2018-07-04 Thread Michal Prívozník
On 07/04/2018 02:56 PM, Pavel Hrdina wrote: > On Wed, Jul 04, 2018 at 02:35:23PM +0200, Michal Prívozník wrote: >> On 07/04/2018 02:05 PM, Pavel Hrdina wrote: >>> On Wed, Jul 04, 2018 at 01:51:57PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1448149 >>> >>> This

Re: [libvirt] [PATCH 2/2] qemu: Check for guest NUMA nodes properly when validating hugepages

2018-07-04 Thread Pavel Hrdina
On Wed, Jul 04, 2018 at 02:35:23PM +0200, Michal Prívozník wrote: > On 07/04/2018 02:05 PM, Pavel Hrdina wrote: > > On Wed, Jul 04, 2018 at 01:51:57PM +0200, Michal Privoznik wrote: > >> https://bugzilla.redhat.com/show_bug.cgi?id=1448149 > > > > This BZ is not related to the patch, it describes d

Re: [libvirt] [PATCH 5/7] qemu: Wire up PR_MANAGER_STATUS_CHANGED event

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 14:42:07 +0200, Michal Privoznik wrote: > On 07/04/2018 01:42 PM, Peter Krempa wrote: > > On Wed, Jul 04, 2018 at 12:46:53 +0200, Michal Privoznik wrote: > >> This event is emitted on the monitor if one of pr-managers lost > >> connection to its pr-helper process. What libvi

[libvirt] [PATCH 2/5] AUTHORS: Fix entries disagreeing with mailmap

2018-07-04 Thread Andrea Bolognani
Based on which of the two files has been updated most recently, and what name is used for recent commits. Signed-off-by: Andrea Bolognani --- AUTHORS.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.in b/AUTHORS.in index dbced5bf3f..6144fac64a 100644 --- a/AUTHORS.i

[libvirt] [PATCH 3/5] mailmap: Fix consolidation rules

2018-07-04 Thread Andrea Bolognani
The basic mailmap syntax works for simple cases, but sometimes it requires two entiries or doesn't work at all; switch to the more complex syntax in those cases. Signed-off-by: Andrea Bolognani --- .mailmap | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.m

[libvirt] [PATCH 4/5] mailmap: Consolidate current and past maintainers

2018-07-04 Thread Andrea Bolognani
We can't do this in general, but for maintainers we have the data in AUTHORS.in to use as a source of truth. This gets rid of several duplicated lines in the generated AUTHORS file. Signed-off-by: Andrea Bolognani --- .mailmap | 8 1 file changed, 8 insertions(+) diff --git a/.mailmap

[libvirt] [PATCH 5/5] AUTHORS: Avoid duplicated entries

2018-07-04 Thread Andrea Bolognani
Instead of simply dumping the list of authors as obtained from git, we can be a bit smarter and filter out maintainers so that their names don't appear twice. Signed-off-by: Andrea Bolognani --- Mirrors libvirt-dbus commit 5ef5bdaef84a. AUTHORS.in | 2 +- Makefile.am | 18 +-

[libvirt] [PATCH 0/5] AUTHORS: Cleanups and fixes

2018-07-04 Thread Andrea Bolognani
Comparing the generated AUTHORS file before and after these changes: AUTHORS | 51 +-- 1 file changed, 1 insertion(+), 50 deletions(-) There would be plenty of room for additional deduplication, but that's how far I can get based on concrete da

[libvirt] [PATCH 1/5] AUTHORS: Remove unnecessary remark

2018-07-04 Thread Andrea Bolognani
While technically correct (you have to send patches for your name to appear on the list) the remark was clearly intended for a time before AUTHORS was partially generated from the git log. Signed-off-by: Andrea Bolognani --- Mirrors libvirt-dbus commit 6ae9e8c84ce2. AUTHORS.in | 2 -- 1 file ch

Re: [libvirt] [PATCH 5/7] qemu: Wire up PR_MANAGER_STATUS_CHANGED event

2018-07-04 Thread Michal Prívozník
On 07/04/2018 01:42 PM, Peter Krempa wrote: > On Wed, Jul 04, 2018 at 12:46:53 +0200, Michal Privoznik wrote: >> This event is emitted on the monitor if one of pr-managers lost >> connection to its pr-helper process. What libvirt needs to do is >> restart the pr-helper process iff it corresponds to

Re: [libvirt] [PATCH 2/2] qemu: Check for guest NUMA nodes properly when validating hugepages

2018-07-04 Thread Michal Prívozník
On 07/04/2018 02:05 PM, Pavel Hrdina wrote: > On Wed, Jul 04, 2018 at 01:51:57PM +0200, Michal Privoznik wrote: >> https://bugzilla.redhat.com/show_bug.cgi?id=1448149 > > This BZ is not related to the patch, it describes different issue. > > There is different BZ that tracks the issue: > > https

Re: [libvirt] [PATCH v3] Loop through all resolved addresses in virNetSocketNewListenTCP

2018-07-04 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 01:48:56PM +0200, Olaf Hering wrote: > Am Wed, 4 Jul 2018 11:57:58 +0100 > schrieb Daniel P. Berrangé : > > > On Mon, Jun 04, 2018 at 12:29:37PM +0200, Olaf Hering wrote: > > > In this case the resolver returns not only the IPv4 addresses but also > > > IPv6. Binding the IP

Re: [libvirt] [PATCH 2/2] qemu: Check for guest NUMA nodes properly when validating hugepages

2018-07-04 Thread Pavel Hrdina
On Wed, Jul 04, 2018 at 01:51:57PM +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1448149 This BZ is not related to the patch, it describes different issue. There is different BZ that tracks the issue: https://bugzilla.redhat.com/show_bug.cgi?id=1591235 > In fa6bdf

Re: [libvirt] [PATCH 2/7] qemuDomainValidateStorageSource: Relax PR validation

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:50 +0200, Michal Privoznik wrote: > Actually, it is not always bug if path is provided. For instance, > on domain migration the migration XML contains the path even for > managed reservations. Accept this and teach our prepare code to > not leak in this case. Please r

Re: [libvirt] [PATCH 1/2] src: Mention DEVICE_REMOVAL_FAILED event in virDomainDetachDeviceAlias docs

2018-07-04 Thread Jiri Denemark
On Wed, Jul 04, 2018 at 13:51:56 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1598087 > > We are mentioning the positive outcome of the function and not > the case when live detaching a device is denied and event is > issued. > > Signed-off-by: Michal Privoznik >

[libvirt] [PATCH 1/2] src: Mention DEVICE_REMOVAL_FAILED event in virDomainDetachDeviceAlias docs

2018-07-04 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1598087 We are mentioning the positive outcome of the function and not the case when live detaching a device is denied and event is issued. Signed-off-by: Michal Privoznik --- src/libvirt-domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(

[libvirt] [PATCH 0/2] Two almost trivial fixes

2018-07-04 Thread Michal Privoznik
that I haven't pushed. Michal Privoznik (2): src: Mention DEVICE_REMOVAL_FAILED event in virDomainDetachDeviceAlias docs qemu: Check for guest NUMA nodes properly when validating hugepages src/libvirt-domain.c| 4 +++- src/qemu/qemu_command.c | 4 ++-- 2 files changed, 5 insertions(+

[libvirt] [PATCH 2/2] qemu: Check for guest NUMA nodes properly when validating hugepages

2018-07-04 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1448149 In fa6bdf6afa878 and ec982f6d929f3c23 I've tried to forbid configuring for non-existent guest NUMA nodes. However, the check was not fine tuned enough as it failed when no guest NUMA was configured but were configured for guest NUMA node #0. S

Re: [libvirt] [PATCH 7/7] qemu: Fetch pr-helper process info on reconnect

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:55 +0200, Michal Privoznik wrote: > If qemu-pr-helper process died while libvirtd was not running no > event is emitted. Therefore, when reconnecting to the monitor we > must check the qemu-pr-helper process status and act accordingly. > > Signed-off-by: Michal Privoz

Re: [libvirt] [PATCH v3] Loop through all resolved addresses in virNetSocketNewListenTCP

2018-07-04 Thread Olaf Hering
Am Wed, 4 Jul 2018 11:57:58 +0100 schrieb Daniel P. Berrangé : > On Mon, Jun 04, 2018 at 12:29:37PM +0200, Olaf Hering wrote: > > In this case the resolver returns not only the IPv4 addresses but also > > IPv6. Binding the IPv6 address will obviously fail. But this terminates > > the entire loop,

Re: [libvirt] [PATCH 6/7] qemu_monitor: Introduce qemuMonitorJSONGetPRManagerInfo

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:54 +0200, Michal Privoznik wrote: > This function fetches status of all pr-managers. So far, qemu > reports only a single attribute "connected" but that fits our > needs. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_monitor.c | 25 > s

Re: [libvirt] [PATCH 4/7] virstoragefile: Introduce virStorageSourceChainGetManagedPRAlias

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:52 +0200, Michal Privoznik wrote: > When processing a pr-manager related event from qemu we will know > pr-manager alias. So we need a helper to traverse backing chain > and return any managed alias it finds so that the caller can > compare these two aliases to learn i

Re: [libvirt] [PATCH 3/7] virStoragePRDefFormat: Suppress path formatting for migratable XML

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:51 +0200, Michal Privoznik wrote: > If there are managed reservations for a disk source, the path to > the pr-helper socket is generated automatically by libvirt when > needed and points somewhere under priv->libDir. Therefore it is > very unlikely that the path will w

Re: [libvirt] [PATCH 5/7] qemu: Wire up PR_MANAGER_STATUS_CHANGED event

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:53 +0200, Michal Privoznik wrote: > This event is emitted on the monitor if one of pr-managers lost > connection to its pr-helper process. What libvirt needs to do is > restart the pr-helper process iff it corresponds to managed > pr-manager. > > Signed-off-by: Michal

Re: [libvirt] [PATCH 1/7] qemuProcessStartPRDaemonHook: Try to set NS iff domain was started with one

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 12:46:49 +0200, Michal Privoznik wrote: > Users have possibility to disable qemu namespace feature (e.g. > because they are running on *BSD which lacks Linux NS support). > If that's the case we should not try to move qemu-pr-helper into > the same namespace as qemu is in. >

[libvirt] [PATCH 1/2] qemu: Add ccw support for vhost-vsock

2018-07-04 Thread Boris Fiuczynski
Add support and tests for vhost-vsock-ccw. Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_command.c | 15 +++-- src/qemu/qemu_domain_address.c| 7 +++- .../vhost-vsock-ccw-auto.args | 27 .../qemuxml2argvdata/vhost-vs

Re: [libvirt] [PATCH] qemuDomainNestedJobAllowed: Allow QEMU_JOB_NONE

2018-07-04 Thread Jiri Denemark
On Wed, Jul 04, 2018 at 13:09:01 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1598084 > > When creating a snapshot with --quiesce an async job is grabbed > and just before executing guest fs-freeze command an agent job is > grabbed. This is achieved by calling > >

[libvirt] [PATCH 0/2] qemu: Support vhost-vsock-ccw

2018-07-04 Thread Boris Fiuczynski
Support the vhost-vsock-ccw device on S390. Boris Fiuczynski (2): qemu: Add ccw support for vhost-vsock news: Update for vhost-vsock-ccw support docs/news.xml | 8 + src/qemu/qemu_command.c | 15 +++-- src/qemu/qemu_domain_addres

[libvirt] [PATCH 2/2] news: Update for vhost-vsock-ccw support

2018-07-04 Thread Boris Fiuczynski
Signed-off-by: Boris Fiuczynski --- docs/news.xml | 8 1 file changed, 8 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 773c95b0da..2287399034 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -46,6 +46,14 @@ + + + qemu: Add ccw

[libvirt] [PATCH] qemuDomainNestedJobAllowed: Allow QEMU_JOB_NONE

2018-07-04 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1598084 When creating a snapshot with --quiesce an async job is grabbed and just before executing guest fs-freeze command an agent job is grabbed. This is achieved by calling qemuDomainObjBeginJobInternal(job = QEMU_JOB_NONE,

[libvirt] [PATCH 2/5] qemu: simplify graphics port releasing

2018-07-04 Thread Nikolay Shirokovskiy
Originally port allocator have 2 functions to release ports: one for for manually reserved ports and one for autoallocated ports. Thus a bit complicated code of port releasing. Now we have only one releasing function. Let's use *reserved flag whenever we manually/automatically allocate port so tha

[libvirt] [PATCH 5/5] qemu: keep websocketGenerated on libvirtd restarts

2018-07-04 Thread Nikolay Shirokovskiy
Otherwise after libvirtd restart we come back to issues fixed by introducing this flag in [1]. [1] 61a0026a : qemu: Fix xml dump of autogenerated websocket Signed-off-by: Nikolay Shirokovskiy --- src/conf/domain_conf.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/conf/domain

[libvirt] [PATCH 0/5] qemu: misc graphics fixes

2018-07-04 Thread Nikolay Shirokovskiy
Nikolay Shirokovskiy (5): qemu: fix typo in vnc port releasing qemu: simplify graphics port releasing qemu: vnc: mark websocket as used on reconnect qemu: mark graphics ports as used on migration qemu: keep websocketGenerated on libvirtd restarts src/conf/domain_conf.c| 9 +

[libvirt] [PATCH 3/5] qemu: vnc: mark websocket as used on reconnect

2018-07-04 Thread Nikolay Shirokovskiy
Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index de2e84b..09e0327 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4326,7 +4326,8 @@ q

[libvirt] [PATCH 1/5] qemu: fix typo in vnc port releasing

2018-07-04 Thread Nikolay Shirokovskiy
Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 40d35cb..da5656d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6977,7 +6977,7 @@ voi

[libvirt] [PATCH 4/5] qemu: mark graphics ports as used on migration

2018-07-04 Thread Nikolay Shirokovskiy
Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_migration.c | 6 ++ src/qemu/qemu_process.c | 2 +- src/qemu/qemu_process.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 435cd17..7e12ff6 100644 ---

Re: [libvirt] [PATCH v3] Loop through all resolved addresses in virNetSocketNewListenTCP

2018-07-04 Thread Daniel P . Berrangé
On Mon, Jun 04, 2018 at 12:29:37PM +0200, Olaf Hering wrote: > Currently virNetSocketNewListenTCP bails out early under the following > conditions: > - the hostname resolves to at least one IPv4 and at least one IPv6 > address > - the local interfaces have that one IPv4 address assigned, but not

[libvirt] [PATCH 6/7] qemu_monitor: Introduce qemuMonitorJSONGetPRManagerInfo

2018-07-04 Thread Michal Privoznik
This function fetches status of all pr-managers. So far, qemu reports only a single attribute "connected" but that fits our needs. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 25 src/qemu/qemu_monitor.h | 9 + src/qemu/qemu_monitor_json.c | 90 ++

[libvirt] [PATCH 2/7] qemuDomainValidateStorageSource: Relax PR validation

2018-07-04 Thread Michal Privoznik
Actually, it is not always bug if path is provided. For instance, on domain migration the migration XML contains the path even for managed reservations. Accept this and teach our prepare code to not leak in this case. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 21 --

[libvirt] [PATCH 4/7] virstoragefile: Introduce virStorageSourceChainGetManagedPRAlias

2018-07-04 Thread Michal Privoznik
When processing a pr-manager related event from qemu we will know pr-manager alias. So we need a helper to traverse backing chain and return any managed alias it finds so that the caller can compare these two aliases to learn if it is a managed helper or not. Signed-off-by: Michal Privoznik ---

[libvirt] [PATCH 1/7] qemuProcessStartPRDaemonHook: Try to set NS iff domain was started with one

2018-07-04 Thread Michal Privoznik
Users have possibility to disable qemu namespace feature (e.g. because they are running on *BSD which lacks Linux NS support). If that's the case we should not try to move qemu-pr-helper into the same namespace as qemu is in. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 12 +

[libvirt] [PATCH 7/7] qemu: Fetch pr-helper process info on reconnect

2018-07-04 Thread Michal Privoznik
If qemu-pr-helper process died while libvirtd was not running no event is emitted. Therefore, when reconnecting to the monitor we must check the qemu-pr-helper process status and act accordingly. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 78 +++

[libvirt] [PATCH 5/7] qemu: Wire up PR_MANAGER_STATUS_CHANGED event

2018-07-04 Thread Michal Privoznik
This event is emitted on the monitor if one of pr-managers lost connection to its pr-helper process. What libvirt needs to do is restart the pr-helper process iff it corresponds to managed pr-manager. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 15 + src/qemu/q

[libvirt] [PATCH 3/7] virStoragePRDefFormat: Suppress path formatting for migratable XML

2018-07-04 Thread Michal Privoznik
If there are managed reservations for a disk source, the path to the pr-helper socket is generated automatically by libvirt when needed and points somewhere under priv->libDir. Therefore it is very unlikely that the path will work even on migration destination (the libDir is derived from domain sho

[libvirt] [PATCH 0/7] Couple of PR fixes and improvements

2018-07-04 Thread Michal Privoznik
QEMU implemented event when pr-manager connects to/disconnects from pr-helper process. Also, it implemented query command to learn the pr-manager state on libvirtd restart. Whilst working on patches for this, I've noticed couple of other bugs too. Michal Privoznik (7): qemuProcessStartPRDaemonHo

Re: [libvirt] perl-Sys-Virt docs and linker options

2018-07-04 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 12:05:27PM +0200, Olaf Hering wrote: > The docs in libvirt-perl.git refer still to Makefile.PL. > > In the buildlog I noticed that somehow /usr/local is used, nothing uses the > relevant flags from libvirt.pc: > > cc -shared -L/usr/local/lib64 -fstack-protector -o > blib

[libvirt] perl-Sys-Virt docs and linker options

2018-07-04 Thread Olaf Hering
The docs in libvirt-perl.git refer still to Makefile.PL. In the buildlog I noticed that somehow /usr/local is used, nothing uses the relevant flags from libvirt.pc: cc -shared -L/usr/local/lib64 -fstack-protector -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -lvirt But even the patch below

[libvirt] [PATCH v2 05/10] virISCSIScanTargets: Allow making targets persistent

2018-07-04 Thread Michal Privoznik
After a new iSCSI interface is successfully set up, we issue a sendtargets command. However, after 56057900dc53df490d we don't update the host config which in turn makes login fail because iscsiadm is unable to find any matching record for the interface. Signed-off-by: Michal Privoznik Reviewed-b

[libvirt] [PATCH v2 10/10] viriscsitest: Extend virISCSIConnectionLogin test

2018-07-04 Thread Michal Privoznik
Extend this existing test so that a case when IQN is provided is tested too. Since a special iSCSI interface is created and its name is randomly generated at runtime we need to link with virrandommock to have predictable names. Signed-off-by: Michal Privoznik --- tests/viriscsitest.c | 75 ++

[libvirt] [PATCH v2 06/10] virCommandWait: Propagate dryRunCallback return value properly

2018-07-04 Thread Michal Privoznik
The documentation to virCommandWait() function states that if @exitstatus is NULL and command finished with error -1 is returned. In other words, if @dryRunCallback is set and returns an error (by setting its @status argument to a nonzero value) we must propagate this error properly honouring the d

[libvirt] [PATCH v2 08/10] viriscsitest: Move testSessionInfo struct

2018-07-04 Thread Michal Privoznik
This struct has nothing to do with testIscsiadmCb() rather than testISCSIGetSession(). Move it closer to the latter. Signed-off-by: Michal Privoznik --- tests/viriscsitest.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/viriscsitest.c b/tests/viriscsitest

Re: [libvirt] [PATCH 1/2] virTypedParamsSerialize: minor fixes

2018-07-04 Thread Marc Hartmayer
On Tue, Jul 03, 2018 at 09:14 PM +0200, John Ferlan wrote: > On 07/03/2018 06:32 AM, Marc Hartmayer wrote: >> On Thu, Jun 21, 2018 at 03:47 PM +0200, Marc Hartmayer >> wrote: >>> On Wed, Jun 13, 2018 at 03:11 PM +0200, John Ferlan >>> wrote: On 06/07/2018 08:17 AM, Marc Hartmayer wrote: >

[libvirt] [PATCH v2 07/10] viriscsitest: Test virISCSIConnectionLogin

2018-07-04 Thread Michal Privoznik
Introduce one basic test that tests the simplest case: logging into portal without any IQN. Signed-off-by: Michal Privoznik --- tests/viriscsitest.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c ind

[libvirt] [PATCH v2 09/10] viriscsitest: Introduce testIscsiadmCbData struct

2018-07-04 Thread Michal Privoznik
Some tests will want to pass their own callback data into the testIscsiadmCbData callback. Introduce testIscsiadmCbData struct to give this some form and order. Signed-off-by: Michal Privoznik --- tests/viriscsitest.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff -

[libvirt] [PATCH v2 04/10] virISCSIScanTargets: Honour iSCSI interface

2018-07-04 Thread Michal Privoznik
When scanning for targets, iSCSI might give different results depending on the interface used. This is basically just name of config file under /etc/iscsi/ifaces to use. The file contains initiator IQN thus different results claim. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- sr

[libvirt] [PATCH v2 03/10] virStorageBackendIQNFound: Rework iscsiadm output parsing

2018-07-04 Thread Michal Privoznik
Firstly, we can utilize virCommandSetOutputBuffer() API which will collect the command output for us. Secondly, sscanf()-ing through each line is easier to understand (and more robust) than jumping over a string with strchr(). Signed-off-by: Michal Privoznik --- src/util/viriscsi.c | 85

[libvirt] [PATCH v2 00/10] viriscsi: Couple of fixes

2018-07-04 Thread Michal Privoznik
v2 of: https://www.redhat.com/archives/libvir-list/2018-June/msg01861.html diff to v1: - fixed misleading while() loop in 03/10 - Introduced some tests - patch 06/10 is new, while writing the tests I've noticed that errors from testIscsiadmCb were not propagated properly. Patches 01,02,04 and

[libvirt] [PATCH v2 02/10] virStorageBackendIQNFound: Rename out label

2018-07-04 Thread Michal Privoznik
This is in fact 'cleanup' label and it should be named as such. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/util/viriscsi.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index ad857f8cac..01b5b

[libvirt] [PATCH v2 01/10] virStorageBackendIQNFound: Fix ret value assignment

2018-07-04 Thread Michal Privoznik
Perform some method clean-up to follow more accepted coding standards: * Initialize @ret to error value and prove otherwise. * Initialize *ifacename to NULL Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/util/viriscsi.c | 23 ++- 1 file changed, 10 inser

Re: [libvirt] [dbus PATCH] AUTHORS: Avoid duplicated entries

2018-07-04 Thread Peter Krempa
On Wed, Jul 04, 2018 at 09:16:30 +0200, Andrea Bolognani wrote: > Instead of simply dumping the list of authors as obtained > from git, we can be a bit smarter and filter out maintainers > so that their names don't appear twice. > > Signed-off-by: Andrea Bolognani > --- > AUTHORS.in | 2 +- >

Re: [libvirt] [PATCH v3] Loop through all resolved addresses in virNetSocketNewListenTCP

2018-07-04 Thread Olaf Hering
Am Mon, 4 Jun 2018 12:29:37 +0200 schrieb Olaf Hering : > Currently virNetSocketNewListenTCP bails out early under the following > conditions: > - the hostname resolves to at least one IPv4 and at least one IPv6 > address > - the local interfaces have that one IPv4 address assigned, but not any

[libvirt] [dbus PATCH] AUTHORS: Avoid duplicated entries

2018-07-04 Thread Andrea Bolognani
Instead of simply dumping the list of authors as obtained from git, we can be a bit smarter and filter out maintainers so that their names don't appear twice. Signed-off-by: Andrea Bolognani --- AUTHORS.in | 2 +- Makefile.am | 18 +- 2 files changed, 14 insertions(+), 6 deleti

Re: [libvirt] [dbus PATCH 2/2] AUTHORS: Indent list of contributors

2018-07-04 Thread Andrea Bolognani
On Wed, 2018-07-04 at 08:50 +0200, Pavel Hrdina wrote: > On Wed, Jul 04, 2018 at 08:26:17AM +0200, Andrea Bolognani wrote: > > gen-AUTHORS: > > $(AM_V_GEN)if test -d $(srcdir)/.git; then \ > > - out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" > >

Re: [libvirt] [PATCH] qemu: hotplug: Don't access srcPriv when it's not allocated

2018-07-04 Thread Peter Krempa
On Tue, Jul 03, 2018 at 17:05:31 +0200, Marc Hartmayer wrote: > On Tue, Jul 03, 2018 at 04:22 PM +0200, Peter Krempa > wrote: > > On Tue, Jul 03, 2018 at 09:34:56 -0400, John Ferlan wrote: > >> Feels like we've done this before... > >> > >> 97202988 and 6050affb7f > > > > Specifically the former