Re: [libvirt] [PATCH] virsh: Let the compiler check usage of all fields in vshCmdOptType enum

2013-03-26 Thread Peter Krempa
On 03/25/13 19:11, Eric Blake wrote: On 03/25/2013 10:31 AM, Peter Krempa wrote: On 03/25/13 17:21, Peter Krempa wrote: Get rid of the default labels to do so. --- tools/virsh.c | 4 1 file changed, 4 deletions(-) case VSH_OT_ALIAS:

[libvirt] [PATCH 0/3 RESENT] Fix virsh race and coredump

2013-03-26 Thread Viktor Mihajlovski
Please consider for 1.0.4 as this prevents a potential data corruption or segfault. The race is caused by referencing a disposed connection object in a callback. In the first patch we make sure that the object reference count is reflecting the callback registration. This prevents a premature

[libvirt] [PATCH 2/3] remote: Don't call NULL closeFreeCallback

2013-03-26 Thread Viktor Mihajlovski
Check function pointer before calling. Signed-off-by: Viktor Mihajlovski mihaj...@linux.vnet.ibm.com --- src/remote/remote_driver.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 3721af9..885120e 100644 ---

[libvirt] [PATCH 1/3] libvirt: Increase connection reference count for callbacks

2013-03-26 Thread Viktor Mihajlovski
By adjusting the reference count of the connection object we prevent races between callback function and virConnectClose. Signed-off-by: Viktor Mihajlovski mihaj...@linux.vnet.ibm.com --- src/libvirt.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/libvirt.c b/src/libvirt.c

[libvirt] [PATCH 3/3] virsh: Unregister the connection close notifier upon termination

2013-03-26 Thread Viktor Mihajlovski
Before closing the connection we unregister the close callback to prevent a reference leak. We make sure that we only unregister if we have previously registered a callback (not the case for virsh connect!). Further, the messages on virConnectClose != 0 are a bit more specific now. Signed-off-by:

Re: [libvirt] doc: write separate module for hostdev passthrough and in-use tracking

2013-03-26 Thread Osier Yang
On 25/03/13 14:51, Chunyan Liu wrote: 2013/3/22 Osier Yang jy...@redhat.com: On 2013年03月22日 17:36, Chunyan Liu wrote: Hi, List, As the mail I've sent a week before: https://www.redhat.com/archives/libvir-list/2013-March/msg00730.html I'm willing to push this work forward so that the

[libvirt] [PATCH 1/3] util: Change virMacAddrFormat to lowercase hex characters

2013-03-26 Thread Peter Krempa
The domain XML generator creates the mac addres strings with lowercase strings with a separate piece of code. This patch changes the formating helper to do the same stuff to allow using it to normalize a string provided by the user. After this change some of the tests that are outputing the mac

[libvirt] [PATCH 3/3] virsh-domain-monitor: Refactor cmdDomIfGetLink

2013-03-26 Thread Peter Krempa
The domif-getlink command did not terminate successfully when the interface state was found. As the code used old and too complex approach to do the job, this patch refactors it and fixed the bug. --- tools/virsh-domain-monitor.c | 100 --- 1 file changed,

[libvirt] [PATCH 0/3] Refactor formatting of MAC addresses and domif-getlink virsh command

2013-03-26 Thread Peter Krempa
This series refactors libvirt XML code generator to create uniform mac addresses with lowercase hex characters and refactors the domif-getlink command to avoid a bug and too complex code. Peter Krempa (3): util: Change virMacAddrFormat to lowercase hex characters conf: Use virMacAddrFormat

[libvirt] [PATCH 2/3] conf: Use virMacAddrFormat while generating domain XML files

2013-03-26 Thread Peter Krempa
Format the address using the helper to avoid code duplication. --- src/conf/domain_conf.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4cae0d3..40dfc99 100644 --- a/src/conf/domain_conf.c +++

Re: [libvirt] [PATCH v3] nwfilter: probe for inverted ctdir

2013-03-26 Thread Stefan Berger
On 03/22/2013 04:37 PM, Stefan Berger wrote: Linux netfilter at some point inverted the meaning of the '--ctdir reply' and newer netfilter implementations now expect '--ctdir original' instead and vice-versa. We probe for this netfilter change via a UDP message over loopback and 3 filtering

[libvirt] How to get iteration time downtime?

2013-03-26 Thread Yuan, Ye A
Hi all, I'm a graduate student in Shanghai, and will do experiment about live migration using KVM as hypervisor. Due to my demand, I want to get each iteration time and downtime in migration. I found there is no API to implement it, and how can I obtain data I want? Thanks very much. Best

Re: [libvirt] [PATCH v2 0/2] Correctly treat seclabel of type none

2013-03-26 Thread Michal Privoznik
On 21.03.2013 16:35, Michal Privoznik wrote: Don't forget other seclabels when adding a seclabel type='none'/. Michal Privoznik (2): security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef security: Don't add seclabel of type none if there's already a

Re: [libvirt] [PATCH 1/3] util: Change virMacAddrFormat to lowercase hex characters

2013-03-26 Thread Martin Kletzander
On 03/26/2013 12:26 PM, Peter Krempa wrote: The domain XML generator creates the mac addres strings with lowercase strings with a separate piece of code. This patch changes the formating helper to do the same stuff to allow using it to normalize a string provided by the user. After this change

Re: [libvirt] [PATCH 2/3] conf: Use virMacAddrFormat while generating domain XML files

2013-03-26 Thread Martin Kletzander
On 03/26/2013 12:26 PM, Peter Krempa wrote: Format the address using the helper to avoid code duplication. --- src/conf/domain_conf.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4cae0d3..40dfc99 100644

[libvirt] [PATCH] conf: fix a failure when detaching a usb device

2013-03-26 Thread Guannan Ren
#virsh detach-device $guest usb.xml error: Failed to detach device from usb2.xml error: operation failed: host usb device vendor=0x0951 \ product=0x1625 not found This regresstion is due to a typo in matching function. The first argument is always the usb device that we are checking for. If

Re: [libvirt] [PATCH] Fix virConnectOpen.*() name requirements

2013-03-26 Thread Martin Kletzander
On 03/25/2013 05:08 PM, Martin Kletzander wrote: On 03/25/2013 04:54 PM, Martin Kletzander wrote: virConnectOpenAuth didn't require 'name' to be specified (VIR_DEBUG used NULLSTR() for the output) and by default, if name == NULL, the default connection uri is used. This was not indicated in

Re: [libvirt] [PATCH] Fix virConnectOpen.*() name requirements

2013-03-26 Thread Guannan Ren
On 03/26/2013 10:18 PM, Martin Kletzander wrote: On 03/25/2013 05:08 PM, Martin Kletzander wrote: On 03/25/2013 04:54 PM, Martin Kletzander wrote: virConnectOpenAuth didn't require 'name' to be specified (VIR_DEBUG used NULLSTR() for the output) and by default, if name == NULL, the default

Re: [libvirt] [PATCH] Fix virConnectOpen.*() name requirements

2013-03-26 Thread Martin Kletzander
On 03/26/2013 03:23 PM, Guannan Ren wrote: On 03/26/2013 10:18 PM, Martin Kletzander wrote: On 03/25/2013 05:08 PM, Martin Kletzander wrote: On 03/25/2013 04:54 PM, Martin Kletzander wrote: virConnectOpenAuth didn't require 'name' to be specified (VIR_DEBUG used NULLSTR() for the output) and

Re: [libvirt] [PATCH 3/3] virsh-domain-monitor: Refactor cmdDomIfGetLink

2013-03-26 Thread Martin Kletzander
On 03/26/2013 12:26 PM, Peter Krempa wrote: The domif-getlink command did not terminate successfully when the interface state was found. As the code used old and too complex approach to do the job, this patch refactors it and fixed the bug. s/fixed/fixes/ ACK, the only change this patch

[libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Michal Privoznik
Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block. However, we are passing a nonblocking one which results in cryptic error messages like: qemu:

Re: [libvirt] [PATCH] conf: fix a failure when detaching a usb device

2013-03-26 Thread Michal Privoznik
On 26.03.2013 15:17, Guannan Ren wrote: #virsh detach-device $guest usb.xml error: Failed to detach device from usb2.xml error: operation failed: host usb device vendor=0x0951 \ product=0x1625 not found This regresstion is due to a typo in matching function. The first argument is

[libvirt] [PATCH] virsh: error out on non-numeric timeout values

2013-03-26 Thread Ján Tomko
Some block commands and migrate ignored incorrect values. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=927495 --- tools/virsh-domain.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/virsh-domain.c

[libvirt] [PATCH] rpc: Fix client crash when server drops connection

2013-03-26 Thread Jiri Denemark
Despite of the comment stating virNetClientIncomingEvent handler should never be called with either client-haveTheBuck or client-wantClose set, there is a sequence of events that may lead to both booleans being true when virNetClientIncomingEvent is called. However, when that happens, we must not

Re: [libvirt] [PATCH v2] qemu: Don't set address type too early during virtio disk hotplug

2013-03-26 Thread Ján Tomko
On 03/22/2013 06:52 PM, Guido Günther wrote: f946462e14ac036357b7c11ce5c23f94a3ee4e49 changed behavior by settings VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI upfront. If we do so before invoking qemuDomainPCIAddressEnsureAddr we merely try to set the PCI slot via qemuDomainPCIAddressReserveSlot

Re: [libvirt] [PATCH] rpc: Fix client crash when server drops connection

2013-03-26 Thread Eric Blake
On 03/26/2013 09:52 AM, Jiri Denemark wrote: Despite of the comment stating virNetClientIncomingEvent handler should s/of // never be called with either client-haveTheBuck or client-wantClose set, there is a sequence of events that may lead to both booleans being true when

Re: [libvirt] [PATCH] virsh: error out on non-numeric timeout values

2013-03-26 Thread Eric Blake
On 03/26/2013 09:44 AM, Ján Tomko wrote: Some block commands and migrate ignored incorrect values. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=927495 --- tools/virsh-domain.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) ACK.

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Michal Privoznik
On 26.03.2013 17:08, Eric Blake wrote: On 03/26/2013 08:55 AM, Michal Privoznik wrote: Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block.

Re: [libvirt] [PATCH] virsh: error out on non-numeric timeout values

2013-03-26 Thread Ján Tomko
On 03/26/2013 05:18 PM, Eric Blake wrote: On 03/26/2013 09:44 AM, Ján Tomko wrote: Some block commands and migrate ignored incorrect values. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=927495 --- tools/virsh-domain.c | 48 1 file

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Eric Blake
On 03/26/2013 08:55 AM, Michal Privoznik wrote: Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block. However, we are passing a nonblocking one

Re: [libvirt] [PATCHv4 2/9] qemu: Record the default NIC model in the domain XML

2013-03-26 Thread Peter Krempa
On 03/25/13 21:34, Laine Stump wrote: On 03/15/2013 11:26 AM, Peter Krempa wrote: This patch implements the devices post parse cllback and uses it to fill the default qemu network card model into the XML if none is specified. Libvirt assumes that the network card model for qemu is the rtl8139.

Re: [libvirt] [PATCH] Correct DESCRIPTION for virsh help blockcopy

2013-03-26 Thread Peter Krempa
On 03/26/13 17:46, Yanbing Du wrote: Signed-off-by: Yanbing Du y...@redhat.com --- tools/virsh-domain.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) ACK and I will push the patch soon. Peter -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH] Correct DESCRIPTION for virsh help blockcopy

2013-03-26 Thread Yanbing Du
Signed-off-by: Yanbing Du y...@redhat.com --- tools/virsh-domain.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 592a6e8..fc5cb1e 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1603,7 +1603,7 @@ static

Re: [libvirt] [PATCHv4 6/9] conf: Enforce ranges on cputune variables

2013-03-26 Thread Peter Krempa
On 03/26/13 01:19, Laine Stump wrote: On 03/15/2013 11:26 AM, Peter Krempa wrote: The limits are documented at http://libvirt.org/formatdomain.html#elementsCPUTuning . Enforce them when going through XML parsing in addition to being enforced by the API. What's the rationale for doing this

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Doug Goldstein
On Tue, Mar 26, 2013 at 11:20 AM, Michal Privoznik mpriv...@redhat.com wrote: On 26.03.2013 17:08, Eric Blake wrote: On 03/26/2013 08:55 AM, Michal Privoznik wrote: Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a

[libvirt] Unable to start container on Fedora 17 with kernel 3.8.0

2013-03-26 Thread Purcareata Bogdan-B43198
Hello, I've had some trouble starting a Linux Container with libvirt. Here's my setup: 1. I've downloaded libvirt-1.0.3.tar.gz from [1] and issued: - ./configure --prefix=/usr - make - make install - ldconfig 2. I've started the libvirtd service: - sudo service libvirtd start Starting libvirtd

Re: [libvirt] [PATCH v2] qemu: Don't set address type too early during virtio disk hotplug

2013-03-26 Thread Guido Günther
On Tue, Mar 26, 2013 at 05:13:17PM +0100, Ján Tomko wrote: On 03/22/2013 06:52 PM, Guido Günther wrote: f946462e14ac036357b7c11ce5c23f94a3ee4e49 changed behavior by settings VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI upfront. If we do so before invoking qemuDomainPCIAddressEnsureAddr we merely try

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Cole Robinson
On 03/26/2013 12:20 PM, Michal Privoznik wrote: On 26.03.2013 17:08, Eric Blake wrote: On 03/26/2013 08:55 AM, Michal Privoznik wrote: Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Eric Blake
On 03/26/2013 02:52 PM, Cole Robinson wrote: src/qemu/qemu_migration.c | 7 +++ 1 file changed, 7 insertions(+) Thanks for figuring it all out! I definitely hit this one, while trying to help someone on IRC. ACK, and definitely 1.0.4 material. Thanks, pushed to master. I wonder if

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Cole Robinson
On 03/26/2013 05:04 PM, Eric Blake wrote: On 03/26/2013 02:52 PM, Cole Robinson wrote: src/qemu/qemu_migration.c | 7 +++ 1 file changed, 7 insertions(+) Thanks for figuring it all out! I definitely hit this one, while trying to help someone on IRC. ACK, and definitely 1.0.4

Re: [libvirt] [PATCH] conf: fix a failure when detaching a usb device

2013-03-26 Thread Guannan Ren
On 03/26/2013 11:04 PM, Michal Privoznik wrote: On 26.03.2013 15:17, Guannan Ren wrote: #virsh detach-device $guest usb.xml error: Failed to detach device from usb2.xml error: operation failed: host usb device vendor=0x0951 \ product=0x1625 not found This regresstion is due to a typo

Re: [libvirt] Unable to start container on Fedora 17 with kernel 3.8.0

2013-03-26 Thread Gao feng
On 2013/03/27 01:12, Purcareata Bogdan-B43198 wrote: Hello, I've had some trouble starting a Linux Container with libvirt. Here's my setup: 1. I've downloaded libvirt-1.0.3.tar.gz from [1] and issued: - ./configure --prefix=/usr - make - make install - ldconfig 2. I've started the

[libvirt] [PATCH v3 2/3]doc: add NVRAM device

2013-03-26 Thread Li Zhang
From: Li Zhang zhlci...@linux.vnet.ibm.com This patch is to add NVRAM docs in formatdomain.html.in and domaincommon.rng Signed-off-by: Li Zhang zhlci...@linux.vnet.ibm.com --- docs/formatdomain.html.in | 35 +++ docs/schemas/domaincommon.rng | 10

[libvirt] [PATCH v3 3/3] Add NVRAM test cases

2013-03-26 Thread Li Zhang
From: Li Zhang zhlci...@linux.vnet.ibm.com This patch is to add NVRAM test cases. Signed-off-by: Li Zhang zhlci...@linux.vnet.ibm.com --- .../qemuxml2argv-pseries-nvram.args|1 + .../qemuxml2argv-pseries-nvram.xml | 20

[libvirt] [PATCH v3 1/3] Add NVRAM device

2013-03-26 Thread Li Zhang
From: Li Zhang zhlci...@linux.vnet.ibm.com For pSeries guest in QEMU, NVRAM is one kind of spapr-vio device. Users are allowed to specify spapr-vio devices'address. But NVRAM is not supported in libvirt. So this patch is to add NVRAM device to allow users to specify its address. In QEMU, NVRAM

Re: [libvirt] [PATCHv2 2/2] Add USB option capability

2013-03-26 Thread Li Zhang
Any comment? Thanks. :) On 2013年03月15日 17:19, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com To avoid the collision for creating USB controllers in machine-init() and -device xx command line, it needs to set usb=off to avoid one USB controller created in machine-init(). So that

Re: [libvirt] [PATCHv2 1/2] Optimize machine option to set more options with it.

2013-03-26 Thread Li Zhang
Any comment ? Thanks. :) On 2013年03月15日 17:19, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com Currently, -machine option is used only when dump-guest-core is set. To use options defined in machine option for newer version of QEMU, it needs to use -machine xxx, and to be

Re: [libvirt] [PATCH 1/1][RESEND] Set legacy USB option with default for ppc64.

2013-03-26 Thread Li Zhang
Hi all, Any comment about this patch? Thanks.:) On 2013年03月14日 14:54, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com Currently, -device xxx still can't work well for ppc64 platform. It's better use legacy USB option with default for ppc64. This patch is to legacy USB option with

Re: [libvirt] [PATCH 1/1][RESEND] ppc64 cpu features

2013-03-26 Thread Li Zhang
Hi, Could anyone give more comment? Thanks. :) On 2013年03月14日 14:54, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com This patch adds a CPU feature powernv identifying IBM Power processor that supports native hypervisor e.g. KVM. This can be used by virtualization management

Re: [libvirt] [PATCH 2/2] LXC: rework mounting cgroupfs in container

2013-03-26 Thread Gao feng
On 2013/03/20 16:14, Gao feng wrote: There are 3 reason we need to rework the cgroupfs mounting in container. 1, Yin Olivia reported a failed to mount cgroup problem, now we given that the name of cgroup mount point is same with the subsystem type, Or libvirt_lxc will fail to