[libvirt] [PATCH v2 00/12] more progress towards backing chain allocation stats

2014-12-16 Thread Eric Blake
v1 was here: https://www.redhat.com/archives/libvir-list/2014-December/msg00370.html ACKed patches from that series have been pushed. In this series, 3, 4, and 6 are new, and others try to address some of the feedback and deal with rebased design decisions that resulted. I still don't have

[libvirt] [PATCH v2 01/12] qemu: refactor blockinfo job handling

2014-12-16 Thread Eric Blake
In order for a future patch to virDomainListGetStats to reuse some code for determining disk usage of offline domains, we need to make it easier to pull out part of the guts of grabbing blockinfo. The current implementation grabs a job fairly late in the game, while getstats will already own a

[libvirt] [PATCH v2 09/12] getstats: prepare for dynamic block.count stat

2014-12-16 Thread Eric Blake
A coming patch will make it optionally possible to list backing chain block stats; in this mode of operation, block.counts is no longer the number of disks in the domain, but the number of blocks in the array being reported. We still want block.count listed first, but rather than iterate the tree

[libvirt] [PATCH v2 08/12] getstats: report block sizes for offline domains

2014-12-16 Thread Eric Blake
The prior refactoring can now be put to use. With the same domain as the previous commit (one qcow2 disk and an empty cdrom drive): $ virsh domstats --block foo Domain: 'foo' block.count=2 block.0.name=hda block.0.allocation=200704 block.0.capacity=42949672960 block.0.physical=200704

[libvirt] [PATCH v2 03/12] getstats: prepare monitor collection for recursion

2014-12-16 Thread Eric Blake
A future patch will allow recursion into backing chains when collecting block stats. This patch should not change behavior, but merely moves out the common code that will be reused once recursion is enabled, and adds the parameter that will turn on recursion. * src/qemu/qemu_monitor.h

[libvirt] [PATCH v2 11/12] getstats: split block stats reporting for easier recursion

2014-12-16 Thread Eric Blake
In order to report stats on backing chains, we need to separate the output of stats for one block from how we traverse blocks. * src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Split... (qemuDomainGetStatsOneBlock): ...into new helper. Signed-off-by: Eric Blake ebl...@redhat.com ---

[libvirt] [PATCH v2 10/12] getstats: add new flag for block backing chain

2014-12-16 Thread Eric Blake
This patch introduces access to allocation information about a backing chain of a live domain. While querying storage volumes for read-only disks could provide some of the details, there is one case where we have to rely on qemu: when doing a block commit into a backing file, where that file is

[libvirt] [PATCH v2 05/12] getstats: rearrange blockinfo gathering

2014-12-16 Thread Eric Blake
We want to avoid read()ing a file while qemu is running. We still have to open() block devices to determine their physical size, but that is safer. This patch rearranges code to make it easier to skip the metadata collection when possible. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo):

[libvirt] [PATCH v2 04/12] getstats: perform recursion in monitor collection

2014-12-16 Thread Eric Blake
When requested in a later patch, the QMP command results are now examined recursively. As qemu_driver will eventually have to read items out of the hash table as stored by this patch, the computation of backing alias string is done in a shared location. * src/qemu/qemu_domain.h

[libvirt] [PATCH v2 12/12] getstats: start crawling backing chain for qemu

2014-12-16 Thread Eric Blake
Wire up backing chain recursion. Note that for now, we just use the same allocation numbers for read-only backing files as what offline domains would report. It is not the correct allocation number for qcow2 over block devices during block-commit, and it misses out on the fact that qemu also

[libvirt] [PATCH v2 06/12] qemu: fix bugs in blockstats

2014-12-16 Thread Eric Blake
The documentation for virDomainBlockInfo was confusing: it stated that 'physical' was the size of the container, then gave an example of it being the amount of storage used by a sparse file (that is, for a sparse raw image on a regular file, the wording implied capacity==physical, while allocation

[libvirt] [PATCH v2 02/12] qemu: let blockinfo reuse virStorageSource

2014-12-16 Thread Eric Blake
Right now, grabbing blockinfo always calls stat on the disk, then opens the image to determine the capacity, using a throw-away virStorageSourcePtr. This has a couple of drawbacks: 1. We are calling stat and opening a file on every invocation of the API. However, there are cases where the stats

Re: [libvirt] [PATCH v2 00/12] more progress towards backing chain allocation stats

2014-12-16 Thread Eric Blake
v1 was here: https://www.redhat.com/archives/libvir-list/2014-December/msg00370.html ACKed patches from that series have been pushed. In this series, 3, 4, and 6 are new, and others try to address some of the feedback and deal with rebased design decisions that resulted. I still don't

[libvirt] [PATCH v2 07/12] qemu: refactor blockinfo data gathering

2014-12-16 Thread Eric Blake
Create a helper function that can be reused for gathering block info from virDomainListGetStats. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Split guts... (qemuStorageLimitsRefresh): ...into new helper function. Signed-off-by: Eric Blake ebl...@redhat.com --- src/qemu/qemu_driver.c | 207

[libvirt] [PATCH] spec: Fix syntax

2014-12-16 Thread Jiri Denemark
Signed-off-by: Jiri Denemark jdene...@redhat.com --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index edf2df8..ba1cf41 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -357,7 +357,7 @@ # changes in reported warnings

Re: [libvirt] [PATCH] spec: Fix syntax

2014-12-16 Thread Jiri Denemark
On Tue, Dec 16, 2014 at 09:23:49 +0100, Jiri Denemark wrote: Signed-off-by: Jiri Denemark jdene...@redhat.com --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index edf2df8..ba1cf41 100644 --- a/libvirt.spec.in +++

Re: [libvirt] [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.

2014-12-16 Thread Ian Campbell
On Mon, 2014-12-15 at 17:07 +, Anthony PERARD wrote: On Thu, Dec 11, 2014 at 04:23:15PM +, Ian Campbell wrote: On Thu, 2014-12-11 at 16:16 +, Anthony PERARD wrote: On Tue, Dec 09, 2014 at 03:56:02PM +, Ian Campbell wrote: On Tue, 2014-12-09 at 15:39 +, Anthony PERARD

[libvirt] [PATCH v2 0/2] Rework reference counting in QEMU

2014-12-16 Thread Martin Kletzander
Our reference locking for objects is great and powerful thing. The problem is that it was either not followed through completely or the design was not complete, but it doesn't matter now. There are few bugs in the code due to the reference counting and the daemon is lacking some performance in

[libvirt] [PATCH v2 1/2] conf: Rework virDomainObjListFindByUUID to allow more concurrent APIs

2014-12-16 Thread Martin Kletzander
Currently, when there is an API that's blocking with locked domain and second API that's waiting in virDomainObjListFindByUUID() for the domain lock (with the domain list locked) no other API can be executed on any domain on the whole hypervisor because all would wait for the domain list to be

Re: [libvirt] virDomainGetBlockInfo meanings

2014-12-16 Thread Daniel P. Berrange
On Mon, Dec 15, 2014 at 05:29:14PM -0700, Eric Blake wrote: I'm really struggling with how to interpret the virDomainBlockInfo struct, and think that we may want to consider the current behavior buggy and offer improved behavior going forward. For starters, even though the stats reported by

[libvirt] [PATCH v2 2/2] qemu: completely rework reference counting

2014-12-16 Thread Martin Kletzander
There is one problem that causes various errors in the daemon. When domain is waiting for a job, it is unlocked while waiting on the condition. However, if that domain is for example transient and being removed in another API (e.g. cancelling incoming migration), it get's unref'd. If the first

Re: [libvirt] [PATCH 0/6] qemu: Fix hotplugging cpus with strict memory pinning

2014-12-16 Thread Michal Privoznik
On 15.12.2014 08:58, Martin Kletzander wrote: Deatils are in the patches themselves, but the basic idea is this: Setup: $ grep DMA32 /proc/zoneinfo Node 0, zoneDMA32 $ virsh dumpxml domain | grep -C1 strict numatune memory mode='strict' nodeset='1'/ /numatune

Re: [libvirt] [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.

2014-12-16 Thread Anthony PERARD
On Tue, Dec 16, 2014 at 09:30:28AM +, Ian Campbell wrote: On Mon, 2014-12-15 at 17:07 +, Anthony PERARD wrote: On Thu, Dec 11, 2014 at 04:23:15PM +, Ian Campbell wrote: On Thu, 2014-12-11 at 16:16 +, Anthony PERARD wrote: On Tue, Dec 09, 2014 at 03:56:02PM +, Ian

Re: [libvirt] [PATCH] qemu: fix use a nonexist address in qemuDomainAttachDeviceConfig

2014-12-16 Thread Peter Krempa
On 12/15/14 10:10, Luyao Huang wrote: We free them before, then use it. This make we always do We clear the pointer, not free. virDomainDefAddImplicitControllers when attach a disk. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1

Re: [libvirt] [PATCH v2 01/12] qemu: refactor blockinfo job handling

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: In order for a future patch to virDomainListGetStats to reuse some code for determining disk usage of offline domains, we need to make it easier to pull out part of the guts of grabbing blockinfo. The current implementation grabs a job fairly late in the

Re: [libvirt] [PATCH v5] automatic create tap device with network type ethernet

2014-12-16 Thread Vasiliy Tolstov
Does this patch now looks ok? 2014-12-12 19:34 GMT+03:00 Vasiliy Tolstov v.tols...@selfip.ru: 2014-12-12 19:33 GMT+03:00 Eric Blake ebl...@redhat.com: When resending a series, it's better to make a new top-level thread, rather than trying to bury the updated patch in-reply-to an existing

[libvirt] [PATCH] Drop hle feature for Haswell CPUs

2014-12-16 Thread Guido Günther
The intel-microcode 3.20140913.1 update disables TSX-NI (transactional memory instructions). When a server running libvirt is rebooted with this update, libvirt no longer considers the machine to have a Haswell CPU: # virsh capabilities | grep -A1 'archx86_64' archx86_64/arch

Re: [libvirt] [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.

2014-12-16 Thread Ian Jackson
Anthony PERARD writes (Re: [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.): On Tue, Dec 16, 2014 at 09:30:28AM +, Ian Campbell wrote: Unless by not running you meant bottlenecked or not keeping up perhaps. Well, I did meant no xenconsoled process. But after, I

Re: [libvirt] [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.

2014-12-16 Thread Ian Jackson
Ian Jackson writes (Re: [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.): I mention all of these for completeness, and for future reference for anyone reading the archives later. In libxl you want option I. I mean `in xl you want option I'. In libvirt you probably want

Re: [libvirt] [PATCH] qemu: fix use a nonexist address in qemuDomainAttachDeviceConfig

2014-12-16 Thread Luyao Huang
On 12/16/2014 08:00 PM, Peter Krempa wrote: On 12/15/14 10:10, Luyao Huang wrote: We free them before, then use it. This make we always do We clear the pointer, not free. virDomainDefAddImplicitControllers when attach a disk. Signed-off-by: Luyao Huang lhu...@redhat.com ---

Re: [libvirt] [PATCH] Drop hle feature for Haswell CPUs

2014-12-16 Thread Daniel P. Berrange
On Tue, Dec 16, 2014 at 01:33:15PM +0100, Guido Günther wrote: The intel-microcode 3.20140913.1 update disables TSX-NI (transactional memory instructions). When a server running libvirt is rebooted with this update, libvirt no longer considers the machine to have a Haswell CPU: # virsh

Re: [libvirt] [PATCH] qemu: fix use a nonexist address in qemuDomainAttachDeviceConfig

2014-12-16 Thread Peter Krempa
On 12/16/14 13:32, Luyao Huang wrote: On 12/16/2014 08:00 PM, Peter Krempa wrote: On 12/15/14 10:10, Luyao Huang wrote: We free them before, then use it. This make we always do We clear the pointer, not free. virDomainDefAddImplicitControllers when attach a disk. Signed-off-by: Luyao

Re: [libvirt] [PATCH v2 02/12] qemu: let blockinfo reuse virStorageSource

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: Right now, grabbing blockinfo always calls stat on the disk, then opens the image to determine the capacity, using a throw-away virStorageSourcePtr. This has a couple of drawbacks: 1. We are calling stat and opening a file on every invocation of the

Re: [libvirt] [PATCH] qemu: fix use a nonexist address in qemuDomainAttachDeviceConfig

2014-12-16 Thread Luyao Huang
On 12/16/2014 08:33 PM, Peter Krempa wrote: On 12/16/14 13:32, Luyao Huang wrote: On 12/16/2014 08:00 PM, Peter Krempa wrote: On 12/15/14 10:10, Luyao Huang wrote: We free them before, then use it. This make we always do We clear the pointer, not free. virDomainDefAddImplicitControllers

Re: [libvirt] [PATCH v2 03/12] getstats: prepare monitor collection for recursion

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: A future patch will allow recursion into backing chains when collecting block stats. This patch should not change behavior, but merely moves out the common code that will be reused once recursion is enabled, and adds the parameter that will turn on

Re: [libvirt] [PATCH v2 2/2] qemu: completely rework reference counting

2014-12-16 Thread Michal Privoznik
On 16.12.2014 11:15, Martin Kletzander wrote: There is one problem that causes various errors in the daemon. When domain is waiting for a job, it is unlocked while waiting on the condition. However, if that domain is for example transient and being removed in another API (e.g. cancelling

Re: [libvirt] [PATCH v2 1/2] conf: Rework virDomainObjListFindByUUID to allow more concurrent APIs

2014-12-16 Thread Michal Privoznik
On 16.12.2014 11:15, Martin Kletzander wrote: Currently, when there is an API that's blocking with locked domain and second API that's waiting in virDomainObjListFindByUUID() for the domain lock (with the domain list locked) no other API can be executed on any domain on the whole hypervisor

[libvirt] [libvirt-python][PATCH] Bump version to 1.2.12 for new dev cycle

2014-12-16 Thread Michal Privoznik
Signed-off-by: Michal Privoznik mpriv...@redhat.com --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c69fa15..507e156 100755 --- a/setup.py +++ b/setup.py @@ -309,7 +309,7 @@ class my_clean(clean): _c_modules, _py_modules =

Re: [libvirt] [libvirt-python][PATCH] Bump version to 1.2.12 for new dev cycle

2014-12-16 Thread Martin Kletzander
On Tue, Dec 16, 2014 at 02:09:46PM +0100, Michal Privoznik wrote: Signed-off-by: Michal Privoznik mpriv...@redhat.com --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c69fa15..507e156 100755 --- a/setup.py +++ b/setup.py @@ -309,7 +309,7

Re: [libvirt] [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.

2014-12-16 Thread Ian Campbell
On Tue, 2014-12-16 at 12:36 +, Ian Jackson wrote: Anthony PERARD writes (Re: [Xen-devel] [PATCH V2] libxl: Set path to console on domain startup.): On Tue, Dec 16, 2014 at 09:30:28AM +, Ian Campbell wrote: Unless by not running you meant bottlenecked or not keeping up perhaps.

Re: [libvirt] [PATCH v2 06/12] qemu: fix bugs in blockstats

2014-12-16 Thread John Ferlan
Ran the series through my local Coverity checker found one issue On 12/16/2014 03:04 AM, Eric Blake wrote: The documentation for virDomainBlockInfo was confusing: it stated that 'physical' was the size of the container, then gave an example of it being the amount of storage used by a

Re: [libvirt] [PATCH v2 04/12] getstats: perform recursion in monitor collection

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: When requested in a later patch, the QMP command results are now examined recursively. As qemu_driver will eventually have to read items out of the hash table as stored by this patch, the computation of backing alias string is done in a shared location.

Re: [libvirt] [PATCH v6] automatic create tap device with network type ethernet

2014-12-16 Thread Michal Privoznik
On 12.12.2014 17:08, Vasiliy Tolstov wrote: If user not specify network type ethernet, assume that user needs simple tap device created with libvirt. This patch does not need to run external script to create tap device or add root to qemu process. Also libvirt runs script after device

Re: [libvirt] [PATCH v2 05/12] getstats: rearrange blockinfo gathering

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: We want to avoid read()ing a file while qemu is running. We still have to open() block devices to determine their physical size, but that is safer. This patch rearranges code to make it easier to skip the metadata collection when possible. *

Re: [libvirt] [PATCH v2] storage: unify permission formatting

2014-12-16 Thread Michal Privoznik
On 11.12.2014 12:09, Martin Kletzander wrote: Volume and pool formatting functions took different approaches to unspecified uids/gids. When unknown, it is always parsed as -1, but one of the functions formatted it as unsigned int (wrong) and one as int (better). Due to that, our two of our XML

Re: [libvirt] [PATCH 0/2] Refactor safezero and virStorageFileResize

2014-12-16 Thread Michal Privoznik
On 15.12.2014 22:13, John Ferlan wrote: Originally included as part of a series to fix a problem with file creation and resize within NFS storage pools that ended up being an issue somewhere lower in the stack of posix_fallocate or the setting of the block size in the meta data. The following

Re: [libvirt] [PATCH] Drop hle feature for Haswell CPUs

2014-12-16 Thread Guido Günther
On Tue, Dec 16, 2014 at 12:40:26PM +, Daniel P. Berrange wrote: On Tue, Dec 16, 2014 at 01:33:15PM +0100, Guido Günther wrote: The intel-microcode 3.20140913.1 update disables TSX-NI (transactional memory instructions). When a server running libvirt is rebooted with this update, libvirt

Re: [libvirt] [PATCH v2 06/12] qemu: fix bugs in blockstats

2014-12-16 Thread Peter Krempa
On 12/16/14 14:17, John Ferlan wrote: Ran the series through my local Coverity checker found one issue On 12/16/2014 03:04 AM, Eric Blake wrote: The documentation for virDomainBlockInfo was confusing: it stated that 'physical' was the size of the container, then gave an example of

Re: [libvirt] [PATCH] Drop hle feature for Haswell CPUs

2014-12-16 Thread Daniel P. Berrange
On Tue, Dec 16, 2014 at 03:37:06PM +0100, Guido Günther wrote: On Tue, Dec 16, 2014 at 12:40:26PM +, Daniel P. Berrange wrote: On Tue, Dec 16, 2014 at 01:33:15PM +0100, Guido Günther wrote: The intel-microcode 3.20140913.1 update disables TSX-NI (transactional memory instructions).

Re: [libvirt] [PATCH v2 07/12] qemu: refactor blockinfo data gathering

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: Create a helper function that can be reused for gathering block info from virDomainListGetStats. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Split guts... (qemuStorageLimitsRefresh): ...into new helper function. Signed-off-by: Eric Blake

Re: [libvirt] [PATCH v2 08/12] getstats: report block sizes for offline domains

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: The prior refactoring can now be put to use. With the same domain as the previous commit (one qcow2 disk and an empty cdrom drive): $ virsh domstats --block foo Domain: 'foo' block.count=2 block.0.name=hda block.0.allocation=200704

Re: [libvirt] [PATCH v2 09/12] getstats: prepare for dynamic block.count stat

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: A coming patch will make it optionally possible to list backing chain block stats; in this mode of operation, block.counts is no longer the number of disks in the domain, but the number of blocks in the array being reported. We still want block.count

Re: [libvirt] [PATCH v2 10/12] getstats: add new flag for block backing chain

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: This patch introduces access to allocation information about a backing chain of a live domain. While querying storage volumes for read-only disks could provide some of the details, there is one case where we have to rely on qemu: when doing a block commit

Re: [libvirt] [PATCH 1/2] logical: Use correct syntax for thin/sparse pool creation

2014-12-16 Thread Daniel P. Berrange
On Fri, Dec 12, 2014 at 04:14:29PM -0500, John Ferlan wrote: Commit id '1ffc78b5' was supposed to support for thin logical volumes; however, instead it added support for thin snapshot volumes. This worked fine for a few releases of LVM; however, more recent versions (not sure exactly which

Re: [libvirt] [PATCH v2 07/12] qemu: refactor blockinfo data gathering

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: Create a helper function that can be reused for gathering block info from virDomainListGetStats. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Split guts... (qemuStorageLimitsRefresh): ...into new helper function. Signed-off-by: Eric Blake

Re: [libvirt] [PATCH] conf: fix cannot start a guest have a shareable network iscsi hostdev

2014-12-16 Thread Michal Privoznik
On 16.12.2014 04:16, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1174569 We should do nothing for the shareable network iscsi hostdev in qemuAddSharedHostdev and qemuRemoveSharedHostdev. Shareable for a network iscsi hostdev is not valid, so just ignore it. If it is

Re: [libvirt] [PATCH v2 12/12] getstats: start crawling backing chain for qemu

2014-12-16 Thread Peter Krempa
On 12/16/14 09:04, Eric Blake wrote: Wire up backing chain recursion. Note that for now, we just use the same allocation numbers for read-only backing files as what offline domains would report. It is not the correct allocation number for qcow2 over block devices during block-commit, and it

Re: [libvirt] [PATCH v2 2/2] qemu: completely rework reference counting

2014-12-16 Thread Martin Kletzander
On Tue, Dec 16, 2014 at 02:00:09PM +0100, Michal Privoznik wrote: On 16.12.2014 11:15, Martin Kletzander wrote: There is one problem that causes various errors in the daemon. When domain is waiting for a job, it is unlocked while waiting on the condition. However, if that domain is for

[libvirt] [PATCH 10/11] Fix vm usage after ExitMonitor in qemu migration

2014-12-16 Thread Ján Tomko
It should not be needed in all qemuMigrationSet* functions, but I changed them all for consistency. --- src/qemu/qemu_migration.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c

[libvirt] [PATCH 09/11] Fix vm usage after ExitMonitor in qemu driver

2014-12-16 Thread Ján Tomko
--- src/qemu/qemu_driver.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 20b54cc..035a51d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2360,7 +2360,8 @@ static int

[libvirt] [PATCH 04/11] Fix vm usage after ExitMonitor on device removal

2014-12-16 Thread Ján Tomko
In the device type-specific functions, exit early if the domain has disappeared, because the cleanup should have been done by qemuProcessStop. In processDeviceDeletedEvent, only save status XML if the domain is still running and exit early in qemuProcessUpdateDevices if the domain disappeared.

[libvirt] [PATCH 02/11] Mark the domain as active in qemuhotplugtest

2014-12-16 Thread Ján Tomko
This will allow us to call qemuDomainObjIsActive() in the tested functions to check if the domain has crashed. --- tests/qemuhotplugtest.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9d39968..49e4272 100644 ---

[libvirt] [PATCH 11/11] Fix vm usage after ExitMonitor in qemu process

2014-12-16 Thread Ján Tomko
--- src/qemu/qemu_process.c | 63 - 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d4af85c..d6de22b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@

[libvirt] [PATCH 03/11] Fix vm usage after ExitMonitor in UpdateDeviceList

2014-12-16 Thread Ján Tomko
Error out if the domain has disappeared in the meantime. Explicitly check if the domain is alive in qemuDomain{Attach,Detach}Live, where the return value is ignored. This prevents writing the persistent definition as the domain status and calling qemuDomainRemoveDevice on devices that already

[libvirt] [PATCH 01/11] Introduce qemuDomainObjExitMonitorAlive

2014-12-16 Thread Ján Tomko
The domain might disappear during the time in monitor when the virDomainObjPtr is unlocked, so the caller needs to check if it's still alive. Introduce a helper function for the callers that want to report an error in this case. --- src/qemu/qemu_domain.c | 17 +

[libvirt] [PATCH 05/11] Fix error message on redirdev caps detection

2014-12-16 Thread Ján Tomko
--- src/qemu/qemu_command.c | 6 +- src/qemu/qemu_hotplug.c | 14 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 53d6629..11e7cff 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@

[libvirt] [PATCH 07/11] Fix vm usage after ExitMonitor in DetachDevice

2014-12-16 Thread Ján Tomko
If the domain died and was cleaned up by qemuProcessStop, we don't need to do the cleanup (and vm-def might have been relpaced). --- src/qemu/qemu_hotplug.c | 54 - 1 file changed, 36 insertions(+), 18 deletions(-) diff --git

[libvirt] [PATCH 06/11] Fix vm usage after ExitMonitor on AttachDevice

2014-12-16 Thread Ján Tomko
If the domain has died while we were in the monitor, do not clean up what was cleaned up in qemuProcessStop. --- src/qemu/qemu_hotplug.c | 83 + 1 file changed, 56 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH 08/11] Fix monitor usage in qemuDomainHotplugVcpus

2014-12-16 Thread Ján Tomko
Exit the monitor right after we've done with it to get the virDomainObjPtr lock back, otherwise we might be accessing vm-def while it's being cleaned up by qemuProcessStop. If the domain crashed while we were in the monitor, exit early instead of changing vm-def which is now the persistent

[libvirt] [PATCH 00/11] Fix vm usage after ExitMonitor

2014-12-16 Thread Ján Tomko
Check if the domain died while we were in the monitor in most of the places (I didn't look at the Snapshot and Blockjob APIs yet). In some places, we've been accessing the data after it could've been freed by qemuProcessStop (if the monitor API itself returned success, but the domain was cleaned

Re: [libvirt] [PATCH 1/2] logical: Use correct syntax for thin/sparse pool creation

2014-12-16 Thread John Ferlan
On 12/16/2014 10:20 AM, Daniel P. Berrange wrote: On Fri, Dec 12, 2014 at 04:14:29PM -0500, John Ferlan wrote: ...snip... I'm unclear still on what the difference is between a thin snapshot (with no backing volume) and a thin volume ? I've asked that question of someone from lvm... The

[libvirt] [PATCHv2] logical: Add --type snapshot to lvcreate command

2014-12-16 Thread John Ferlan
A recent lvm change has resulted in a change for the default type of logical volume created when the --virtualsize or --V is supplied on the command line (e.g. when the allocation and capacity values of a to be created volume differ). It seems that at the very least the following change adjusts

[libvirt] [PATCH] conf: Fix invalid condition when parsing storage owner

2014-12-16 Thread Martin Kletzander
In commit d2632d60 we agreed taht we want the parsed uid to properly overflow but only to -1, however the value was read into long and then wrapped into uid_t. That meaned it failed on 32-bit systems. Signed-off-by: Martin Kletzander mklet...@redhat.com --- Notes: Pushed as build-breaker

[libvirt] [PATCH 0/3] Various build fixes

2014-12-16 Thread Martin Kletzander
Fix some problems coverity and mingw build found out. Martin Kletzander (3): qemu: Add missing goto error in qemuRestoreCgroupState qemu: Free saved error in qemuDomainSetVcpusFlags util: Fix fallocate stubs for mingw build src/qemu/qemu_cgroup.c | 1 + src/qemu/qemu_driver.c | 1 +

[libvirt] [PATCH 2/3] qemu: Free saved error in qemuDomainSetVcpusFlags

2014-12-16 Thread Martin Kletzander
Commit e3435caf added cleanup code to qemuDomainSetVcpusFlags() that was not supposed to reset the error. Usual procedure was done, saving the error to temporary variable, but it was never free'd, but rather leaked. Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/qemu/qemu_driver.c

[libvirt] [PATCH 3/3] util: Fix fallocate stubs for mingw build

2014-12-16 Thread Martin Kletzander
When any of the functions modified in commit 214c687b took false branch, the function itself used none of its parameters resulting in unused parameter error. Rewriting these functions to the stubs we use elsewhere should fix the problem. Signed-off-by: Martin Kletzander mklet...@redhat.com ---

[libvirt] [PATCH 1/3] qemu: Add missing goto error in qemuRestoreCgroupState

2014-12-16 Thread Martin Kletzander
Commit af2a1f05 tried clearly separating each condition in qemuRestoreCgroupState() for the sake of readability, however somehow one condition body was missing. That means that the body of the next condition got executed only if both of there were true, which is impossible, thus resulting in a

Re: [libvirt] [PATCH 1/3] qemu: Add missing goto error in qemuRestoreCgroupState

2014-12-16 Thread Eric Blake
On 12/16/2014 12:13 PM, Martin Kletzander wrote: Commit af2a1f05 tried clearly separating each condition in qemuRestoreCgroupState() for the sake of readability, however somehow one condition body was missing. That means that the body of the next condition got executed only if both of there

Re: [libvirt] [PATCH 2/3] qemu: Free saved error in qemuDomainSetVcpusFlags

2014-12-16 Thread Eric Blake
On 12/16/2014 12:13 PM, Martin Kletzander wrote: Commit e3435caf added cleanup code to qemuDomainSetVcpusFlags() that was not supposed to reset the error. Usual procedure was done, saving the error to temporary variable, but it was never free'd, but rather leaked. Signed-off-by: Martin

Re: [libvirt] [PATCH 3/3] util: Fix fallocate stubs for mingw build

2014-12-16 Thread Eric Blake
On 12/16/2014 12:13 PM, Martin Kletzander wrote: When any of the functions modified in commit 214c687b took false branch, the function itself used none of its parameters resulting in unused parameter error. Rewriting these functions to the stubs we use elsewhere should fix the problem.

Re: [libvirt] [PATCH 1/3] qemu: Add missing goto error in qemuRestoreCgroupState

2014-12-16 Thread Martin Kletzander
On Tue, Dec 16, 2014 at 12:29:39PM -0700, Eric Blake wrote: On 12/16/2014 12:13 PM, Martin Kletzander wrote: Commit af2a1f05 tried clearly separating each condition in qemuRestoreCgroupState() for the sake of readability, however somehow one condition body was missing. That means that the body

Re: [libvirt] [PATCH 3/3] util: Fix fallocate stubs for mingw build

2014-12-16 Thread Eric Blake
On 12/16/2014 12:13 PM, Martin Kletzander wrote: When any of the functions modified in commit 214c687b took false branch, the function itself used none of its parameters resulting in unused parameter error. Rewriting these functions to the stubs we use elsewhere should fix the problem.

Re: [libvirt] [PATCH 3/3] util: Fix fallocate stubs for mingw build

2014-12-16 Thread Martin Kletzander
On Tue, Dec 16, 2014 at 12:51:22PM -0700, Eric Blake wrote: On 12/16/2014 12:13 PM, Martin Kletzander wrote: When any of the functions modified in commit 214c687b took false branch, the function itself used none of its parameters resulting in unused parameter error. Rewriting these functions

Re: [libvirt] [RFC] The Quest for Domain-IP Mapping Continues...

2014-12-16 Thread Eric Blake
On 12/14/2014 03:08 PM, Nehal J Wani wrote: I think yuou should redo that patch series adding the DHCP lease support, since that's the reason we didn't merge that code last time around. The patch series is ready, but I have one question: From a developer's point of view, what should happen,

Re: [libvirt] How to use blockcopy in libvirt-java

2014-12-16 Thread Claudio Bley
At Wed, 10 Dec 2014 18:16:57 +0800, Star Guo wrote: Hi, ALL, I just look for the class and method to use blockcopy in libvirt-java on this page: http://libvirt.org/sources/java/javadoc/ However, I can not find out. Libvirt-java Support blockcopy ? Thanks. No, currently libvirt-java

Re: [libvirt] [PATCH v2 02/12] qemu: let blockinfo reuse virStorageSource

2014-12-16 Thread Eric Blake
On 12/16/2014 05:41 AM, Peter Krempa wrote: On 12/16/14 09:04, Eric Blake wrote: Right now, grabbing blockinfo always calls stat on the disk, then opens the image to determine the capacity, using a throw-away virStorageSourcePtr. This has a couple of drawbacks: While this patch does not

Re: [libvirt] [PATCH] avoid using deprecated udev logging functions

2014-12-16 Thread Guido Günther
On Mon, Dec 15, 2014 at 03:33:13PM +, Daniel P. Berrange wrote: In systemd = 218, the udev_set_log_fn method has been marked deprecated and turned into a no-op. Nothing in the udev client library will print to stderr by default anymore, so we can just stop installing a logging hook for new

[libvirt] virSecurityLabel

2014-12-16 Thread Claudio Bley
Hi. Looking at the API docs, the virSecurityLabel is one of the undisclosed structs, making its members not publicly available. Is this a mistake? It seems the a virSecurityLabel or virSecurityLabelPtr retrieved by the virDomainGetSecurityLabel et. al. would be rather useless without being able

Re: [libvirt] [PATCH] Buffer size too small when reading sysinfo on S390

2014-12-16 Thread Boris Fiuczynski
On 12/15/2014 07:02 PM, Eric Blake wrote: On 12/15/2014 06:57 AM, Jiri Denemark wrote: On Mon, Dec 15, 2014 at 14:16:31 +0100, Boris Fiuczynski wrote: On a system with 160 CPUs the /proc/cpuinfo size grows beyond the currently set limit of 10KB causing an internal error. This patch increases

Re: [libvirt] [PATCH] avoid using deprecated udev logging functions

2014-12-16 Thread Eric Blake
On 12/16/2014 03:08 PM, Guido Günther wrote: On Mon, Dec 15, 2014 at 03:33:13PM +, Daniel P. Berrange wrote: In systemd = 218, the udev_set_log_fn method has been marked deprecated and turned into a no-op. Nothing in the udev client library will print to stderr by default anymore, so we

Re: [libvirt] [PATCH v2 05/12] getstats: rearrange blockinfo gathering

2014-12-16 Thread Eric Blake
On 12/16/2014 06:54 AM, Peter Krempa wrote: On 12/16/14 09:04, Eric Blake wrote: We want to avoid read()ing a file while qemu is running. We still have to open() block devices to determine their physical size, but that is safer. This patch rearranges code to make it easier to skip the

Re: [libvirt] [PATCH v2 06/12] qemu: fix bugs in blockstats

2014-12-16 Thread Eric Blake
On 12/16/2014 06:17 AM, John Ferlan wrote: Ran the series through my local Coverity checker found one issue - format, NULL))) +if (format == VIR_STORAGE_FILE_RAW) { +disk-src-capacity = disk-src-physical; +} else if

Re: [libvirt] virDomainGetBlockInfo meanings

2014-12-16 Thread Eric Blake
On 12/16/2014 03:16 AM, Daniel P. Berrange wrote: On Mon, Dec 15, 2014 at 05:29:14PM -0700, Eric Blake wrote: I'm really struggling with how to interpret the virDomainBlockInfo struct, and think that we may want to consider the current behavior buggy and offer improved behavior going forward.

[libvirt] [PATCHv7 0/4] Introduce API to query IP addresses for given domain

2014-12-16 Thread Nehal J Wani
This feature has been requested for a very long time. Since qemu guest agent gives us reliable results, now the wait is over. The RFC was first proposed by Michal Privoznik: http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html A patch was submitted, using structs:

[libvirt] [PATCHv7 1/4] domifaddr: Implement the public APIs

2014-12-16 Thread Nehal J Wani
Define helper function virDomainInterfaceFree, which allows the upper layer application to free the domain interface object conveniently. The API is going to provide multiple methods by flags, e.g. * Query guest agent * Parse DHCP lease file include/libvirt/libvirt-domain.h * Define

[libvirt] [PATCHv7 2/4] domifaddr: Implement the remote protocol

2014-12-16 Thread Nehal J Wani
daemon/remote.c * Define remoteSerializeDomainInterface, remoteDispatchDomainInterfaceAddresses src/remote/remote_driver.c * Define remoteDomainInterfaceAddresses src/remote/remote_protocol.x * New RPC procedure: REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES * Define structs

[libvirt] [PATCHv7 3/4] domifaddr: Implement the API for qemu

2014-12-16 Thread Nehal J Wani
By querying the qemu guest agent with the QMP command guest-network-get-interfaces and converting the received JSON output to structured objects. Although ifconfig is deprecated, IP aliases created by ifconfig are supported by this API. The legacy syntax of an IP alias is: ifname:alias-name.

[libvirt] [PATCHv7 4/4] domifaddr: Add virsh support

2014-12-16 Thread Nehal J Wani
tools/virsh-domain-monitor.c * Introduce new command : domifaddr Usage: domifaddr domain [interface] [--full] [--lease] [--agent] Example outputs: virsh # domifaddr f20 Name MAC address Protocol Address

Re: [libvirt] [PATCH V2 1/5] Add public API virDomainSendSysrq

2014-12-16 Thread Eric Blake
On 12/15/2014 11:51 PM, Chun Yan Liu wrote: I tried to define as 'char key', but meet some trouble in remote protocol, +struct remote_domain_send_sysrq_args { +remote_nonnull_domain dom; +char key; +}; will report 'char key' as unsupported type. Any ideas here? For the

Re: [libvirt] [PATCH] avoid using deprecated udev logging functions

2014-12-16 Thread Guido Günther
On Tue, Dec 16, 2014 at 03:28:33PM -0700, Eric Blake wrote: On 12/16/2014 03:08 PM, Guido Günther wrote: On Mon, Dec 15, 2014 at 03:33:13PM +, Daniel P. Berrange wrote: In systemd = 218, the udev_set_log_fn method has been marked deprecated and turned into a no-op. Nothing in the udev

  1   2   >