Re: [libvirt] [PATCH v5 03/13] conf: Introduce a new PCI address extension flag

2018-09-12 Thread Andrea Bolognani
On Wed, 2018-09-12 at 13:27 +0800, Yi Min Zhao wrote: > 在 2018/9/11 下午4:37, Andrea Bolognani 写道: > > On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: > > [...] > > > @@ -164,6 +164,7 @@ struct _virDomainDeviceInfo { > > >* assignment, never saved and never reported. > > >*/ >

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Erik Skultety
On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: > On 2018-09-11 at 20:22, Michal Privoznik wrote: > >On 09/10/2018 05:47 AM, Shi Lei wrote: > >> By making use of GNU C's cleanup attribute handled by the VIR_AUTOCLOSE > >> macro, > >> many of the VIR_FORCE_CLOSE calls can be dropped,

[libvirt] [PATCH] numa: fix unsafe access to numa_nodes_ptr

2018-09-12 Thread Wang Yechao
numa_nodes_ptr is a global variable in libnuma.so. It is been freed after main thread exits. If we have many running vms, restart the libvirtd service continuously at intervals of a few seconds, the main thread may exit before qemuProcessReconnect thread, and a segfault error occurs. Backstrace as

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/11 下午7:34, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: This patch provides a caching mechanism for the device address extensions uid and fid on S390. For efficient sparse address allocation, we introduce two hash tables for uid/fid which hold the

Re: [libvirt] [PATCHv3 0/3] Add virNetlinkNewLink helper for simplifying virNetDev*Create

2018-09-12 Thread Shi Lei
On 2018-09-12 at 15:28, Erik Skultety wrote: >On Fri, Sep 07, 2018 at 03:17:23PM +0800, Shi Lei wrote: >> v2 here: >> https://www.redhat.com/archives/libvir-list/2018-September/msg00131.html >> >> Diff from V2: >> This series remove all unrelated changes. Those changes would be >> standalone

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Erik Skultety
On Wed, Sep 12, 2018 at 10:32:04AM +0200, Michal Privoznik wrote: > On 09/12/2018 09:18 AM, Erik Skultety wrote: > > On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: > >> On 2018-09-11 at 20:22, Michal Privoznik wrote: > >>> On 09/10/2018 05:47 AM, Shi Lei wrote: > By making use of

Re: [libvirt] [PATCHv3 0/3] Add virNetlinkNewLink helper for simplifying virNetDev*Create

2018-09-12 Thread Erik Skultety
On Fri, Sep 07, 2018 at 03:17:23PM +0800, Shi Lei wrote: > v2 here: > https://www.redhat.com/archives/libvir-list/2018-September/msg00131.html > > Diff from V2: > This series remove all unrelated changes. Those changes would be > standalone patches. > > Shi Lei (3): > util: netlink: Introduce

Re: [libvirt] [PATCH 0/6] Introduce VIR_AUTOCLOSE macro for closing fd automatically

2018-09-12 Thread Shi Lei
On 2018-09-12 at 15:24, Erik Skultety wrote: >On Tue, Sep 11, 2018 at 11:49:11PM +0800, Shi Lei wrote: >> On 2018-09-11 at 20:50, Erik Skultety wrote: >> >On Mon, Sep 10, 2018 at 11:47:49AM +0800, Shi Lei wrote: >> >> This series introduce VIR_AUTOCLOSE macro which can force close fd of the >> >>

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午3:35, Yi Min Zhao 写道: +static void * +virZPCIAddrCopy(const void *name) +{ +    unsigned int *copy; + +    if (VIR_ALLOC(copy) < 0) +    return NULL; + +    *copy = *((unsigned int *)name); +    return (void *)copy; +} + + +static void +virZPCIAddrKeyFree(void *name) +{ +   

Re: [libvirt] [PATCH 4/6] util: netdev: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE

2018-09-12 Thread Erik Skultety
On Tue, Sep 11, 2018 at 11:37:45PM +0800, Shi Lei wrote: > On 2018-09-11 at 20:44, Erik Skultety wrote: > >On Mon, Sep 10, 2018 at 11:47:53AM +0800, Shi Lei wrote: > >> By making use of GNU C's cleanup attribute handled by the VIR_AUTOCLOSE > >> macro, > >> many of the VIR_FORCE_CLOSE calls can

Re: [libvirt] [PATCH 0/6] Introduce VIR_AUTOCLOSE macro for closing fd automatically

2018-09-12 Thread Erik Skultety
On Tue, Sep 11, 2018 at 11:49:11PM +0800, Shi Lei wrote: > On 2018-09-11 at 20:50, Erik Skultety wrote: > >On Mon, Sep 10, 2018 at 11:47:49AM +0800, Shi Lei wrote: > >> This series introduce VIR_AUTOCLOSE macro which can force close fd of the > >> file > >> automatically when the fd goes out of

Re: [libvirt] [PATCHv2 0/5] Introduce VIR_AUTOCLOSE macro for closing fd automatically

2018-09-12 Thread Michal Privoznik
On 09/12/2018 11:46 AM, Shi Lei wrote: > v1 here: > https://www.redhat.com/archives/libvir-list/2018-September/msg00319.html > > Diff from v1: > - Change VIR_AUTOCLOSE macro (comments from Michal) > - Remove others except for patches in util (comments from Erik) > - Change

Re: [libvirt] [PATCHv2 4/5] util: netdevbridge: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE

2018-09-12 Thread Michal Privoznik
On 09/12/2018 11:46 AM, Shi Lei wrote: > Signed-off-by: Shi Lei > --- > src/util/virnetdevbridge.c | 120 - > 1 file changed, 37 insertions(+), 83 deletions(-) > > diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c > index ed2db27..e058898

[libvirt] [PATCH v7 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Igor Mammedov
-smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with an invalid topology. Deprecate invalid

[libvirt] [PATCH v7 2/2] vl:c: make sure that sockets are calculated correctly in '-smp X' case

2018-09-12 Thread Igor Mammedov
commit (5cdc9b76e3 vl.c: Remove dead assignment) removed sockets calculation when 'sockets' weren't provided on CLI since there wasn't any users for it back then. Exiting checks are neither reachable } else if (sockets * cores * threads < cpus) { or nor triggable if (sockets * cores *

[libvirt] [PATCH v7 0/2] deprecate incorrect CPUs topolog

2018-09-12 Thread Igor Mammedov
Changelog since v5: * add(v6) and then remove(v7) Notes section to/from deprication doc (Eduardo Habkost ) * fix up wording and math formating in deprication doc (Eduardo Habkost ) * drop !socket check as it always evaluates to true at that point (Eduardo Habkost ) Changelog

Re: [libvirt] [PATCH v7 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Eric Blake
On 9/12/18 11:19 AM, Igor Mammedov wrote: -smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with

Re: [libvirt] [PATCH 0/2] Remove some unnecessary warnings

2018-09-12 Thread Michal Privoznik
On 09/12/2018 05:09 PM, Martin Kletzander wrote: > cd . > ./blurb > > Martin Kletzander (2): > Add functions for checking if user or group exists > qemu: Report less errors on driver startup > > src/libvirt_private.syms | 2 ++ > src/qemu/qemu_conf.c | 6 -- >

Re: [libvirt] [PATCH v7 2/2] vl:c: make sure that sockets are calculated correctly in '-smp X' case

2018-09-12 Thread Eric Blake
On 9/12/18 11:19 AM, Igor Mammedov wrote: commit (5cdc9b76e3 vl.c: Remove dead assignment) removed sockets calculation when 'sockets' weren't provided on CLI since there wasn't any users for it back then. Exiting checks are neither reachable } else if (sockets * cores * threads < cpus) {

[libvirt] [PATCH 0/2] Remove some unnecessary warnings

2018-09-12 Thread Martin Kletzander
cd . ./blurb Martin Kletzander (2): Add functions for checking if user or group exists qemu: Report less errors on driver startup src/libvirt_private.syms | 2 ++ src/qemu/qemu_conf.c | 6 -- src/util/virutil.c | 40

[libvirt] [PATCH 1/2] Add functions for checking if user or group exists

2018-09-12 Thread Martin Kletzander
Instead of duplicating the code from virGet{User,Group}IDByName(), which are static anyway, extend those functions to accept NULL pointers for the result and a boolean for controlling the error reporting. Signed-off-by: Martin Kletzander --- Feel free to suggest any other way of doing this, I

[libvirt] [PATCH 2/2] qemu: Report less errors on driver startup

2018-09-12 Thread Martin Kletzander
It is not a problem at all if the `tss` user/group does not exist, the code fallbacks to the `root` user/group. However we report a warning for no reason on every start-up. Fix this by checking if the user/group actually exists. Signed-off-by: Martin Kletzander --- src/qemu/qemu_conf.c | 6

[libvirt] [PATCH 3/5] storage: Create error label path for storagePoolCreateXML

2018-09-12 Thread John Ferlan
Rather than duplicate the error code, let's create an error label to keep code common. Signed-off-by: John Ferlan --- src/storage/storage_driver.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c

[libvirt] [PATCH 0/5] Cleanup some storage driver paths

2018-09-12 Thread John Ferlan
See the patches for details - everything leads to the last one. John Ferlan (5): storage: Clean up stateFile if refreshPool fails storage: Clean up storagePoolUpdateStateCallback processing storage: Create error label path for storagePoolCreateXML storage: Introduce

[libvirt] [PATCH 1/5] storage: Clean up stateFile if refreshPool fails

2018-09-12 Thread John Ferlan
If the virStoragePoolRefresh fails and we call stopPool, the code neglected to clean up the state file leading to the next libvirtd restart attempting to start the pool. For a transient pool this could make it unexpectedly reappear. Signed-off-by: John Ferlan --- src/storage/storage_driver.c |

[libvirt] [PATCH 4/5] storage: Introduce storagePoolRefreshFailCleanup

2018-09-12 Thread John Ferlan
Create a common pool refresh failure handling method as the same code is repeated multiple times. Signed-off-by: John Ferlan --- src/storage/storage_driver.c | 38 +--- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/storage/storage_driver.c

[libvirt] [PATCH 2/5] storage: Clean up storagePoolUpdateStateCallback processing

2018-09-12 Thread John Ferlan
Alter the code path to remove the need to to go cleanup and thus remove the label completely. Signed-off-by: John Ferlan --- src/storage/storage_driver.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c

[libvirt] [PATCH 5/5] storage: Save error during refresh failure processing

2018-09-12 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1614283 Save the error from the refresh failure because the stopPool processing may overwrite the error or even worse clear it due to calling an external libvirt API that resets the last error such as is the case with the SCSI pool which may call

Re: [libvirt] [PATCHv2 0/7] qemuxml2argvtest cleanups

2018-09-12 Thread Michal Privoznik
On 09/12/2018 03:30 PM, Ján Tomko wrote: > Patch 1 and patch 3 were not acked in v1. > The changes to the ACKed ones are minimal. > Complete diff to v2: > > diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c > index 867e0d569f..0e43320b96 100644 > --- a/tests/qemuxml2argvtest.c >

Re: [libvirt] [Qemu-devel] [PATCH v5 1/2] vl.c deprecate incorrect CPUs topology

2018-09-12 Thread Igor Mammedov
On Mon, 10 Sep 2018 14:49:23 -0300 Eduardo Habkost wrote: > On Thu, Sep 06, 2018 at 10:02:13AM +0200, Igor Mammedov wrote: > > On Wed, 5 Sep 2018 10:45:12 -0300 > > Eduardo Habkost wrote: > > > > > On Wed, Sep 05, 2018 at 11:25:11AM +0200, Igor Mammedov wrote: > > > > On Tue, 4 Sep 2018

Re: [libvirt] [PATCH 2/2] hw/vfio/display: add ramfb support

2018-09-12 Thread Alex Williamson
On Tue, 11 Sep 2018 06:38:43 +0200 Gerd Hoffmann wrote: > Hi, > > > > type_register_static(_pci_dev_info); > > > +type_register_static(_pci_ramfb_dev_info); > > > My concern here is still all of the extra tooling that needs to be > > added to management layers above QEMU for this

Re: [libvirt] [libvirt PATCH v2 0/4] Share cgroup code that is duplicated between QEMU and LXC

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 03:18:26PM +0200, Michal Privoznik wrote: On 09/12/2018 12:46 PM, Pavel Hrdina wrote: On Wed, Sep 12, 2018 at 10:57:32AM +0200, Fabiano Fidêncio wrote: virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup() and virLXCCgroupSetupCpuTune() and qemuSetupCpuCgroup() are

Re: [libvirt] [PATCH 1/2] Add functions for checking if user or group exists

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 05:09:12PM +0200, Martin Kletzander wrote: Instead of duplicating the code from virGet{User,Group}IDByName(), which are static anyway, extend those functions to accept NULL pointers for the result and a boolean for controlling the error reporting. Signed-off-by: Martin

Re: [libvirt] [PATCHv2 0/5] Introduce VIR_AUTOCLOSE macro for closing fd automatically

2018-09-12 Thread Shi Lei
On 2018-09-12 at 23:38, Michal Privoznik wrote: >On 09/12/2018 11:46 AM, Shi Lei wrote: >> v1 here: >> https://www.redhat.com/archives/libvir-list/2018-September/msg00319.html >> >> Diff from v1: >>   - Change VIR_AUTOCLOSE macro (comments from Michal) >>   - Remove others except for patches in

Re: [libvirt] [PATCHv2 4/5] util: netdevbridge: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE

2018-09-12 Thread Shi Lei
On 2018-09-12 at 23:38, Michal Privoznik wrote: >On 09/12/2018 11:46 AM, Shi Lei wrote: >> Signed-off-by: Shi Lei >> --- >>  src/util/virnetdevbridge.c | 120 - >>  1 file changed, 37 insertions(+), 83 deletions(-) >> >> diff --git a/src/util/virnetdevbridge.c

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread John Ferlan
On 09/12/2018 06:24 PM, Ján Tomko wrote: > On Wed, Sep 12, 2018 at 09:45:32AM -0400, John Ferlan wrote: >> >> >> On 09/12/2018 09:35 AM, Andrea Bolognani wrote: >>> On Wed, 2018-09-12 at 09:09 -0400, John Ferlan wrote: Any chance this can wait?  Would be nice to have other series posted

Re: [libvirt] [PATCH v5] qemu: Introduce state_lock_timeout toqemu.conf

2018-09-12 Thread wang.yi59
Thank you both for your patience and discussion, John and Michal. I will send a new version to fix the issues referred in the discussion. > On 09/10/2018 10:22 PM, John Ferlan wrote: > > > > > > On 09/05/2018 11:09 PM, Yi Wang wrote: > >> When doing some job holding state lock for a long time, >

Re: [libvirt] [PATCH 0/2] Remove some unnecessary warnings

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 05:09:11PM +0200, Martin Kletzander wrote: cd . ./blurb Martin Kletzander (2): Add functions for checking if user or group exists qemu: Report less errors on driver startup src/libvirt_private.syms | 2 ++ src/qemu/qemu_conf.c | 6 -- src/util/virutil.c

Re: [libvirt] [PATCH 5/5] tests: add qemuxml2argv memfd-memory-numa test

2018-09-12 Thread John Ferlan
[...] >> >> So all that's "left": >> >> 1. "Add" a check in qemuDomainABIStabilityCheck to ensure we're not >> changing from memory-backend-ram to memory-backend-memfd. We already >> check that "(src->mem.source != dst->mem.source)" - so we know we're >> already anonymous or not. >> >> Any

[libvirt] Re:Re: [PATCH] add nodeset='all' and default for interleavemode

2018-09-12 Thread peng.hao2
>On 09/11/2018 04:28 PM, Peng Hao wrote: >> For interleave mode,sometimes we want to allocate mmeory regularly >> in all nodes on the host. But different hosts has different node number. >> So we add nodeset='all' for interleave mode and if nodeset=NULL default >> nodeset is 'all' for interleave

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 09:45:32AM -0400, John Ferlan wrote: On 09/12/2018 09:35 AM, Andrea Bolognani wrote: On Wed, 2018-09-12 at 09:09 -0400, John Ferlan wrote: Any chance this can wait? Would be nice to have other series posted upstream that have changes to .xml and .replies files to add

[libvirt] [PATCH] qemu: Introduce state_lock_timeout to qemu.conf

2018-09-12 Thread Yi Wang
When doing some job holding state lock for a long time, we may come across error: "Timed out during operation: cannot acquire state change lock" Well, sometimes it's not a problem and users want to continue to wait, and this patch allow users decide how long time they can wait the state lock.

Re: [libvirt] [PATCH 2/4] src: fix incorrect indentation or empty for first line in function body

2018-09-12 Thread Shi Lei
On 2018-09-12 at 20:02, Ján Tomko wrote: >It would be nice not to mix line removals with re-indentation. > >Jano > It would divide into two patches in v2 series. Shi Lei -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: Introduce state_lock_timeout to qemu.conf

2018-09-12 Thread Bjoern Walk
Yi Wang [2018-09-13, 10:39AM +0800]: > diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c > index 886e3fb..306772a 100644 > --- a/src/qemu/qemu_domain.c > +++ b/src/qemu/qemu_domain.c > @@ -6652,9 +6652,6 @@ qemuDomainObjCanSetJob(qemuDomainObjPrivatePtr priv, >

Re: [libvirt] [PATCH 1/4] cfg.mk: Introduce syntax-check rule for incorrect indentation or empty for first line in function body

2018-09-12 Thread Shi Lei
On 2018-09-12 at 19:58, Ján Tomko wrote: >On Wed, Sep 12, 2018 at 11:58:20AM +0800, Shi Lei wrote: >>Signed-off-by: Shi Lei >>--- >> cfg.mk | 11 +++ >> 1 file changed, 11 insertions(+) >> >>diff --git a/cfg.mk b/cfg.mk >>index 609ae86..a43cb1c 100644 >>--- a/cfg.mk >>+++ b/cfg.mk >>@@

Re: [libvirt] [PATCH 4/4] tools: fix incorrect indentation or empty for first line in function body

2018-09-12 Thread Shi Lei
On 2018-09-12 at 19:59, Ján Tomko wrote: >This commit only fixes empty lines, why mention incorrect indentation? > >Jano Oh, sorry. I would change this commit message. Shi Lei > >On Wed, Sep 12, 2018 at 11:58:23AM +0800, Shi Lei wrote: >>Signed-off-by: Shi Lei >>--- >> tools/virsh-volume.c |

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Michal Privoznik
On 09/12/2018 09:18 AM, Erik Skultety wrote: > On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: >> On 2018-09-11 at 20:22, Michal Privoznik wrote: >>> On 09/10/2018 05:47 AM, Shi Lei wrote: By making use of GNU C's cleanup attribute handled by the VIR_AUTOCLOSE macro, many

[libvirt] Fw: Re: [PATCH 4/6] util: netdev: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE

2018-09-12 Thread Shi Lei
On 2018-09-12 at 16:25, Shi Lei wrote: On 2018-09-12 at 15:21, Erik Skultety wrote: >On Tue, Sep 11, 2018 at 11:37:45PM +0800, Shi Lei wrote: >> On 2018-09-11 at 20:44, Erik Skultety wrote: >> >On Mon, Sep 10, 2018 at 11:47:53AM +0800, Shi Lei wrote: >> >> By making use of GNU C's cleanup

Re: [libvirt] [PATCH 3/3] storage: Allow inputvol to be encrypted

2018-09-12 Thread Michal Privoznik
On 09/11/2018 04:15 PM, John Ferlan wrote: > > > On 09/11/2018 07:16 AM, Michal Privoznik wrote: >> On 08/21/2018 06:23 PM, John Ferlan wrote: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1613737 >>> >>> When processing the inputvol for encryption, we need to handle >>> the case where the

Re: [libvirt] [PATCH 4/4] tools: fix incorrect indentation or empty for first line in function body

2018-09-12 Thread Ján Tomko
This commit only fixes empty lines, why mention incorrect indentation? Jano On Wed, Sep 12, 2018 at 11:58:23AM +0800, Shi Lei wrote: Signed-off-by: Shi Lei --- tools/virsh-volume.c | 1 - tools/virt-admin.c | 1 - 2 files changed, 2 deletions(-) signature.asc Description: Digital signature

Re: [libvirt] [PATCH 2/4] src: fix incorrect indentation or empty for first line in function body

2018-09-12 Thread Ján Tomko
It would be nice not to mix line removals with re-indentation. Jano On Wed, Sep 12, 2018 at 11:58:21AM +0800, Shi Lei wrote: Signed-off-by: Shi Lei --- src/bhyve/bhyve_command.c | 3 - src/bhyve/bhyve_conf.c | 6 +- src/bhyve/bhyve_driver.c | 33

Re: [libvirt] [PATCH v4 00/23] Introduce metadata locking

2018-09-12 Thread Bjoern Walk
Michal Privoznik [2018-09-12, 11:32AM +0200]: > On 09/12/2018 07:19 AM, Bjoern Walk wrote: > > Michal Privoznik [2018-09-10, 11:36AM +0200]: > >> Technically, this is v4 of: > >> > >> https://www.redhat.com/archives/libvir-list/2018-August/msg01627.html > >> > >> However, this is implementing

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午6:37, Andrea Bolognani 写道: On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午3:35, Yi Min Zhao 写道: This makes sense and seems to work just fine; however, you are allocating and releasing a bunch of small integers, which seems a bit wasteful. vircgroup is

Re: [libvirt] [PATCH 1/4] cfg.mk: Introduce syntax-check rule for incorrect indentation or empty for first line in function body

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 11:58:20AM +0800, Shi Lei wrote: Signed-off-by: Shi Lei --- cfg.mk | 11 +++ 1 file changed, 11 insertions(+) diff --git a/cfg.mk b/cfg.mk index 609ae86..a43cb1c 100644 --- a/cfg.mk +++ b/cfg.mk @@ -702,6 +702,17 @@ sc_preprocessor_indentation: echo

Re: [libvirt] [jenkins-ci PATCH v2 0/2] Enable libosinfo tests that require network connectivity

2018-09-12 Thread Fabiano Fidêncio
On Wed, Sep 12, 2018 at 12:29 PM, Andrea Bolognani wrote: > On Tue, 2018-09-11 at 09:36 +0200, Fabiano Fidêncio wrote: > > Let's enable both media and tree uris tests in order to early catch URL > > changes that need to be fixed in osinfo-db. > > > > Fabiano Fidêncio (2): > > guests: Enable

[libvirt] [PATCH 3/3] qemu: Drop redundant version checks

2018-09-12 Thread Andrea Bolognani
We require QEMU 1.5.0 these days, so checking for versions older than that is pointless. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_capabilities.c

[libvirt] [PATCH 5/5] qemu: Avoid duplicate resume events and state changes

2018-09-12 Thread Jiri Denemark
The only place where VIR_DOMAIN_EVENT_RESUMED is generated is the RESUME event handler to make sure we don't generate duplicate events or state changes. In the worse case the duplicity can revert or cover changes done by other event handlers. For example, after QEMU sent RESUME, BLOCK_IO_ERROR,

[libvirt] [PATCH 2/5] qemu: Report more appropriate running reasons

2018-09-12 Thread Jiri Denemark
This patch replaces some rather generic VIR_DOMAIN_RUNNING_UNPAUSED reasons when changing domain state to running with more specific ones. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c

[libvirt] [PATCH 4/5] qemu: Map running reason to resume event detail

2018-09-12 Thread Jiri Denemark
Thanks to the previous commit the RESUME event handler knows what reason should be used when changing the domain state to VIR_DOMAIN_RUNNING, but the emitted VIR_DOMAIN_EVENT_RESUMED event still uses a generic VIR_DOMAIN_EVENT_RESUMED_UNPAUSED detail. Luckily, the event detail can be easily

[libvirt] [PATCH 0/5] qemu: Change the way we generate VIR_DOMAIN_EVENT_RESUMED

2018-09-12 Thread Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=1612943 Jiri Denemark (5): qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT qemu: Report more appropriate running reasons qemu: Pass running reason to RESUME event handler qemu: Map running reason to resume event detail qemu: Avoid

Re: [libvirt] [PATCH 2/3] qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 02:48:53PM +0200, Andrea Bolognani wrote: The capability was introduced in QEMU 1.5.0, which it's our *is minimum supported QEMU version these days. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 6 --

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread Andrea Bolognani
On Wed, 2018-09-12 at 09:09 -0400, John Ferlan wrote: > Any chance this can wait? Would be nice to have other series posted > upstream that have changes to .xml and .replies files to add new > functionality be processed first. > > There's a series to use - memfd from Marc-Andre Laurent that gets

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread John Ferlan
On 09/12/2018 09:35 AM, Andrea Bolognani wrote: > On Wed, 2018-09-12 at 09:09 -0400, John Ferlan wrote: >> Any chance this can wait? Would be nice to have other series posted >> upstream that have changes to .xml and .replies files to add new >> functionality be processed first. >> >> There's a

[libvirt] [PATCH 1/3] qemu: Drop QEMU_CAPS_VNC_WEBSOCKET

2018-09-12 Thread Andrea Bolognani
The capability was introduced in QEMU 1.3.1 and we require QEMU 1.5.0 these days. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c| 9

[libvirt] [PATCH 2/3] qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT

2018-09-12 Thread Andrea Bolognani
The capability was introduced in QEMU 1.5.0, which it's our minimum supported QEMU version these days. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 6 -- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c

Re: [libvirt] [PATCH v4 0/4] block/rbd: enable filename parsing on open

2018-09-12 Thread Jeff Cody
On Tue, Sep 11, 2018 at 06:32:29PM -0400, Jeff Cody wrote: > Changes from v3: > > > Patch 4: Typo fixed [Eric] > Added examples [Eric] > > Changes from v2: > = > > Patch 4: New, document deprecation. [Eric] > Patch 3,2: Add r-b's > > > Changes from

Re: [libvirt] [jenkins-ci PATCH v2 0/2] Enable libosinfo tests that require network connectivity

2018-09-12 Thread Andrea Bolognani
On Wed, 2018-09-12 at 14:23 +0200, Fabiano Fidêncio wrote: > On Wed, Sep 12, 2018 at 12:29 PM, Andrea Bolognani > wrote: > > Assuming that's the case and that you squash the two patches > > together[1], > > As I don't have commit rights, would you mind squashing the patches efore > pushing

Re: [libvirt] [PATCH 1/2] doc: Update the wording around the backingStore

2018-09-12 Thread Marc-André Lureau
On Tue, Sep 11, 2018 at 5:36 PM John Ferlan wrote: > > Commit bc6d3121a was far too terse when describing the new > elements, attributes, and allow values. Provide a few more > words to help describe. > > Signed-off-by: John Ferlan Reviewed-by: Marc-André Lureau > --- >

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 02:48:51PM +0200, Andrea Bolognani wrote: No longer needed since we bumped our minimum QEMU version to 1.5.0. Andrea Bolognani (3): qemu: Drop QEMU_CAPS_VNC_WEBSOCKET qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT qemu: Drop redundant version checks Series: Reviewed-by:

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread John Ferlan
On 09/12/2018 08:48 AM, Andrea Bolognani wrote: > No longer needed since we bumped our minimum QEMU version > to 1.5.0. > > Andrea Bolognani (3): > qemu: Drop QEMU_CAPS_VNC_WEBSOCKET > qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT > qemu: Drop redundant version checks > >

Re: [libvirt] [PATCH 2/2] conf: Move hypervisor specific nhugepage checks

2018-09-12 Thread Marc-André Lureau
Hi On Tue, Sep 11, 2018 at 5:36 PM John Ferlan wrote: > > Commit 82327038 moved a couple of checks out of the XML parser > into the domain validation; however, those checks seem to be more > useful as hypervisor specific checks rather than the more general > domain conf checks (nothing in the

Re: [libvirt] [PATCH 5/5] tests: add qemuxml2argv memfd-memory-numa test

2018-09-12 Thread Marc-André Lureau
Hi On Wed, Sep 12, 2018 at 4:01 AM, John Ferlan wrote: > > > On 09/11/2018 04:48 AM, Marc-André Lureau wrote: >> Hi >> >> On Tue, Sep 11, 2018 at 2:57 AM, John Ferlan wrote: >>> >>> >>> On 09/07/2018 07:32 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Check

Re: [libvirt] [libvirt PATCH v2 1/4] domain_conf: split out virBlkioDevice and virDomainBlkiotune definitions

2018-09-12 Thread Michal Privoznik
On 09/12/2018 10:57 AM, Fabiano Fidêncio wrote: > Let's move those to their own newly created files > (src/util/virblkio.{c,h}) as this will help us to easily start sharing > the cgroup code that's duplicated between QEMU and LXC. > > Signed-off-by: Fabiano Fidêncio > --- > src/Makefile.am

[libvirt] [PATCHv2 3/7] tests: only run startup XML tests if requested

2018-09-12 Thread Ján Tomko
Use the recently introduced flag as a witness. This reduces the apparent number of test cases to the real number of test cases. Note that this does not suffer from the same problem as commit 70255fa was fixing, because the condition for running virTestRun does not depend on results of previous

[libvirt] [PATCHv2 4/7] tests: report errors in QEMU XML->startup XML tests

2018-09-12 Thread Ján Tomko
Now that the function is only run if requested by the FLAG_STEAL_VM flag, we know that missing data is an error, not a request to skip the test. The existence of the output file is now checked by virTestCompareToFile, which allows usage of the VIR_TEST_REGENERATE_OUTPUT=1 env variable to generate

[libvirt] [PATCHv2 7/7] qemu: remove unnecessary virQEMUCapsFreeHostCPUModel

2018-09-12 Thread Ján Tomko
After removing the host CPU model re-computation, this function is no longer necessary. This reverts commits: commit d0498881a04772f9f63b03de80fb4c33d090 virQEMUCapsFreeHostCPUModel: Don't always free host cpuData commit 5276ec712a44b3680569a096e8fe56a925f0d495 testUpdateQEMUCaps: Don't

[libvirt] [PATCHv2 0/7] qemuxml2argvtest cleanups

2018-09-12 Thread Ján Tomko
Patch 1 and patch 3 were not acked in v1. The changes to the ACKed ones are minimal. Complete diff to v2: diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 867e0d569f..0e43320b96 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -460,20 +460,20 @@

[libvirt] [PATCHv2 6/7] tests: turn skipLegacyCPUs into a flag

2018-09-12 Thread Ján Tomko
Make it obvious when it is used intentionally and error out when used in combination with real capabilities. Signed-off-by: Ján Tomko --- tests/qemuxml2argvtest.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/qemuxml2argvtest.c

[libvirt] [PATCHv2 5/7] tests: do not mangle real qemu caps in xml2argvtest

2018-09-12 Thread Ján Tomko
None of the things testUpdateQEMUCaps adjusts are applicable for tests that use the DO_TEST_CAPS macros, i.e. real QEMU capabilities parsed from the XML files: The architecture must be chosen before we even open the caps file, CPU models are already present and the expensive HostModel computation

[libvirt] [PATCHv2 1/7] tests: add a function for checking exclusive flags

2018-09-12 Thread Ján Tomko
We can reject some non-sensical combinations with an error message, once we add flags for them. Signed-off-by: Ján Tomko --- tests/qemuxml2argvtest.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index

[libvirt] [PATCHv2 2/7] tests: introduce macro for qemu XML->startup XML

2018-09-12 Thread Ján Tomko
Use this macro to indicate the intention to also run the XML->startup XML test. It sets the newly introduced FLAG_STEAL_VM flag, which is the new witness for the XML->argv test to leave the VM object behind. This will allow us to report proper errors in XML->startup tests. Signed-off-by: Ján

[libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread Andrea Bolognani
No longer needed since we bumped our minimum QEMU version to 1.5.0. Andrea Bolognani (3): qemu: Drop QEMU_CAPS_VNC_WEBSOCKET qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT qemu: Drop redundant version checks src/qemu/qemu_capabilities.c | 27 +--

[libvirt] [PATCH 3/5] qemu: Pass running reason to RESUME event handler

2018-09-12 Thread Jiri Denemark
Whenever we get the RESUME event from QEMU, we change the state of the affected domain to VIR_DOMAIN_RUNNING with VIR_DOMAIN_RUNNING_UNPAUSED reason. This is fine if the domain is resumed unexpectedly, but when we sent "cont" to QEMU we usually have a better reason for the state change. The better

[libvirt] [PATCH 1/5] qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT

2018-09-12 Thread Jiri Denemark
VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT was defined but not used anywhere in our event generation code. This fixes qemuDomainRevertToSnapshot to properly report why the domain was resumed. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [libvirt] [libvirt PATCH v2 0/4] Share cgroup code that is duplicated between QEMU and LXC

2018-09-12 Thread Michal Privoznik
On 09/12/2018 12:46 PM, Pavel Hrdina wrote: > On Wed, Sep 12, 2018 at 10:57:32AM +0200, Fabiano Fidêncio wrote: >> virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup() and >> virLXCCgroupSetupCpuTune() and qemuSetupCpuCgroup() are the most similar >> functions between QEMU and LXC code. >> >>

Re: [libvirt] [PATCH 0/3] qemu: Drop some cruft

2018-09-12 Thread Ján Tomko
On Wed, Sep 12, 2018 at 09:09:26AM -0400, John Ferlan wrote: On 09/12/2018 08:48 AM, Andrea Bolognani wrote: No longer needed since we bumped our minimum QEMU version to 1.5.0. Andrea Bolognani (3): qemu: Drop QEMU_CAPS_VNC_WEBSOCKET qemu: Drop QEMU_CAPS_CHARDEV_SPICEPORT qemu: Drop

[libvirt] [PATCHv2 2/5] cfg.mk: change syntax-check rule for VIR_AUTOCLOSE variable initialization

2018-09-12 Thread Shi Lei
Signed-off-by: Shi Lei --- cfg.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfg.mk b/cfg.mk index 609ae86..eddd110 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1063,7 +1063,7 @@ sc_prohibit_backslash_alignment: # Rule to ensure that varibales declared using a cleanup macro are

[libvirt] [PATCHv2 3/5] util: file: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE

2018-09-12 Thread Shi Lei
Signed-off-by: Shi Lei --- src/util/virfile.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 01ebdb6..2366c11 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1969,29 +1969,22 @@ int

Re: [libvirt] [PATCH v4 00/23] Introduce metadata locking

2018-09-12 Thread Michal Privoznik
On 09/12/2018 07:19 AM, Bjoern Walk wrote: > Michal Privoznik [2018-09-10, 11:36AM +0200]: >> Technically, this is v4 of: >> >> https://www.redhat.com/archives/libvir-list/2018-August/msg01627.html >> >> However, this is implementing different approach than any of the >> previous versions. >> >>

Re: [libvirt] [jenkins-ci PATCH v2 0/2] Enable libosinfo tests that require network connectivity

2018-09-12 Thread Andrea Bolognani
On Tue, 2018-09-11 at 09:36 +0200, Fabiano Fidêncio wrote: > Let's enable both media and tree uris tests in order to early catch URL > changes that need to be fixed in osinfo-db. > > Fabiano Fidêncio (2): > guests: Enable {media,tree}uris tests for libosinfo > projects: Enable {media,tree}uri

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Andrea Bolognani
On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: > 在 2018/9/12 下午3:35, Yi Min Zhao 写道: > > > This makes sense and seems to work just fine; however, you are > > > allocating and releasing a bunch of small integers, which seems > > > a bit wasteful. > > > > > > vircgroup is AFAICT avoiding all

Re: [libvirt] [libvirt PATCH v2 0/4] Share cgroup code that is duplicated between QEMU and LXC

2018-09-12 Thread Pavel Hrdina
On Wed, Sep 12, 2018 at 10:57:32AM +0200, Fabiano Fidêncio wrote: > virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup() and > virLXCCgroupSetupCpuTune() and qemuSetupCpuCgroup() are the most similar > functions between QEMU and LXC code. > > Let's move their common code to virCgroup. > >

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Shi Lei
On 2018-09-12 at 15:18, Erik Skultety wrote: >On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: >> On 2018-09-11 at 20:22, Michal Privoznik wrote: >> >On 09/10/2018 05:47 AM, Shi Lei wrote: >> >> By making use of GNU C's cleanup attribute handled by the VIR_AUTOCLOSE >> >> macro, >> >>

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Erik Skultety
On Wed, Sep 12, 2018 at 04:04:04PM +0800, Shi Lei wrote: > On 2018-09-12 at 15:18, Erik Skultety wrote: > >On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: > >> On 2018-09-11 at 20:22, Michal Privoznik wrote: > >> >On 09/10/2018 05:47 AM, Shi Lei wrote: > >> >> By making use of GNU C's

[libvirt] [libvirt PATCH v2 4/4] vircgroup: Add virCgroupSetupMemTune()

2018-09-12 Thread Fabiano Fidêncio
virCgroupSetupMemTune() has been introduced in order to remove the code duplication present between virLXCCgroupSetupMemTune() and qemuSetupMemoryCgroup(). Signed-off-by: Fabiano Fidêncio --- src/libvirt_private.syms | 1 + src/lxc/lxc_cgroup.c | 20 ++--

[libvirt] [libvirt PATCH v2 2/4] domain_conf: split out virDomainMemtune and virDomainHugePage definitions

2018-09-12 Thread Fabiano Fidêncio
Let's move those to their own newly created header (src/util/virmem.h) as this will help us to easily start sharing the cgroup code that's duplicated between QEMU and LXC. Signed-off-by: Fabiano Fidêncio --- src/conf/domain_conf.c | 11 +++ src/conf/domain_conf.h | 43

[libvirt] [libvirt PATCH v2 1/4] domain_conf: split out virBlkioDevice and virDomainBlkiotune definitions

2018-09-12 Thread Fabiano Fidêncio
Let's move those to their own newly created files (src/util/virblkio.{c,h}) as this will help us to easily start sharing the cgroup code that's duplicated between QEMU and LXC. Signed-off-by: Fabiano Fidêncio --- src/Makefile.am | 1 + src/conf/domain_conf.c | 11 +

[libvirt] [libvirt PATCH v2 3/4] vircgroup: Add virCgroupSetupBlkioTune()

2018-09-12 Thread Fabiano Fidêncio
virCgroupSetupBlkioTune() has been introduced in order to remove the code duplication present between virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup(). Signed-off-by: Fabiano Fidêncio --- src/libvirt_private.syms | 1 + src/lxc/lxc_cgroup.c | 49 +---

[libvirt] [libvirt PATCH v2 0/4] Share cgroup code that is duplicated between QEMU and LXC

2018-09-12 Thread Fabiano Fidêncio
virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup() and virLXCCgroupSetupCpuTune() and qemuSetupCpuCgroup() are the most similar functions between QEMU and LXC code. Let's move their common code to virCgroup. Mind that the first two patches are basically preparing the ground for the changes

Re: [libvirt] [PATCH 1/6] util: file: introduce VIR_AUTOCLOSE macro to close fd of the file automatically

2018-09-12 Thread Shi Lei
On 2018-09-12 at 16:37, Erik Skultety wrote: >On Wed, Sep 12, 2018 at 10:32:04AM +0200, Michal Privoznik wrote: >> On 09/12/2018 09:18 AM, Erik Skultety wrote: >> > On Tue, Sep 11, 2018 at 10:31:18PM +0800, Shi Lei wrote: >> >> On 2018-09-11 at 20:22, Michal Privoznik wrote: >> >>> On 09/10/2018

  1   2   >