Re: Propose to extend the capability of arm cpu driver

2020-03-05 Thread Zhenyu Zheng
Thanks alot for the reply! The problem is that on many ARM machines the file doesn't contain a > whole lot of information, at least not in a form that's suitable for > end users: for example, on this machine that I have access to, all > it contains is > processor : 0 > BogoMIPS:

Re: [PATCH v2 1/3] iotests: Specify explicit backing format where sensible

2020-03-05 Thread Eric Blake
On 2/27/20 7:08 AM, Eric Blake wrote: The change in libvirt to reject images without explicit backing format has pointed out that a number of tools have been far too reliant on probing in the past.  It's time to set a better example in our own iotests of properly setting this parameter. iotest

Re: [libvirt PATCH] logging: Use default timeout of 120 seconds for virtlogd

2020-03-05 Thread Daniel Henrique Barboza
On 3/5/20 1:42 PM, Andrea Bolognani wrote: This is the same timeout of all other daemons, and just like them virtlogd is socket-activated, so it will automatically be started on demand whenever that's necessary. Signed-off-by: Andrea Bolognani --- Reviewed-by: Daniel Henrique Barboza

Re: [libvirt PATCH] test: fix leak of authentication info

2020-03-05 Thread Daniel Henrique Barboza
On 3/5/20 1:58 PM, Daniel P. Berrangé wrote: The 'auths' struct in the test driver was not free()d. This was easy to miss because the default XML doesn't include auth info. Signed-off-by: Daniel P. Berrangé --- Reviewed-by: Daniel Henrique Barboza

Re: [libvirt PATCH 0/2] util: audit: cleanups (include epistles)

2020-03-05 Thread Daniel Henrique Barboza
On 3/5/20 10:22 AM, Ján Tomko wrote: Just a small series this time. Ján Tomko (2): util: audit: drop support for old libaudit util: viraudit: remove unnecessary includes src/util/viraudit.c | 15 --- 1 file changed, 15 deletions(-) Reviewed-by: Daniel Henrique

[PATCH 3/4] formatdomain.html.in: document the new 'uuid' NVDIMM element

2020-03-05 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- docs/formatdomain.html.in | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 7e7771725c..e3bf33f873 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@

[PATCH 2/4] qemu_command.c: enable NVDIMM support for ppc64

2020-03-05 Thread Daniel Henrique Barboza
Using the new 'uuid' element for NVDIMM memory added in the previous patch, let's enable NVDIMM support for ppc64 guests. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 7 .../memory-hotplug-nvdimm-ppc64.args | 32 +++

[PATCH 4/4] news.xml: document the new NVDIMM support for Pseries guest

2020-03-05 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 7fd88f9998..6eb222cdb7 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -44,6 +44,17 @@ + + + qemu:

[PATCH 1/4] conf: Introduce optional 'uuid' element for NVDIMM memory

2020-03-05 Thread Daniel Henrique Barboza
ppc64 NVDIMM support was implemented in QEMU by commit [1]. The support is similar to what x86 already does, aside from an extra 'uuid' element. This patch introduces a new optional 'uuid' element for the NVDIMM memory model. This element behaves like the 'uuid' element of the domain definition -

[PATCH 0/4] NVDIMM suport for pSeries guests

2020-03-05 Thread Daniel Henrique Barboza
Hi, This patch series adds NVDIMM suport for ppc64 guests, which consists on adding an extra 'uuid' element in the nvdimm command line on the existing support for x86. These patches shouldn't change anything in the existing x86 support, given that the new 'uuid' element is only applicable for

Re: [libvirt PATCH] src: fix mixup of stack and heap allocated data in auth callback

2020-03-05 Thread Richard W.M. Jones
On Thu, Mar 05, 2020 at 04:54:10PM +, Daniel P. Berrangé wrote: > In the following recent change: > > commit db72866310d1e520efa8ed2d4589bdb5e76a1c95 > Author: Daniel P. Berrangé > Date: Tue Jan 14 10:40:52 2020 + > > util: add API for reading password from the console > >

Re: Propose to extend the capability of arm cpu driver

2020-03-05 Thread Andrea Bolognani
On Thu, 2020-03-05 at 17:23 +0800, Zhenyu Zheng wrote: > Hi Andrea Bolognani! > > Thank you very much for the reply and guide, they are very helpful. > And we will treat as this as a long-term task to try to enrich ARM > capabilities, both in libvirt and QEMU an other related projects. That

[PATCH] qemu: Create multipath targets for PRs

2020-03-05 Thread Michal Privoznik
If a disk has persistent reservations enabled, qemu-pr-helper might open not only /dev/mapper/control but also individual targets of the multipath device. We are already querying for them in CGroups, but now we have to create them in the namespace too. This was brought up in [1]. 1:

[libvirt PATCH] test: fix leak of authentication info

2020-03-05 Thread Daniel P . Berrangé
The 'auths' struct in the test driver was not free()d. This was easy to miss because the default XML doesn't include auth info. Signed-off-by: Daniel P. Berrangé --- src/test/test_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c

[libvirt PATCH] src: fix mixup of stack and heap allocated data in auth callback

2020-03-05 Thread Daniel P . Berrangé
In the following recent change: commit db72866310d1e520efa8ed2d4589bdb5e76a1c95 Author: Daniel P. Berrangé Date: Tue Jan 14 10:40:52 2020 + util: add API for reading password from the console the fact that "bufptr" pointer may point to either heap or stack allocated data was

Re: [libvirt PATCH 0/3] build fix: more g_autofree refactors

2020-03-05 Thread Peter Krempa
On Thu, Mar 05, 2020 at 17:31:32 +0100, Ján Tomko wrote: > > > Ján Tomko (3): > virmacmap: Use g_autofree in virMacMapWriteFileLocked > vz: use g_autofree in prlsdkConvertCpuInfo > aa-helper: use g_autofree in create_profile Reviewed-by: Peter Krempa

[libvirt PATCH] logging: Use default timeout of 120 seconds for virtlogd

2020-03-05 Thread Andrea Bolognani
This is the same timeout of all other daemons, and just like them virtlogd is socket-activated, so it will automatically be started on demand whenever that's necessary. Signed-off-by: Andrea Bolognani --- src/logging/virtlogd.sysconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[libvirt PATCH 2/3] vz: use g_autofree in prlsdkConvertCpuInfo

2020-03-05 Thread Ján Tomko
Convert the function to use g_autofree to silence -Wmaybe-uninitialized. Signed-off-by: Ján Tomko --- src/vz/vz_sdk.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index c49204de1d..9cee6f1fde 100644 ---

[libvirt PATCH 1/3] virmacmap: Use g_autofree in virMacMapWriteFileLocked

2020-03-05 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virmacmap.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c index 0c0ba90def..4a57edede8 100644 --- a/src/util/virmacmap.c +++ b/src/util/virmacmap.c @@ -261,19 +261,15 @@ static

[libvirt PATCH 3/3] aa-helper: use g_autofree in create_profile

2020-03-05 Thread Ján Tomko
'template' might be used uninitialized. Use g_autofree for everything and remove all the custom labels. Signed-off-by: Ján Tomko --- src/security/virt-aa-helper.c | 45 +-- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git

[libvirt PATCH 0/3] build fix: more g_autofree refactors

2020-03-05 Thread Ján Tomko
Ján Tomko (3): virmacmap: Use g_autofree in virMacMapWriteFileLocked vz: use g_autofree in prlsdkConvertCpuInfo aa-helper: use g_autofree in create_profile src/security/virt-aa-helper.c | 45 +-- src/util/virmacmap.c | 12 --

[PATCH] src: add pthread_np.h include for FreeBSD

2020-03-05 Thread Daniel P . Berrangé
On FreeBSD the non-portable pthread APIs need to be obtained via the pthread_np.h header. Signed-off-by: Daniel P. Berrangé --- Pushed as a build fix for FreeBSD src/util/virthread.c | 4 1 file changed, 4 insertions(+) diff --git a/src/util/virthread.c b/src/util/virthread.c index

Re: [libvirt PATCH] docs: add page describing the libvirt daemons

2020-03-05 Thread Daniel P . Berrangé
On Thu, Mar 05, 2020 at 04:10:48PM +0100, Andrea Bolognani wrote: > On Thu, 2020-03-05 at 14:57 +, Daniel P. Berrangé wrote: > > On Thu, Mar 05, 2020 at 03:49:46PM +0100, Andrea Bolognani wrote: > > > I've enabled split-daemon mode on my laptop and it seems to work > > > quite seamlessly;

Re: [libvirt PATCH] docs: add page describing the libvirt daemons

2020-03-05 Thread Andrea Bolognani
On Thu, 2020-03-05 at 14:57 +, Daniel P. Berrangé wrote: > On Thu, Mar 05, 2020 at 03:49:46PM +0100, Andrea Bolognani wrote: > > I've spotted a few minor issues and I've fixed them, along with the > > ones that Erik had already pointed out, in the attached patch. Please > > squash it in before

Re: [libvirt PATCH] docs: add page describing the libvirt daemons

2020-03-05 Thread Daniel P . Berrangé
On Thu, Mar 05, 2020 at 03:49:46PM +0100, Andrea Bolognani wrote: > On Mon, 2020-02-24 at 18:20 +, Daniel P. Berrangé wrote: > > Now that we have more than just the libvirtd daemon, we should be > > explaining to users what they are all for & important aspects of their > > configuration. > >

Re: [libvirt PATCH] docs: add page describing the libvirt daemons

2020-03-05 Thread Andrea Bolognani
On Mon, 2020-02-24 at 18:20 +, Daniel P. Berrangé wrote: > Now that we have more than just the libvirtd daemon, we should be > explaining to users what they are all for & important aspects of their > configuration. > > Signed-off-by: Daniel P. Berrangé > --- > docs/daemons.rst | 682

[PATCH 2/2] qemu: remove redundant needReply argument of qemuAgentCommand

2020-03-05 Thread Nikolay Shirokovskiy
needReply added in [1] looks redundant. Indeed it is set to false only when mon->await_event is set too (the only exception qemuAgentFSTrim which is mistaken). However it fixes the issue when qemuAgentCommand exits on error path and mon->await_event is not reset. Let's instead reset

[PATCH 1/2] qemu: agent: sync once if qemu has serial port event

2020-03-05 Thread Nikolay Shirokovskiy
Sync was introduced in [1] to check for ga presence. This check is racy but in the era before serial events are available there was not better solution I guess. In case we have the events the sync function is different. It allows us to flush stateless ga channel from remnants of previous

[PATCH 0/2] qemu: agent: sync once if qemu has serial port event

2020-03-05 Thread Nikolay Shirokovskiy
The second patch is unrelated through. Nikolay Shirokovskiy (2): qemu: agent: sync once if qemu has serial port event qemu: remove redundant needReply argument of qemuAgentCommand src/qemu/qemu_agent.c| 60 src/qemu/qemu_agent.h| 3 +-

Re: [PATCH 7/8] qemu: refactor qemuDomainDefineXMLFlags

2020-03-05 Thread Nikolay Shirokovskiy
On 03.03.2020 11:19, Nikolay Shirokovskiy wrote: > Let's move objlist restoring to cleanup section so that we can > handle failure of actions between virDomainObjListAdd and > virDomainDefSave. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/qemu/qemu_driver.c | 32

[libvirt PATCH 2/2] util: viraudit: remove unnecessary includes

2020-03-05 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/viraudit.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/util/viraudit.c b/src/util/viraudit.c index c8346aa81b..13421653b9 100644 --- a/src/util/viraudit.c +++ b/src/util/viraudit.c @@ -24,14 +24,11 @@ #ifdef WITH_AUDIT # include #endif

[libvirt PATCH 1/2] util: audit: drop support for old libaudit

2020-03-05 Thread Ján Tomko
Virtualization event types were added in 2.0.5: https://github.com/linux-audit/audit-userspace/commit/3755e9ff Even Ubuntu 14.04 (which we don't support) has 2.3.2. Signed-off-by: Ján Tomko --- src/util/viraudit.c | 12 1 file changed, 12 deletions(-) diff --git

[libvirt PATCH 0/2] util: audit: cleanups (include epistles)

2020-03-05 Thread Ján Tomko
Just a small series this time. Ján Tomko (2): util: audit: drop support for old libaudit util: viraudit: remove unnecessary includes src/util/viraudit.c | 15 --- 1 file changed, 15 deletions(-) -- 2.24.1

[libvirt PATCH v2 7/7] qemu: convert agent to use the per-VM event loop

2020-03-05 Thread Daniel P . Berrangé
This converts the QEMU agent APIs to use the per-VM event loop, which involves switching from virEvent APIs to GMainContext / GSource APIs. A GSocket is used as a convenient way to create a GSource for a socket, but is not yet used for actual I/O. Signed-off-by: Daniel P. Berrangé ---

[libvirt PATCH v2 5/7] qemu: convert monitor to use the per-VM event loop

2020-03-05 Thread Daniel P . Berrangé
This converts the QEMU monitor APIs to use the per-VM event loop, which involves switching from virEvent APIs to GMainContext / GSource APIs. A GSocket is used as a convenient way to create a GSource for a socket, but is not yet used for actual I/O. Signed-off-by: Daniel P. Berrangé ---

[libvirt PATCH v2 6/7] qemu: fix variable naming in agent code

2020-03-05 Thread Daniel P . Berrangé
We are dealing with the QEMU agent, not the monitor. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_agent.c | 498 +- 1 file changed, 249 insertions(+), 249 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index

[libvirt PATCH v2 3/7] qemu: start/stop an event thread for QMP probing

2020-03-05 Thread Daniel P . Berrangé
In common with regular QEMU guests, the QMP probing will need an event loop for handling monitor I/O operations. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_process.c | 15 +++ src/qemu/qemu_process.h | 2 ++ 2 files changed, 17 insertions(+) diff --git

[libvirt PATCH v2 0/7] qemu: introduce a per-VM event loop thread

2020-03-05 Thread Daniel P . Berrangé
This series changes the way we manage the QEMU monitor and QEMU agent, such that all I/O is processed by a dedicated event loop thread. Many times in the past years people are reported issues where long running monitor event callbacks block the main libvirtd event loop for an unacceptably long

[libvirt PATCH v2 4/7] tests: start/stop an event thread for QEMU monitor/agent tests

2020-03-05 Thread Daniel P . Berrangé
Tests which are using the QEMU monitor / agent need to have an event thread running a private GMainContext. There is already a thread running the main libvirt event loop but this can't be eliminated yet as it is used for more than just the monitor client I/O. Signed-off-by: Daniel P. Berrangé

[libvirt PATCH v2 2/7] qemu: start/stop an event loop thread for domains

2020-03-05 Thread Daniel P . Berrangé
The event loop thread will be responsible for handling any per-domain I/O operations, most notably the QEMU monitor and agent sockets. We start this event loop when launching QEMU, but stopping the event loop is a little more complicated. The obvious idea is to stop it in qemuProcessStop(), but

[libvirt PATCH v2 1/7] src: introduce an abstraction for running event loops

2020-03-05 Thread Daniel P . Berrangé
We want a way to easily run a private GMainContext in a thread, with correct synchronization between startup and shutdown of the thread. Signed-off-by: Daniel P. Berrangé --- po/POTFILES.in| 1 + src/libvirt_private.syms | 5 + src/util/Makefile.inc.am | 2 +

Re: [PATCH 0/5] alloc: Don't mask use of uninitialized variables in VIR_FREE

2020-03-05 Thread Ján Tomko
On a Thursday in 2020, Peter Krempa wrote: Neither GCC nor clang report warnings if pointer passed to VIR_FREE is uninitialized. This is probably caused by our internal implementation which mangles the pointer to it. Fix all offenders and replace VIR_FREE's internals with g_clear_pointer.

Re: [PATCH 05/13] qemu: block: Implement helpers for dealing with bitmaps during block commit

2020-03-05 Thread Pavel Mores
On Wed, Mar 04, 2020 at 06:26:33PM +0100, Peter Krempa wrote: > qemuBlockBitmapsHandleCommitStart prepares for disabling the bitmaps in > the 'base' of the commit job so that the bitmaps are not dirtied by the > commit job. This needs to be done prior to start of the commit job. > >

Re: GSoC 2020

2020-03-05 Thread Jan Kiszka
Hi Shiko, On 04.03.20 09:49, ahmed El-Shreif wrote: Hi, my name is Ahmed. I am a Computer Engineering student from Egypt. I am really interested in contributing this year in GSoC program with Libvirt .  I was a GSoC student last year with LibreOffice. I was working in a compiler project. I

Re: [PATCH 2/2] qemu_shim: Ignore SIGPIPE

2020-03-05 Thread Andrea Bolognani
On Thu, 2020-03-05 at 09:57 +, Daniel P. Berrangé wrote: > On Thu, Mar 05, 2020 at 10:06:53AM +0100, Andrea Bolognani wrote: > > On Fri, 2020-02-28 at 16:56 +0100, Michal Privoznik wrote: > > > +++ b/src/qemu/qemu_shim.c > > > @@ -150,6 +150,7 @@ int main(int argc, char **argv) > > >

Re: [PATCH 2/2] qemu_shim: Ignore SIGPIPE

2020-03-05 Thread Daniel P . Berrangé
On Thu, Mar 05, 2020 at 10:06:53AM +0100, Andrea Bolognani wrote: > On Fri, 2020-02-28 at 16:56 +0100, Michal Privoznik wrote: > > I've found that if my virtlogd is socket activated but the daemon > > doesn't run yet, then the virt-qemu-run is killed right after it > > tries to start the domain.

[PATCH 4/5] testQemuMonitorJSONqemuMonitorJSONGetTargetArch: Fix uninitialized use of 'arch'

2020-03-05 Thread Peter Krempa
Refactor the cleanup control flow and use g_autofree for 'arch' so that it's mandated that it's initialized. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/qemumonitorjsontest.c

[PATCH 1/5] virNetworkPortDefSaveStatus: Fix potentially uninitialized 'path' by refactoring cleanup

2020-03-05 Thread Peter Krempa
Use 'g_autofree' to clean both 'path' and 'xml' which mandates initialization and get rid of the 'cleanup' label and 'ret variable. Signed-off-by: Peter Krempa --- src/conf/virnetworkportdef.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git

[PATCH 5/5] VIR_ALLOC: Replace internals by g_clear_pointer

2020-03-05 Thread Peter Krempa
Our implementation masks GCC warnings of uninitialized use of the passed argument. After changing this I got a load of following warnings: src/conf/virnetworkportdef.c: In function 'virNetworkPortDefSaveStatus': /usr/include/glib-2.0/glib/gmem.h:136:8: error: 'path' may be used uninitialized in

[PATCH 2/5] virLXCProcessSetupNamespaceName: Fix potential uninitialized free of 'path'

2020-03-05 Thread Peter Krempa
'path' could be accessed uninitialized. Fix it by using g_autofree which also mandates initialization. Signed-off-by: Peter Krempa --- src/lxc/lxc_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index

[PATCH 0/5] alloc: Don't mask use of uninitialized variables in VIR_FREE

2020-03-05 Thread Peter Krempa
Neither GCC nor clang report warnings if pointer passed to VIR_FREE is uninitialized. This is probably caused by our internal implementation which mangles the pointer to it. Fix all offenders and replace VIR_FREE's internals with g_clear_pointer. Peter Krempa (5): virNetworkPortDefSaveStatus:

[PATCH 3/5] cmdDomHostname: Fix uninitialized use of 'hostname' by refactoring cleanup

2020-03-05 Thread Peter Krempa
Use 'g_autoptr' which mandates initialization for 'hostname' and also for 'domain' to allow full refactor of the cleanup path. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tools/virsh-domain.c

Re: [PATCH 03/13] qemu: blockjob: Store list of bitmaps disabled prior to commit

2020-03-05 Thread Pavel Mores
On Wed, Mar 04, 2020 at 06:26:31PM +0100, Peter Krempa wrote: > Starting a commit job will require disabling bitmaps in the base image > so that they are not dirtied by the commit job. We need to store a list > of the bitmaps so that we can later re-enable them. > > Add a field and status XML

Re: [PATCH 01/13] qemu: domain: Extract formatting of 'commit' blockjob data into a function

2020-03-05 Thread Pavel Mores
On Wed, Mar 04, 2020 at 06:26:29PM +0100, Peter Krempa wrote: > I'll be adding more fields to care about so splitting the code out will > be better long-term. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_domain.c | 27 +++ > 1 file changed, 19 insertions(+), 8

Re: [PATCH 02/13] qemu: domain: Extract parsing of 'commit' blockjob data into a function

2020-03-05 Thread Pavel Mores
On Wed, Mar 04, 2020 at 06:26:30PM +0100, Peter Krempa wrote: > I'll be adding more fields to care about so splitting the code out will > be better long-term. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_domain.c | 57 ++ > 1 file changed, 36

Re: Propose to extend the capability of arm cpu driver

2020-03-05 Thread Zhenyu Zheng
Hi Andrea Bolognani! Thank you very much for the reply and guide, they are very helpful. And we will treat as this as a long-term task to try to enrich ARM capabilities, both in libvirt and QEMU an other related projects. As for the missing features, maybe I can do it one by one, start with

Re: [PATCH 2/2] qemu_shim: Ignore SIGPIPE

2020-03-05 Thread Andrea Bolognani
On Fri, 2020-02-28 at 16:56 +0100, Michal Privoznik wrote: > I've found that if my virtlogd is socket activated but the daemon > doesn't run yet, then the virt-qemu-run is killed right after it > tries to start the domain. The problem is that because the default > setting is to use virtlogd, the

Re: [PATCH 1/2] qemu_shim: Allow other users to enter the root dir

2020-03-05 Thread Andrea Bolognani
On Fri, 2020-02-28 at 16:56 +0100, Michal Privoznik wrote: > +++ b/src/qemu/qemu_shim.c > @@ -158,6 +158,12 @@ int main(int argc, char **argv) > return 1; > } > tmproot = true; > + > +if (chmod(root, S_IRWXU | S_IXGRP | S_IXOTH) < 0) { I think this is