Re: [libvirt] [PATCH v2 06/11] qemu_migration: Introduce qemuMigrationStartNBDServer

2012-12-18 Thread li guang
在 2012-12-10一的 20:27 +0100,Michal Privoznik写道: This is a stub internal API just for now. Its purpose in life is to start NBD server and feed it with all domain disks. When adding a disk to NBD server, it is addressed via its alias (id= param on qemu command line). --- src/qemu/qemu_driver.c

Re: [libvirt] [PATCH v2 02/11] Introduce NBD migration cookie

2012-12-18 Thread li guang
在 2012-12-10一的 20:27 +0100,Michal Privoznik写道: This migration cookie is meant for two purposes. The first is to be sent in begin phase from source to destination to let it know we support new implementation of VIR_MIGRATE_NON_SHARED_{DISK,INC} so destination can start NBD server. Then, the

Re: [libvirt] [PATCH 1/6] Introduce a set of APIs for managing architectures

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:36 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Introduce a 'virArch' enum for CPU architectures. Include data type providing wordsize and endianness, and APIs to query this info and convert to/from enum and string form. ...

Re: [libvirt] [PATCH 2/6] Convert nodeGetInfo to virArch APIs

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:37 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Replace use of uname in nodeGetInfo with virArch APIs to provide canonicalization of host architecture name Signed-off-by: Daniel P. Berrange berra...@redhat.com ---

Re: [libvirt] [PATCH 3/6] Convert QEMU command line builder to virArch APIs

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:38 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Use virArch APIs to determine host architecture when launching QEMU. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_command.c | 25

Re: [libvirt] [PATCH 1/6] Introduce a set of APIs for managing architectures

2012-12-18 Thread Daniel P. Berrange
On Tue, Dec 18, 2012 at 10:24:06AM +0100, Jiri Denemark wrote: On Tue, Dec 11, 2012 at 14:53:36 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Introduce a 'virArch' enum for CPU architectures. Include data type providing wordsize and endianness, and APIs to

Re: [libvirt] [PATCH 1/6] Introduce a set of APIs for managing architectures

2012-12-18 Thread Daniel P. Berrange
On Tue, Dec 18, 2012 at 10:24:06AM +0100, Jiri Denemark wrote: On Tue, Dec 11, 2012 at 14:53:36 +, Daniel P. Berrange wrote: +virArch virArchFromHost(void) +{ +struct utsname ut; +virArch arch; + +uname(ut); + +/* Some special cases we need to handle first +

Re: [libvirt] [PATCH 4/6] Convert capabilities / domain_conf to use virArch

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:39 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Convert the host capabilities and domain config structs to use the virArch datatype. Update the parsers and all drivers to take account of datatype change ... diff --git

Re: [libvirt] [PATCH 3/5] conf: Don't format cputune element when not needed

2012-12-18 Thread Martin Kletzander
On 12/18/2012 04:01 AM, Osier Yang wrote: On 2012年12月17日 23:17, Martin Kletzander wrote: Commit 60b176c3d0f0d5037acfa5e27c7753f657833a0b introduced a bug that when editing an XML with cputune similar to this: Thanks for fixing this. ... vcpu placement='static' current='1'2/vcpu

Re: [libvirt] [PATCH 3/5] conf: Don't format cputune element when not needed

2012-12-18 Thread Osier Yang
On 2012年12月18日 19:20, Martin Kletzander wrote: On 12/18/2012 04:01 AM, Osier Yang wrote: On 2012年12月17日 23:17, Martin Kletzander wrote: Commit 60b176c3d0f0d5037acfa5e27c7753f657833a0b introduced a bug that when editing an XML with cputune similar to this: Thanks for fixing this. ...

Re: [libvirt] [PATCH 5/6] Convert CPU APIs to use virArch

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:40 +, Daniel P. Berrange wrote: ... diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 8cb54a3..2b3b44d 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c ... @@ -740,10 +745,11 @@ virCPUDefIsEqual(virCPUDefPtr src, goto cleanup;

Re: [libvirt] [PATCH 6/6] Convert QEMU capabilities code to use virArch

2012-12-18 Thread Jiri Denemark
On Tue, Dec 11, 2012 at 14:53:41 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_capabilities.c | 94 ++-- src/qemu/qemu_capabilities.h | 2 +-

[libvirt] [PATCH] docs: Fix documentation for readonly element

2012-12-18 Thread Jiri Denemark
--- Pushed as trivial. docs/formatdomain.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8d9ab9e..94df6f8 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1631,7 +1631,7 @@

Re: [libvirt] libvirt domcument question

2012-12-18 Thread Jiri Denemark
On Sat, Dec 15, 2012 at 23:53:41 +0800, zhijun liu wrote: hi,all when I read the document at http://libvirt.org/formatdomain.html about the domain's xml format ,disk element has a optional subelment is readonly,when I read the paragraph:readonlyIf present, this indicates the device cannot

[libvirt] [PATCH] Add smartcard support to libvirt-gconfig

2012-12-18 Thread alexl
From: Alexander Larsson al...@redhat.com This handles smartcard devices. --- libvirt-gconfig/Makefile.am| 8 ++ .../libvirt-gconfig-domain-device-private.h| 3 + libvirt-gconfig/libvirt-gconfig-domain-device.c| 2 +-

[libvirt] [RFC] qcow2v3 features support

2012-12-18 Thread Ján Tomko
Since 1.1 [1], QEMU supports qcow2 version 3 images. These are still reffered to as qcow2 everywhere (qmp, qemu/qemu-img command line). This format (besides some internal improvements) includes a bitfield of compatible/incompatible/auto-clear features. [2] The only feature so far is delayed

Re: [libvirt] [RFC] qcow2v3 features support

2012-12-18 Thread Daniel P. Berrange
On Tue, Dec 18, 2012 at 02:41:21PM +0100, Ján Tomko wrote: Since 1.1 [1], QEMU supports qcow2 version 3 images. These are still reffered to as qcow2 everywhere (qmp, qemu/qemu-img command line). This format (besides some internal improvements) includes a bitfield of

[libvirt] [PATCH 6/6 v2] Convert QEMU capabilities code to use virArch

2012-12-18 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_capabilities.c | 155 +-- src/qemu/qemu_capabilities.h | 2 +- 2 files changed, 76 insertions(+), 81 deletions(-) diff --git

[libvirt] [PATCH v2.1 01/11] qemu: Introduce NBD_SERVER capability

2012-12-18 Thread Michal Privoznik
This just keeps track whether qemu knows nbd-server-* commands so we can use it during migration or not. --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index

[libvirt] [PATCH v2.1 00/11] Rework storage migration

2012-12-18 Thread Michal Privoznik
This patch set re-implements migration with storage for enough new qemu. Currently, you can migrate a domain to a host without need for shared storage. This is done by setting 'blk' or 'inc' attribute (representing VIR_MIGRATE_NON_SHARED_DISK and VIR_MIGRATE_NON_SHARED_INC flags respectively) of

[libvirt] [PATCH v2.1 03/11] qemu: Introduce nbd-server-start command

2012-12-18 Thread Michal Privoznik
This will be used with new migration scheme. This patch creates basically just monitor stub functions. Wiring them into something useful is done in later patches. --- src/qemu/qemu_monitor.c | 22 src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 49

[libvirt] [PATCH v2.1 07/11] qemu_migration: Move port allocation to a separate func

2012-12-18 Thread Michal Privoznik
There's a code snippet which allocates a port for incoming migration. We will need this for allocating a port for incoming disks as well. Hence, move this snippet into a separate function called qemuMigrationNextPort(). --- src/qemu/qemu_migration.c | 19 +-- 1 file changed, 13

[libvirt] [PATCH v2.1 08/11] qemu_migration: Implement qemuMigrationStartNBDServer()

2012-12-18 Thread Michal Privoznik
We need to start NBD server and feed it with all non-shared/ disks. However, after qemuDomainObjEnterMonitorAsync the domain object is unlocked so we cannot touch its disk definitions. Therefore, we must prepare the list of disk IDs prior entering monitor. --- src/qemu/qemu_migration.c | 59

[libvirt] [PATCH v2.1 02/11] Introduce NBD migration cookie

2012-12-18 Thread Michal Privoznik
This migration cookie is meant for two purposes. The first is to be sent in begin phase from source to destination to let it know we support new implementation of VIR_MIGRATE_NON_SHARED_{DISK,INC} so destination can start NBD server. Then, the second purpose is, destination can let us know, on

[libvirt] [PATCH v2.1 11/11] qemu_migration: Stop NBD server at Finish phase

2012-12-18 Thread Michal Privoznik
At the end of migration, it is important to stop NBD server and thus release all allocated resources. --- src/qemu/qemu_migration.c | 28 1 file changed, 28 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index f362a63..8df7d5f 100644

[libvirt] [PATCH v2.1 04/11] qemu: Introduce nbd-server-add command

2012-12-18 Thread Michal Privoznik
This will be used with new migration scheme. This patch creates basically just monitor stub functions. Wiring them into something useful is done in later patches. --- src/qemu/qemu_monitor.c | 22 ++ src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 25

[libvirt] [PATCH v2.1 06/11] qemu_migration: Introduce qemuMigrationStartNBDServer

2012-12-18 Thread Michal Privoznik
This is a stub internal API just for now. Its purpose in life is to start NBD server and feed it with all domain disks. When adding a disk to NBD server, it is addressed via its alias (id= param on qemu command line). --- src/qemu/qemu_migration.c | 46

[libvirt] [PATCH v2.1 09/11] qemu_migration: Implement qemuMigrationDriveMirror

2012-12-18 Thread Michal Privoznik
This function does the source part of NBD magic. It invokes drive-mirror on each non shared disk and wait till the mirroring process completes. When it does we can proceed with migration. Currently, an active waiting is done: every 50ms libvirt asks qemu if block-job is finished or not. However,

[libvirt] [PATCH v2.1 10/11] qemu_migration: Check size prerequisites

2012-12-18 Thread Michal Privoznik
With new NBD storage migration approach there are several requirements that need to be meet for successful use of the feature. One of them is - the file representing a disk, needs to have at least same size as on the source. Hence, we must transfer a list of pairs [disk source, size] and check on

[libvirt] [PATCH 0/6 v8] Unprivleged SG_IO support

2012-12-18 Thread Osier Yang
As a result of RFC [1], this implements the unprivleged SG_IO support. 1/6 and 2/6 are already acked. v7 - v8: * Change the XML tag name from cdbfilter to sgio, and to leave enough room for future values, the values of sgio are filtered and unfiltered now. v6 - v7: * No

[libvirt] [PATCH 2/6] qemu: Add a hash table for the shared disks

2012-12-18 Thread Osier Yang
This introduces a hash table for qemu driver, to store the shared disk's info as (@major:minor, @ref_count). @ref_count is the number of domains which shares the disk. Since we only care about if the disk support unprivileged SG_IO commands, and the SG_IO commands only make sense for block disk,

[libvirt] [PATCH 3/6] docs: Add docs and rng schema for new XML tag sgio

2012-12-18 Thread Osier Yang
This introduces new XML tag sgio for disk, its valid values are filtered and unfiltered, setting it as filtered will set the disk's unpriv_sgio to 0, and unfiltered to set it as 1, which allows the unprivileged SG_IO commands. --- docs/formatdomain.html.in | 14 ++-

[libvirt] [PATCH 6/6] qemu: Check if the shared disk's cdbfilter conflicts with others

2012-12-18 Thread Osier Yang
This prevents domain starting and disk attaching if the shared disk's setting conflicts with other active domain(s), E.g. A domain with sgio set as filtered, however, another active domain is using it set as unfiltered. --- src/qemu/qemu_driver.c |5 src/qemu/qemu_process.c | 53

[libvirt] [PATCH 5/6] qemu: set unpriv_sgio when starting domain and attaching disk

2012-12-18 Thread Osier Yang
This ignores the default filtered if unpriv_sgio is not supported by kernel, but for explicit request filtered, it error out for domain starting. --- src/libvirt_private.syms |1 + src/qemu/qemu_driver.c | 15 +-- src/qemu/qemu_process.c | 31 +++

[libvirt] [PATCH 1/6] util: Prepare helpers for unpriv_sgio setting

2012-12-18 Thread Osier Yang
virGetDeviceID could be used across the sources, but it doesn't relate with this series, and could be done later. * src/util/util.h: (Declare virGetDeviceID, and vir{Get,Set}DeviceUnprivSGIO) * src/util/util.c: (Implement virGetDeviceID and

[libvirt] [PATCH 4/6] conf: Parse and format the new XML

2012-12-18 Thread Osier Yang
Like rawio, sgio is only allowed for block disk of device type lun. It doesn't default disk-sgio to filtered when parsing, as it won't be able to distinguish explicitly requested filtered and a default filtered in driver then. We have to error out for explicit request when the kernel doesn't

[libvirt] Connection release is not correct in libvirt and libvrt java

2012-12-18 Thread Benjamin Wang (gendwang)
Hi, The following is the current code to release connection in libvirt. int virConnectClose(virConnectPtr conn) { ... if (!VIR_IS_CONNECT(conn)) { virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__); goto error; } ... error: virDispatchError(NULL); return ret; }

[libvirt] Important question

2012-12-18 Thread Gene Czarcinski
OK, so maybe I an nuts but it seems to me that there is this 800 pound gorilla wondering around the Fedora 18 tent and its name is firewalld! Or it with respect to virtual guests and libvirt (since libvirt is a critical part of networking support). Maybe I am missing some critical

Re: [libvirt] [PATCH 1/6] Introduce a set of APIs for managing architectures

2012-12-18 Thread Richard W.M. Jones
On Tue, Dec 11, 2012 at 02:53:36PM +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Introduce a 'virArch' enum for CPU architectures. Include data type providing wordsize and endianness, and APIs to query this info and convert to/from enum and string form. It'd

Re: [libvirt] [PATCH 24/28] Rename util.{c,h} to virutil.{c,h}

2012-12-18 Thread Daniel P. Berrange
On Mon, Dec 17, 2012 at 10:22:11PM +0100, Michal Privoznik wrote: On 17.12.2012 15:57, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 6b6ec82..a8e99f2 100644 --- a/src/lxc/lxc_controller.c

Re: [libvirt] [PATCH 00/28] Rename files in src/util to have a 'vir' prefix

2012-12-18 Thread Daniel P. Berrange
On Mon, Dec 17, 2012 at 10:22:18PM +0100, Michal Privoznik wrote: On 17.12.2012 15:57, Daniel P. Berrange wrote: Currently the files in src/util are 50/50 split between those having a 'vir' prefix and those which don't. Finish the job by remaining all remaining files to have a 'vir' prefix

Re: [libvirt] [PATCH 25/28] Rename uuid.{c,h} to viruuid.{c,h}

2012-12-18 Thread Daniel P. Berrange
On Mon, Dec 17, 2012 at 10:22:03PM +0100, Michal Privoznik wrote: On 17.12.2012 15:57, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index edc899e..560746f 100644 --- a/daemon/libvirtd.c +++

Re: [libvirt] [PATCH] spec: Do not install *.py[co] in python examples

2012-12-18 Thread Jiri Denemark
On Tue, Dec 18, 2012 at 16:27:27 +, Daniel P. Berrange wrote: On Mon, Dec 17, 2012 at 08:23:11PM +0100, Jiri Denemark wrote: Unfortunately, rpm is stupid enough to bytycompile python scripts even though they are located in /usr/share/doc/libvirt-python-*/examples and it does so after

Re: [libvirt] [PATCH 6/6 v2] Convert QEMU capabilities code to use virArch

2012-12-18 Thread Jiri Denemark
On Tue, Dec 18, 2012 at 14:09:16 +, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_capabilities.c | 155 +-- src/qemu/qemu_capabilities.h | 2 +-

Re: [libvirt] [PATCH 7/8 v8] qemu: Set unpriv_sgio when attaching disk

2012-12-18 Thread Eric Blake
On 12/16/2012 12:32 PM, Osier Yang wrote: Again, does this do the right thing if some other domain already had cdbfilter='no' (aka kernel allows SG_IO) but this domain omitted the cdbfilter attribute (which defaults to cdbfilter='yes' but does not satisfy the if(disk-cdbfilter) condition)?

Re: [libvirt] [PATCHv3 1/3] build: Check for broken GCC -Wlogical-op in configure

2012-12-18 Thread Eric Blake
On 12/14/2012 08:08 AM, Viktor Mihajlovski wrote: Some older versions of GCC report a false positive on code like char * haystack, needle; strchr(haystack, needle); Added an extra check in configure.ac which will #define BROKEN_GCC_WLOGICALOP 1 in this case, allowing to special

Re: [libvirt] [PATCHv3 2/3] S390: Fix virSysinfoRead memory corruption

2012-12-18 Thread Eric Blake
On 12/14/2012 08:08 AM, Viktor Mihajlovski wrote: There was a double free issue caused by virSysinfoRead on s390, as the same manufacturer string instance was assigned to more than one processor record. Cleaned up other potential memory issues and restructured the sysinfo parsing code by

[libvirt] VirtualBox 4.2 Drivers Complete?

2012-12-18 Thread Arslan Waqar
I was using a VM on Vbox (Ubuntu 12.04) and from the virsh I tried: virsh # dommemstat 2 and I got the following errors: error: Failed to get memory statistics for domain 2 error: this function is not supported by the connection driver: virDomainMemoryStats Are the Drivers for Vbox 4.2

Re: [libvirt] [PATCH v2] FreeBSD: add nodeinfo support.

2012-12-18 Thread Peter Krempa
On 12/17/12 19:12, Roman Bogorodskiy wrote: Uses sysctl(3) interface to obtain CPU and memory information. --- src/nodeinfo.c | 62 +- 1 file changed, 61 insertions(+), 1 deletion(-) Okay this is reasonable. ACK and I will apply it to

Re: [libvirt] [PATCHv3 2/3] S390: Fix virSysinfoRead memory corruption

2012-12-18 Thread Daniel P. Berrange
On Tue, Dec 18, 2012 at 01:40:45PM -0700, Eric Blake wrote: On 12/14/2012 08:08 AM, Viktor Mihajlovski wrote: There was a double free issue caused by virSysinfoRead on s390, as the same manufacturer string instance was assigned to more than one processor record. Cleaned up other potential

Re: [libvirt] [PATCH 5/5] docs: aesthetical cleanups

2012-12-18 Thread Martin Kletzander
On 12/18/2012 04:29 AM, Osier Yang wrote: On 2012年12月17日 23:17, Martin Kletzander wrote: Removing exempli gratia when there should be dots afterwards, also Uppercase letter should be present when starting a sentence. Sorry for the double line in the last hunk even though it's just adding a

Re: [libvirt] [PATCH 7/8 v8] qemu: Set unpriv_sgio when attaching disk

2012-12-18 Thread Osier Yang
On 2012年12月19日 02:03, Eric Blake wrote: On 12/16/2012 12:32 PM, Osier Yang wrote: Again, does this do the right thing if some other domain already had cdbfilter='no' (aka kernel allows SG_IO) but this domain omitted the cdbfilter attribute (which defaults to cdbfilter='yes' but does not satisfy