Re: [libvirt] [PATCH v2] qemu_domain: Error out eariler when configuring IDE controller incorrectly

2017-11-09 Thread John Ferlan
On 10/23/2017 08:53 AM, Lin Ma wrote: > Move error handling of IDE controller from qemuBuildControllerDevStr to > qemuDomainDeviceDefValidate for reminding users eariler. earlier > > Signed-off-by: Lin Ma > --- > src/qemu/qemu_command.c | 17 - >

Re: [libvirt] [PATCH 0/2] vbox: Add support for 5.2.x

2017-11-09 Thread John Ferlan
On 11/07/2017 05:36 PM, Dawid Zamirski wrote: > With each minor VBOX release a new SDK header needs to be added and wired up > to > the driver. This is basically the same as last time [1]. The first patch will > be sent as a compressed attachment because it's a large header file taken from >

Re: [libvirt] [PATCH 0/4] qemu: fix usage of disk and storage source private data

2017-11-09 Thread John Ferlan
On 11/09/2017 07:20 AM, Peter Krempa wrote: > There were a few cases where we'd use private data for a storage source > which was not allocated. Fix it by checking whether it is allocated. > > Qemu command line parser allocated disk definition via VIR_ALLOC rather > than the proper function.

Re: [libvirt] [PATCH 4/4] qemu: process: Setup disk secrets when preparing disks

2017-11-09 Thread John Ferlan
On 11/09/2017 07:20 AM, Peter Krempa wrote: > Setup everything related to disks in one place rather than calling in > from various places. > > The change to ordering of the setup steps is necessary since secrets > need the master key to be present. > --- > src/qemu/qemu_domain.c | 5 + >

Re: [libvirt] [PATCH] conf: Properly parse

2017-11-09 Thread John Ferlan
On 11/08/2017 09:46 AM, Peter Krempa wrote: > The terminator would not be parsed properly since the XPath selector was > looking for an populated element, and also the code did not bother > assigning the terminating virStorageSourcePtr to the backingStore > property of the parent. > > Some

Re: [libvirt] [PATCH 0/2] qemu: block: Fix issues pointed out by coverity

2017-11-09 Thread John Ferlan
On 11/09/2017 04:43 AM, Peter Krempa wrote: > Few unlikely memleaks and a more likely NULL deref. > > Peter Krempa (2): > qemu: block: Break out early on invalid storage sources > qemu: block: Don't leak server JSON object from protocol generators > > src/qemu/qemu_block.c | 76 >

[libvirt] KVM Forum BoF session notes: QEMU configuration/command-line/QMP

2017-11-09 Thread Eduardo Habkost
Hi, Below are the notes I collected during the BoF session about QEMU configuration, command-line and QMP. Sorry for taking so long to send them. All inaccuracies and mistakes below are my own fault. (I learned the hard way that trying to take notes while participating in the discussion at the

Re: [libvirt] [PATCH] apparmor: add network netlink raw rule

2017-11-09 Thread Cedric Bosdonnat
On Thu, 2017-11-09 at 09:43 -0700, Jim Fehlig wrote: > On 11/09/2017 09:24 AM, Cédric Bosdonnat wrote: > > The rule 'network netlink raw' fixes these denials on libvirtd start: > > > > apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=12969 > > comm="libvirtd" family="netlink"

Re: [libvirt] [PATCH 1/2] AppArmor: add rules needed with additional mediation features brought by Linux 4.14.

2017-11-09 Thread Jim Fehlig
On 11/05/2017 08:29 AM, intrigeri+libv...@boum.org wrote: From: intrigeri --- examples/apparmor/libvirt-qemu | 4 examples/apparmor/usr.sbin.libvirtd | 6 ++ 2 files changed, 10 insertions(+) diff --git a/examples/apparmor/libvirt-qemu

Re: [libvirt] [PATCH 02/11] vshCommandOpt: Relax check for valid options

2017-11-09 Thread Michal Privoznik
On 11/09/2017 05:22 PM, Martin Kletzander wrote: > On Thu, Nov 09, 2017 at 04:57:54PM +0100, Michal Privoznik wrote: >> On 11/08/2017 10:54 AM, Martin Kletzander wrote: >>> On Tue, Nov 07, 2017 at 01:22:50PM +0100, Michal Privoznik wrote: When trying to get an opt for command typed on the

Re: [libvirt] [PATCH] apparmor: add network netlink raw rule

2017-11-09 Thread Jim Fehlig
On 11/09/2017 09:24 AM, Cédric Bosdonnat wrote: The rule 'network netlink raw' fixes these denials on libvirtd start: apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=12969 comm="libvirtd" family="netlink" sock_type="raw" protocol=0 requested_mask="create"

[libvirt] [PATCH] apparmor: add network netlink raw rule

2017-11-09 Thread Cédric Bosdonnat
The rule 'network netlink raw' fixes these denials on libvirtd start: apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=12969 comm="libvirtd" family="netlink" sock_type="raw" protocol=0 requested_mask="create" denied_mask="create" --- examples/apparmor/usr.sbin.libvirtd | 1 +

Re: [libvirt] [PATCH 02/11] vshCommandOpt: Relax check for valid options

2017-11-09 Thread Martin Kletzander
On Thu, Nov 09, 2017 at 04:57:54PM +0100, Michal Privoznik wrote: On 11/08/2017 10:54 AM, Martin Kletzander wrote: On Tue, Nov 07, 2017 at 01:22:50PM +0100, Michal Privoznik wrote: When trying to get an opt for command typed on the command line we first check if command has such option.

Re: [libvirt] [PATCH 02/11] vshCommandOpt: Relax check for valid options

2017-11-09 Thread Michal Privoznik
On 11/08/2017 10:54 AM, Martin Kletzander wrote: > On Tue, Nov 07, 2017 at 01:22:50PM +0100, Michal Privoznik wrote: >> When trying to get an opt for command typed on the command line >> we first check if command has such option. Because if it doesn't >> it is a programming error. For instance:

[libvirt] [PATCH v3 01/11] qemu: introduce routines for interruptible state

2017-11-09 Thread Nikolay Shirokovskiy
Async job that wants to allow concurrent execution of regular job should call qemuDomainObjEnterInterruptible and then qemuDomainObjExitInterruptible when it wants to disable concurrent execution of regular jobs. These functions can be called from non concurrent regular jobs. In this case the

[libvirt] [PATCH v3 03/11] qemu: enter interruptlible state where appropriate

2017-11-09 Thread Nikolay Shirokovskiy
This is just places where async job drops vm lock besides for the purpose of sending command to qemu process. If I fail to identify one of these places it is not a big problem - vm will be unresponsive to queries etc sometimes and someone who cares report this issue and we fix it )) NB: Now there

[libvirt] [PATCH v3 09/11] qemu: drop qemuDomainObjExitMonitorInternal

2017-11-09 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_domain.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 56606e0..1cddab9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4580,9 +4580,13 @@

[libvirt] [PATCH v3 04/11] qemu: remove nested job usage from qemuProcessStop

2017-11-09 Thread Nikolay Shirokovskiy
81f50cb92 added getting nested job on stopping domain to prevent leaking of monitor object on race between aborting job and stopping domain cased by that abort. One of the causes of this problem is that async job and concurrent regular job were not fully isolated and async job can continue to run

[libvirt] [PATCH v3 00/11] qemu: replace nested job with interruptible async job state

2017-11-09 Thread Nikolay Shirokovskiy
Hello, everyone. This is successor to [1] "[PATCH v2 RFC 0/4] qemu: replace nested job with interruptible async job state". I tried to expand on series rationale, to make better splitting and to add comments. ABSTRACT Let's use interruptible async job state instead of nested jobs to control

[libvirt] [PATCH v3 05/11] qemu: remove unused qemuDomainObjBeginNestedJob

2017-11-09 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_domain.c | 24 src/qemu/qemu_domain.h | 4 2 files changed, 28 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f8602b7..edf204e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4503,30 +4503,6 @@

[libvirt] [PATCH v3 08/11] qemu: drop qemuDomainObjEnterMonitorInternal

2017-11-09 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_domain.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3747b25..56606e0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4566,10 +4566,9 @@

[libvirt] [PATCH v3 06/11] qemu: remove QEMU_JOB_ASYNC_NESTED

2017-11-09 Thread Nikolay Shirokovskiy
We can safely remove this value particularly because it could not be saved in status file because when nested job is started no other thread can execute concurrent regular job which in turn can save status file. --- src/qemu/qemu_domain.c | 3 --- src/qemu/qemu_domain.h | 1 -

[libvirt] [PATCH v3 02/11] qemu: check interruptible state instead of taking nested job

2017-11-09 Thread Nikolay Shirokovskiy
First don't begin nested job when entering monitor in the context of async job. Second check for interruptible state when try to run concurrent regular job. A third step to enter/exit interruptible state when appropriate is an distinct patch. --- src/qemu/qemu_domain.c | 41

[libvirt] [PATCH v3 07/11] qemu: remove liveness check from qemuDomainObjExitMonitor

2017-11-09 Thread Nikolay Shirokovskiy
This check is useless now at least. We enter/exit monitor in the context of some job. Domain can become inactive only in the context of another job which calls qemuProcessStop. But we do not allow concurrency during calling qemu commands anywhere thus domain can not become inactive. ---

[libvirt] [PATCH v3 11/11] qemu: rename qemuDomainNestedJobAllowed

2017-11-09 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_domain.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1cddab9..b0f7e56 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4297,7 +4297,7 @@

[libvirt] [PATCH v3 10/11] conf: cleanup: drop virDomainObjWait

2017-11-09 Thread Nikolay Shirokovskiy
--- src/conf/domain_conf.c | 19 --- src/conf/domain_conf.h | 1 - src/libvirt_private.syms | 1 - 3 files changed, 21 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7dfd7b5..dad0520 100644 --- a/src/conf/domain_conf.c +++

[libvirt] [PATCH] qemuBuildDriveDevStr: Prefer default aliases for IDE bus

2017-11-09 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1434451 When testing user aliases it was discovered that for 440fx machine type which has default IDE bus builtin, domain cannot start if IDE controller has the user provided alias. This is because for 440fx we don't put the IDE controller onto the

[libvirt] [PATCH] tests: fix TTY check in virTestUseTerminalColors()

2017-11-09 Thread Pino Toscano
Since colors would be used when writing to stdout, then check that stdout is a TTY, instead of stdin. This avoids the usage of terminal color codes when the output is directed to file. --- tests/testutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testutils.c

[libvirt] [PATCH 4/4] qemu: process: Setup disk secrets when preparing disks

2017-11-09 Thread Peter Krempa
Setup everything related to disks in one place rather than calling in from various places. The change to ordering of the setup steps is necessary since secrets need the master key to be present. --- src/qemu/qemu_domain.c | 5 + src/qemu/qemu_process.c | 14 +- 2 files changed,

[libvirt] [PATCH 1/4] qemu: parse: Allocate disk definition with private data

2017-11-09 Thread Peter Krempa
Use virDomainDiskDefNew instead of VIR_ALLOC in qemuParseCommandLineDisk. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510781 --- src/qemu/qemu_parse_command.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_parse_command.c

[libvirt] [PATCH 3/4] qemu: domain: Don't allocate storage source private data if not needed

2017-11-09 Thread Peter Krempa
--- src/qemu/qemu_domain.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 61d28337b..db5af1019 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1402,13 +1402,18 @@

[libvirt] [PATCH 2/4] qemu: Tolerate storage source private data being NULL

2017-11-09 Thread Peter Krempa
In some cases it does not make sense to pursue that the private data will be allocated (especially when we don't need to put anything in it). Ensure that the code works without it. This also fixes few crashes pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=1510323 ---

[libvirt] [PATCH 0/4] qemu: fix usage of disk and storage source private data

2017-11-09 Thread Peter Krempa
There were a few cases where we'd use private data for a storage source which was not allocated. Fix it by checking whether it is allocated. Qemu command line parser allocated disk definition via VIR_ALLOC rather than the proper function. This resulted into the disk private data strucutre not

[libvirt] [PATCH 2/2] qemu: block: Don't leak server JSON object from protocol generators

2017-11-09 Thread Peter Krempa
If creation of the main JSON object containing the storage portion of a virStorageSource would fail but we'd allocate the server structure we'd leak it. Found by coverity. --- src/qemu/qemu_block.c | 72 --- 1 file changed, 46 insertions(+), 26

[libvirt] [PATCH 0/2] qemu: block: Fix issues pointed out by coverity

2017-11-09 Thread Peter Krempa
Few unlikely memleaks and a more likely NULL deref. Peter Krempa (2): qemu: block: Break out early on invalid storage sources qemu: block: Don't leak server JSON object from protocol generators src/qemu/qemu_block.c | 76 --- 1 file changed,

[libvirt] [PATCH 1/2] qemu: block: Break out early on invalid storage sources

2017-11-09 Thread Peter Krempa
Return NULL right away in qemuBlockStorageSourceGetBackendProps when an invalid storage source is presented so that virJSONValueObjectAdd isn't called with a NULL argument. Found by coverity. --- src/qemu/qemu_block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [libvirt] [PATCH 2/5] libvirtd: Alter order of virNetDaemonNew

2017-11-09 Thread Erik Skultety
On Tue, Nov 07, 2017 at 09:39:53PM -0500, John Ferlan wrote: > Let's be sure we can get a Daemon object before the server object. > This is a more "orderly" way to do things since the svr object would > be added to the dmn object afterwards. > > Signed-off-by: John Ferlan

Re: [libvirt] [PATCH] virconf: properly set the end of content

2017-11-09 Thread Daniel P. Berrange
On Wed, Nov 08, 2017 at 04:01:48PM -0700, Jim Fehlig wrote: > There was a recent report of the xen-xl converter not handling > config files missing an ending newline > > https://www.redhat.com/archives/libvir-list/2017-October/msg01353.html > > Commit 3cc2a9e0 fixed a similar problem when

Re: [libvirt] [PATCH 08/11] tools: Provide bash autompletion file

2017-11-09 Thread Michal Privoznik
On 11/08/2017 05:26 PM, Eric Blake wrote: > On 11/08/2017 10:06 AM, Michal Privoznik wrote: > >>> $ virsh complete some-command --arg partial >> >> This is excatly what my patches are doing. With one tiny difference. In >> fact bash script calls: >> >> virsh complete "some-command --arg