[libvirt] [PATCH 8/8] qemu: support updating disk with boot index

2015-01-04 Thread Wang Rui
-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_driver.c | 64 +++--- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 673d8a6..9615fe4

[libvirt] [PATCH 2/8] qemu: support attachment of net device with boot index

2015-01-04 Thread Wang Rui
) API returning success. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_hotplug.c | 33 + src/qemu/qemu_hotplug.h | 4 2 files changed, 37 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src

[libvirt] [PATCH 7/8] qemu: support updating interface with boot index

2015-01-04 Thread Wang Rui
index. So pass value:-1 to qmp command(qom-set) to cancel boot index. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_hotplug.c | 35 ++- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git

[libvirt] [PATCH 4/8] qemu: a code movement

2015-01-04 Thread Wang Rui
Move implementation of qemuDomainAttachDeviceDiskLive after qemuDomainDetachDiskDevice for later usage. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_hotplug.c | 173 1 file

[libvirt] [PATCH 0/8] qemu: support setting device's boot order when VM is running

2015-01-04 Thread Wang Rui
='virtio'/ driver queues='4'/ boot order='2'/ alias name='net0'/ address type='pci' domain='0x' bus='0x00' slot='0x03' function='0x0'/ /interface If the 'boot order' is not specified in the xml, that means canceling its boot order. Wang Rui (8): qemu: add a new

[libvirt] [PATCH 6/8] conf: add compatiblity check for boot index when updating device

2015-01-04 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/conf/domain_conf.c | 43 +++ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d2c4a0a

[libvirt] [PATCH 5/8] qemu: support attachment of disk device with boot index

2015-01-04 Thread Wang Rui
) API returning success. If new disk is attached successfully but boot index is set failed, we'll remove the new disk to restore. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_hotplug.c | 88

[libvirt] [PATCH 1/8] qemu: add a new qemuMonitorSetBootIndex() method to set device's bootorder

2015-01-04 Thread Wang Rui
The new qemuMonitorSetBootIndex() method can set device' boot order online using 'qom-set' JSON monitor command. HMP is not supported. And it is used for QEMU = 2.2.0 . The QMP command is like qom-set net1 bootindex 2. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin

[libvirt] [PATCH 3/8] conf: check boot order which is used by itself

2015-01-04 Thread Wang Rui
to distinguish the owner. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/conf/device_conf.c | 13 + src/conf/device_conf.h | 12 src/conf/domain_conf.c | 31 +++ src/conf/domain_conf.h | 9

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

2014-12-16 Thread Wang Rui
On 2014/12/17 8:16, Nehal J Wani wrote: 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

[libvirt] [PATCH] maint: clean up the unused variable 'caps' in src/qemu/qemu_*.c

2014-12-10 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_driver.c | 9 - src/qemu/qemu_hotplug.c | 5 - 2 files changed, 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index be37c8f..3406385 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu

[libvirt] [PATCH V2 0/3] qemu: support update graphic device persistently

2014-12-08 Thread Wang Rui
to VIR_ERR_OPERATION_UNSUPPORTED 2. (patch 3/3) add 'VIR_DOMAIN_XML_SECURE' to flags in initialization. 3. (patch 3/3) Introduce a new function qemuDomainFindGraphicsIndex. Free the old graphics def and replace it with the new one as what we did for DEVICE_NET. Wang Rui (3): qemu: report properer error

[libvirt] [PATCH V2 2/3] qemu: fix alignment of qemuDomainFindGraphics

2014-12-08 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_hotplug.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d1767bb..ec0122b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c

[libvirt] [PATCH V2 1/3] qemu: report properer error number when change graphics failed

2014-12-08 Thread Wang Rui
It's not supported to change some graphics arguments with '--live'. Replace some error code VIR_ERR_INTERNAL_ERROR and VIR_ERR_INVALID_ARG with VIR_ERR_OPERATION_UNSUPPORTED. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_hotplug.c | 16 1 file changed, 8

[libvirt] [PATCH V2 3/3] qemu: make persistent update of graphics device supported

2014-12-08 Thread Wang Rui
with config flag. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_conf.c | 2 +- src/qemu/qemu_driver.c | 18 +- src/qemu/qemu_hotplug.c | 14 ++ src/qemu/qemu_hotplug.h | 2 ++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src

[libvirt] [PATCH] conf: fix a comment typo in virDomainVideoDefaultRAM

2014-12-01 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fe9b986..2d81c37 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10221,7

Re: [libvirt] [PATCH 1/2] qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions

2014-11-30 Thread Wang Rui
On 2014/12/1 4:29, Martin Kletzander wrote: Yes, you're right, that basically what I wanted to know, but was too busy searching for. ACK to this patch then. Would you be OK with me rewording the commit message as follows? The migration job status is traced in

[libvirt] [PATCH 0/2] qemu: update jobinfo type if the job is not completed in qemuMigrationRun

2014-11-30 Thread Wang Rui
can't use qemuMigrationUpdateJobStatus. Wang Rui (2): qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun src/qemu/qemu_migration.c | 9 - 1 file changed, 8 insertions(+), 1 deletion

[libvirt] [PATCH 2/2] qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun

2014-11-30 Thread Wang Rui
can't query job status from QEMU. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_migration.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index c678ba7..75c77ae 100644 --- a/src/qemu

[libvirt] [PATCH 1/2] qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions

2014-11-30 Thread Wang Rui
if migration is cancelled during drive mirror. Moreover, we can't use qemuMigrationUpdateJobStatus because from qemu's point of view it's just the drive mirror being cancelled and the migration hasn't even started yet. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_migration.c | 2 ++ 1

[libvirt] [PATCH 0/2] qemu: update jobinfo type if the job is not completed in qemuMigrationRun

2014-11-27 Thread Wang Rui
In qemuMigrationRun the jobinfo type won't be updated until qemuMigrationWaitForCompletion. If migration is failed or cancelled before that(such as in qemuMigrationDriveMirror), we can't get the right jobinfo type. The following patches fix it. Wang Rui (2): qemu: set jobinfo type to CANCELLED

[libvirt] [PATCH 2/2] qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun

2014-11-27 Thread Wang Rui
If job is failed in qemuMigrationRun, we expect the jobinfo type as FAILED. But jobinfo type won't be updated until entering qemuMigrationWaitForCompletion. We should make it updated in all conditions. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_migration.c | 7 ++- 1

[libvirt] [PATCH 1/2] qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions

2014-11-27 Thread Wang Rui
if migration is cancelled during the drive mirror migration. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_migration.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a1b1458..c678ba7 100644 --- a/src/qemu

Re: [libvirt] [PATCH 1/2] qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions

2014-11-27 Thread Wang Rui
On 2014/11/27 18:48, Martin Kletzander wrote: On Thu, Nov 27, 2014 at 04:26:24PM +0800, Wang Rui wrote: The migration job status is traced in qemuMigrationUpdateJobStatus which is called in qemuMigrationRun. But if migration is cancelled before the trace such as in qemuMigrationDriveMirror

[libvirt] [PATCH] qemu: add the missing jobinfo type in qemuDomainGetJobInfo

2014-11-25 Thread Wang Rui
Commit 6fcddfcd refactored job statistics but missed the jobinfo type updated in qemuDomainGetJobInfo. After this patch, we can use virDomainGetJobInfo to get jobinfo type again. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_domain.c | 1 + 1 file changed, 1 insertion

Re: [libvirt] [PATCH 06/11] qemu: Add handling for VSERPORT_CHANGE event

2014-11-20 Thread Wang Rui
On 2014/11/20 15:47, Peter Krempa wrote: the status XML is the piece that is reloaded on libvirtd restart for running VMs. For inactive VMs this doesn't make sense to report. Thanks. I missed status XML in /var/run/libvirt/. -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 06/11] qemu: Add handling for VSERPORT_CHANGE event

2014-11-19 Thread Wang Rui
On 2014/11/19 18:23, Peter Krempa wrote: New qemu added a new event that is emitted when a virtio serial channel is opened in the guest OS. This allows us to update the state of the port in the output-only XML element. This patch implements the monitor callbacks and necessary handlers to

[libvirt] [PATCH 2/3] qemu: revise qemuDomainFindGraphics to be reused in the future patch

2014-11-18 Thread Wang Rui
We want to use qemuDomainFindGraphics in the qemuDomainUpdateDeviceConfig in a future patch. So adjust its parameter. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_hotplug.c | 13 ++--- src/qemu/qemu_hotplug.h | 3 +++ 2 files changed, 9 insertions(+), 7 deletions

[libvirt] [PATCH 3/3] qemu: make persistent update of graphics device supported

2014-11-18 Thread Wang Rui
changed with config flag. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_conf.c | 3 ++- src/qemu/qemu_driver.c | 38 +- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH 0/3] qemu: support update graphic device persistently

2014-11-18 Thread Wang Rui
arguments persistently Wang Rui (3): qemu: report properer error number when change graphics failed qemu: revise qemuDomainFindGraphics to be reused in the future patch qemu: make persistent update of graphics device supported src/conf/domain_conf.c | 3 ++- src/qemu/qemu_driver.c | 38

[libvirt] [PATCH 1/3] qemu: report properer error number when change graphics failed

2014-11-18 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_hotplug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b9a0cee..1c75861 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c

[libvirt] How can I get drive_mirror migration progress with non-shared storage on KVM ?

2014-11-17 Thread Wang Rui
Hi, I want to get a total progress(memory + storage). In none drive mirror migration, I can use virDomainGetJobInfo API to get the total progress. But in drive mirror migration, it seems that I must get file progress by virDomainGetBlockJobInfo and momery progress by virDomainGetJobInfo

[libvirt] [PATCH 2/3] lxc: don't setup cpuset.mems if memory mode in numatune is not 'strict'

2014-11-10 Thread Wang Rui
If the memory mode in numatune is not 'strict', we should not setup cpuset.mems. Before commit 1a7be8c600905aa07ac2d78293336ba8523ad48e we have checked the memory mode in virDomainNumatuneGetNodeset. This patch adds the check as before. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/lxc

[libvirt] [PATCH 3/3] qemu: fix domain startup failing with 'strict' mode in numatune

2014-11-10 Thread Wang Rui
with that in qemuDomainSetNumaParamsLive. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_cgroup.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index a87ef40..3b1d16d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu

[libvirt] [PATCH 1/3] qemu: don't setup cpuset.mems if memory mode in numatune is not 'strict'

2014-11-10 Thread Wang Rui
invoke OOM. Commit 1a7be8c600905aa07ac2d78293336ba8523ad48e changed the former logic of checking memory mode in virDomainNumatuneGetNodeset. This patch adds the check as before. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_cgroup.c | 4 1 file changed, 4 insertions

[libvirt] [PATCH V2 0/3] Fix some problems of numatune

2014-11-10 Thread Wang Rui
Fix startup failing with memory mode(strict, preferred or interleave) in numatune V1: https://www.redhat.com/archives/libvir-list/2014-November/msg00057.html V2 has been revised as Martin' suggestion. Wang Rui (3): qemu: don't setup cpuset.mems if memory mode in numatune is not 'strict

Re: [libvirt] [PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is 'preferred'

2014-11-07 Thread Wang Rui
On 2014/11/5 16:07, Martin Kletzander wrote: [...] diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index b5bdb36..8685d6f 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -618,6 +618,11 @@ qemuSetupCpusetMems(virDomainObjPtr vm, if

[libvirt] [PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is 'preferred'

2014-11-04 Thread Wang Rui
mode is 'preferred', cpuset.mems in cgroup shouldn't be set to 'nodeset'. I find that maybe commit 1a7be8c600905aa07ac2d78293336ba8523ad48e changes the former logic of checking mode in virDomainNumatuneGetNodeset. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_cgroup.c | 5

Re: [libvirt] [PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is 'preferred'

2014-11-04 Thread Wang Rui
On 2014/11/4 22:04, Martin Kletzander wrote: On Tue, Nov 04, 2014 at 09:22:22PM +0800, Wang Rui wrote: If the memory mode is specified as preferred, we get the following error when starting domain. error: Unable to write to '$my_cgroup_path/cpuset.mems': Device or resource busy XML

Re: [libvirt] [PATCH 1/2] qemu: migration:Release nbd port from migrationPorts instead of remotePorts

2014-10-31 Thread Wang Rui
On 2014/10/31 16:16, weiwei li wrote: commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal

Re: [libvirt] [PATCH 1/3] lxc: Implement pin emulator for container startup

2014-10-28 Thread Wang Rui
On 2014/10/22 23:34, John Ferlan wrote: On 09/04/2014 03:52 AM, Wang Rui wrote: From: Yue Wenyuan yueweny...@huawei.com This patch implements libvirt_lxc process pin with emulatorpin specified in xml. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Yue Wenyuan yueweny

[libvirt] [PATCH] qemu: move setting emulatorpin ahead of monitor showing up

2014-10-16 Thread Wang Rui
From: Zhou yimin zhouyi...@huawei.com If VM is configured with many devices(including passthrough devices) and large memory, libvirtd will take seconds(in the worst case) to wait for monitor. In this period the qemu process may run on any PCPU though I intend to pin emulator to the specified PCPU

[libvirt] [PATCH] conf: improve the comments for xmlopt

2014-10-11 Thread Wang Rui
Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5dc4b62..35bbd91 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2417,6 +2417,7

Re: [libvirt] [PATCH 0/3] lxc: Implement emulator pin APIs to set/get cpuset

2014-10-10 Thread Wang Rui
Ping? On 2014/9/4 15:52, Wang Rui wrote: We can specify cpuset for a container defined with the xml like vcpu placement='static' cpuset='0-3' to achieve cpu isolation. It works when container is started. But there is no implements we can use to either change or get cpuset. The following

Re: [libvirt] [PATCH V3 2/3] qemu: Introduce vgamem attribute for video model

2014-10-09 Thread Wang Rui
On 2014/9/19 20:02, Michal Privoznik wrote: diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 360cc67..146d67c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -265,6 +265,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,

Re: [libvirt] [PATCH 1/2] qemu: make sure capability probing process can start

2014-10-09 Thread Wang Rui
On 2014/10/9 19:08, Martin Kletzander wrote: On Thu, Oct 09, 2014 at 11:52:49AM +0100, Daniel P. Berrange wrote: On Thu, Oct 09, 2014 at 12:37:42PM +0200, Jiri Denemark wrote: On Thu, Oct 09, 2014 at 11:49:34 +0200, Martin Kletzander wrote: On Thu, Oct 09, 2014 at 10:14:48AM +0100, Daniel P.

Re: [libvirt] [Question] capabilities.pidfile is left behind while starting and stopping libvirtd repeatly

2014-10-08 Thread Wang Rui
On 2014/10/2 17:55, Martin Kletzander wrote: On Tue, Sep 30, 2014 at 10:26:21PM +0200, Guido Günther wrote: On Tue, Sep 30, 2014 at 04:47:14PM +0200, Martin Kletzander wrote: On Tue, Sep 30, 2014 at 05:34:54PM +0800, Wang Yufei wrote: Hi, all I started and stopped libvirtd service repeatly

Re: [libvirt] [PATCH 1/8] qemu: bulk stats: extend internal collection API

2014-09-10 Thread Wang Rui
On 2014/9/8 21:05, Francesco Romani wrote: +static bool +qemuDomainGetStatsNeedMonitor(unsigned int stats) +{ +size_t i; + +for (i = 0; qemuDomainGetStatsWorkers[i].func; i++) +if (stats qemuDomainGetStatsWorkers[i].stats) +if

Re: [libvirt] [PATCHv3 2/8] qemu: bulk stats: implement CPU stats group

2014-09-10 Thread Wang Rui
On 2014/9/8 21:05, Francesco Romani wrote: This patch implements the VIR_DOMAIN_STATS_CPU_TOTAL group of statistics. Signed-off-by: Francesco Romani from...@redhat.com --- include/libvirt/libvirt.h.in | 1 + src/libvirt.c| 9 src/qemu/qemu_driver.c | 51

Re: [libvirt] [PATCHv3 4/8] qemu: bulk stats: implement VCPU group

2014-09-10 Thread Wang Rui
On 2014/9/9 19:56, Peter Krempa wrote: + * VIR_DOMAIN_STATS_VCPU: Return virtual CPU statistics. + * Due to VCPU hotplug, the vcpu.num.* array could be sparse. + * The actual size of the array correspond to vcpu.current. + * The array size will never exceed vcpu.maximum. + * The typed

Re: [libvirt] [PATCHv3 4/8] qemu: bulk stats: implement VCPU group

2014-09-10 Thread Wang Rui
On 2014/9/8 21:05, Francesco Romani wrote: This patch implements the VIR_DOMAIN_STATS_VCPU group of statistics. To do so, this patch also extracts a helper to gather the VCpu information. Signed-off-by: Francesco Romani from...@redhat.com --- include/libvirt/libvirt.h.in | 1 +

Re: [libvirt] [PATCH 13/26] qemu: Resolve Coverity FORWARD_NULL

2014-09-09 Thread Wang Rui
On 2014/9/5 6:26, John Ferlan wrote: If the virJSONValueNewObject() fails, then rather than going to error and getting a Coverity false positive since it doesn't seem to understand the relationship between nkeywords, keywords, and values and seems to believe calling qemuFreeKeywords will cause

Re: [libvirt] [PATCH V3 0/3] Some improvements for video model

2014-09-09 Thread Wang Rui
as usual. My colleague will go on sending the next version. Of course, it's grateful to receive your comments in this week. On 2014/8/28 16:05, Gerd Hoffmann wrote: On Do, 2014-08-14 at 20:43 +0800, Wang Rui wrote: From: Zeng Junliang zengjunli...@huawei.com http://www.redhat.com/archives/libvir

Re: [libvirt] [PATCH RFC] qemu: make time adjustment persistent if RTC changes in guest

2014-09-05 Thread Wang Rui
On 2014/9/5 1:40, Laine Stump wrote: I do point out the existence of exactly the problem that you are fixing. However, there is a problem with the way you're fixing it if the clock for the domain is set like this: clock offset ='variable' basis='localtime'/ The problem is that when the

[libvirt] [PATCH 0/3] lxc: Implement emulator pin APIs to set/get cpuset

2014-09-04 Thread Wang Rui
We can specify cpuset for a container defined with the xml like vcpu placement='static' cpuset='0-3' to achieve cpu isolation. It works when container is started. But there is no implements we can use to either change or get cpuset. The following patches implement the lxc driver methods for

[libvirt] [PATCH 1/3] lxc: Implement pin emulator for container startup

2014-09-04 Thread Wang Rui
From: Yue Wenyuan yueweny...@huawei.com This patch implements libvirt_lxc process pin with emulatorpin specified in xml. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Yue Wenyuan yueweny...@huawei.com --- src/lxc/lxc_cgroup.c | 68

[libvirt] [PATCH 2/3] lxc: Implement emulator pin API in lxc driver

2014-09-04 Thread Wang Rui
From: Yue Wenyuan yueweny...@huawei.com Implement the lxc driver method for virDomainPinEmulator to set container's cpuset. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Yue Wenyuan yueweny...@huawei.com --- src/lxc/lxc_cgroup.c | 20 src/lxc/lxc_cgroup.h | 3

[libvirt] [PATCH 3/3] lxc: Implement geting emulator pin info API in lxc driver

2014-09-04 Thread Wang Rui
From: Yue Wenyuan yueweny...@huawei.com Implement the lxc driver method for virDomainGetEmulatorPinInfo to get container's cpuset. Signed-off-by: Wang Rui moon.wang...@huawei.com Signed-off-by: Yue Wenyuan yueweny...@huawei.com --- src/lxc/lxc_driver.c | 75

[libvirt] [PATCH 6/6] lxc_container: Resolve Coverity RESOURCE_LEAK

2014-09-01 Thread Wang Rui
Memory is allocated for 'mnt_src' by VIR_STRDUP in the loop. Next loop it will be allocated again. So we need to free 'mnt_src' before continue the loop. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/lxc/lxc_container.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc

[libvirt] [PATCH 5/6] vircgroup: Resolve Coverity RESOURCE_LEAK

2014-09-01 Thread Wang Rui
Need to free 'root' and 'opts' before 'return -1' if symlink fails. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/util/vircgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 8b554a9..a64f081 100644 --- a/src

[libvirt] [PATCH 3/6] remote: Resolve Coverity RESOURCE_LEAK

2014-09-01 Thread Wang Rui
Need to free 'uri_out' on error path. Signed-off-by: Wang Rui moon.wang...@huawei.com --- daemon/remote.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/remote.c b/daemon/remote.c index 89714ca..0ea2815 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2305,8

[libvirt] [PATCH 4/6] qemu_process: Resolve Coverity RESOURCE_LEAK

2014-09-01 Thread Wang Rui
If virSecurityManagerClearSocketLabel() fails, 'agent' won't be freed before jumping to cleanup. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f68dfbe

[libvirt] [PATCH 0/6] Coverity patches to resolve RESOURCE_LEAK

2014-09-01 Thread Wang Rui
Another six pathes to fix resource leak. But this may not be the end. Wang Rui (6): tests: Resolve Coverity RESOURCE_LEAK in commandhelper test_conf: Resolve Coverity RESOURCE_LEAK remote: Resolve Coverity RESOURCE_LEAK qemu_process: Resolve Coverity RESOURCE_LEAK vircgroup: Resolve

[libvirt] [PATCH 2/6] test_conf: Resolve Coverity RESOURCE_LEAK

2014-09-01 Thread Wang Rui
If the condition 'ret 0' is true, the code will jump to 'cleanup' and 'conf' won't be freed. Signed-off-by: Wang Rui moon.wang...@huawei.com --- tests/test_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_conf.c b/tests/test_conf.c index 05704df..4d05d8d

[libvirt] [PATCH 1/6] tests: Resolve Coverity RESOURCE_LEAK in commandhelper

2014-09-01 Thread Wang Rui
Coverity determined that 'log' and 'newenv' were not freed in some cases. Free them in 'error' branch and normal branch. Signed-off-by: Wang Rui moon.wang...@huawei.com --- tests/commandhelper.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests

Re: [libvirt] [PATCH v1 6/6] ivshmem: add start param to server attribute

2014-08-28 Thread Wang Rui
On 2014/8/28 5:20, Maxime Leroy wrote: On Tue, Aug 26, 2014 at 11:58 AM, Wang Rui moon.wang...@huawei.com wrote: On 2014/8/22 18:47, Maxime Leroy wrote: +# util/virivshmemserver.h +virStartIvshmemServer; +virStopIvshmemServer; I think function name virIvshmemStartServer is better. So

Re: [libvirt] [PATCH V3 0/3] Some improvements for video model

2014-08-28 Thread Wang Rui
On 2014/8/28 16:05, Gerd Hoffmann wrote: On Do, 2014-08-14 at 20:43 +0800, Wang Rui wrote: From: Zeng Junliang zengjunli...@huawei.com http://www.redhat.com/archives/libvir-list/2014-July/msg00644.html diff to v2: - hide vram attribute silently instead of reporting an error. - introduce

[libvirt] [PATCH 3/3] qemu_capabilities: Resolve Coverity RESOURCE_LEAK

2014-08-28 Thread Wang Rui
it before continue this loop to fix that. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/qemu/qemu_capabilities.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ce899f2..4a540ee 100644 --- a/src/qemu

[libvirt] [PATCH 2/3] tests: Resolve Coverity RESOURCE_LEAK

2014-08-28 Thread Wang Rui
The 'lib' handle will be leaked if 'dlsym' condition fails. So close the handle before return. Signed-off-by: Wang Rui moon.wang...@huawei.com --- tests/shunloadtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c index 499b1be..80f5351 100644

[libvirt] [PATCH 0/3] Coverity patches to resolve RESOURCE_LEAK

2014-08-28 Thread Wang Rui
I did coverity scan for libvirt-1.2.8 as John Ferlan did. He has sent many patches about RESOURCE_LEAK. I picked the other errors left to fix. There are also many errors to analyze and fix in the future. Wang Rui (3): util: Resolve Coverity RESOURCE_LEAK tests: Resolve Coverity RESOURCE_LEAK

[libvirt] [PATCH 1/3] util: Resolve Coverity RESOURCE_LEAK

2014-08-28 Thread Wang Rui
Coverity determined that 'conflict' would be leaked. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/util/virpci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virpci.c b/src/util/virpci.c index 0098d6c..f1d4499 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c

Re: [libvirt] [PATCH 06/19] qemu_agent: Resolve Coverity RESOURCE_LEAK

2014-08-28 Thread Wang Rui
On 2014/8/28 17:03, Ján Tomko wrote: On 08/28/2014 04:40 AM, Wang Rui wrote: On 2014/8/28 4:54, John Ferlan wrote: Coverity found that on error paths, the 'arg' value wasn't be cleaned up. Followed the example in qemuAgentSetVCPUs() where upon successful call to qemuAgentCommand() the 'cpus

Re: [libvirt] [PATCH 00/19] More Coverity patches

2014-08-27 Thread Wang Rui
On 2014/8/28 4:54, John Ferlan wrote: I almost didn't want to do this due to the sheer volume, but figured at the very least the bulk of these are resource leaks found by the much pickier new coverity scanner. After this there are only 70 issues found... Nice. I did coverity scan yesterday

Re: [libvirt] [PATCH 06/19] qemu_agent: Resolve Coverity RESOURCE_LEAK

2014-08-27 Thread Wang Rui
On 2014/8/28 4:54, John Ferlan wrote: Coverity found that on error paths, the 'arg' value wasn't be cleaned up. Followed the example in qemuAgentSetVCPUs() where upon successful call to qemuAgentCommand() the 'cpus' is set to NULL; otherwise, when cleanup occurs the free the memory for 'arg'

Re: [libvirt] [PATCH v1 2/6] conf: Parse and format shmem device XML

2014-08-26 Thread Wang Rui
On 2014/8/22 18:47, Maxime Leroy wrote: This patch adds configuration support for the shmem device as described in the schema in the previous patch. Signed-off-by: Maxime Leroy maxime.le...@6wind.com --- +static virDomainShmemDefPtr +virDomainShmemDefParseXML(xmlNodePtr node, +

Re: [libvirt] [PATCH v1 4/6] qemu: Build command line for ivshmem device

2014-08-26 Thread Wang Rui
On 2014/8/22 18:47, Maxime Leroy wrote: +static int +qemuBuildIvshmemCommandLine(virCommandPtr cmd, +virDomainDefPtr def, +virDomainShmemDefPtr dev, +virQEMUCapsPtr qemuCaps) +{ +char *devstr; +

Re: [libvirt] [PATCH v1 6/6] ivshmem: add start param to server attribute

2014-08-26 Thread Wang Rui
On 2014/8/22 18:47, Maxime Leroy wrote: +# util/virivshmemserver.h +virStartIvshmemServer; +virStopIvshmemServer; I think function name virIvshmemStartServer is better. So is the stop function. @@ -5120,6 +5121,12 @@ qemuBuildIvshmemCommandLine(virCommandPtr cmd, return

Re: [libvirt] [PATCH] libvirt: lxc: Add Get/Set vcpus for lxc

2014-08-25 Thread Wang Rui
On 2014/8/22 17:50, Li Yang wrote: 1.Add function to get vcpu count for lxc(vcpucount) 2.Add function to set vcpu count for lxc(setvcpus) Signed-off-by: Li Yang liyang.f...@cn.fujitsu.com --- src/lxc/lxc_driver.c | 159 ++ 1 files

[libvirt] [PATCH] daemon: Fix option -v missing info priority log

2014-08-25 Thread Wang Rui
From: Zhou Yimin zhouyi...@huawei.com Introduce by 63fbcc692. When start libvirtd with commandline /usr/sbin/libvirtd -d -l -v, we expect verbose(info level) log if neither environment variable nor config file about logging controls is set. But in fact we can't get any info priority log in the

Re: [libvirt] [PATCH V3 0/3] Some improvements for video model

2014-08-24 Thread Wang Rui
Ping. On 2014/8/14 20:43, Wang Rui wrote: From: Zeng Junliang zengjunli...@huawei.com http://www.redhat.com/archives/libvir-list/2014-July/msg00644.html diff to v2: - hide vram attribute silently instead of reporting an error. - introduce three new capabilities for vga.vgamem_mb

[libvirt] A question about scsi controller index

2014-08-20 Thread Wang Rui
Hi, all I define a VM with a virtio scsi disk and I specify a controller index. disk type='file' device='disk' driver name='qemu' type='raw' cache='none' io='native'/ source file='/mnt/sdb/wangrui/img/sles10_sp3_32_2U-5'/ target dev='sdb' bus='scsi'/ address type='drive' controller='10'

[libvirt] [PATCH RFC] qemu: make time adjustment persistent if RTC changes in guest

2014-08-20 Thread Wang Rui
(shutdown and start), the time adjuestment(RTC change) set by user will be lost. This patch make the adjustment persistent for persistent domain. Signed-off-by: Wang Rui moon.wang...@huawei.com --- I'm not sure about the current purpose so I sent a RFC patch. Is it for some reason that RTC change

Re: [libvirt] [PATCH] fix

2014-08-15 Thread Wang Rui
On 2014/8/15 12:16, Sam Bobroff wrote: On 14/08/14 20:14, Ján Tomko wrote: On 08/14/2014 11:52 AM, Michal Privoznik wrote: On 14.08.2014 10:41, Ján Tomko wrote: Also add qemuDomainChangeGraphicsPasswords, qemuProcessVerifyGuestCPU and qemuProcessInitPCIAddresses. Replace tabs by spaces.

Re: [libvirt] [PATCHv2] qemu: Redundant listen address entry in quest xml

2014-08-15 Thread Wang Rui
On 2014/8/14 20:44, Erik Skultety wrote: When editing guest's XML (on QEMU), it was possible to add multiple listen elements into graphics parent element. However QEMU does not support listening on multiple addresses. Configuration is tested for multiple 'listen address' and if positive, an

[libvirt] [PATCH] conf: fix parsing 'cmd_per_lun' and 'max_sectors'

2014-08-14 Thread Wang Rui
From: Mo yuxiang moyuxi...@huawei.com commit d9504941 introduces two new attributes cmd_per_lun and max_sectors same with the names QEMU uses for virtio-scsi. But the case of parsing them is not exact. Change to parse them if controller has driver element. Signed-off-by: Mo yuxiang

[libvirt] [PATCH V3 1/3] qemu: Hide vram attribute for some useless cases.

2014-08-14 Thread Wang Rui
zengjunli...@huawei.com Signed-off-by: Wang Rui moon.wang...@huawei.com --- docs/formatdomain.html.in | 24 +++--- src/qemu/qemu_command.c| 3 ++- src/qemu/qemu_domain.c | 12 +++ ...qemuhotplug

[libvirt] [PATCH V3 3/3] qemu: Add secondary-vga support

2014-08-14 Thread Wang Rui
configuration sample: video model type='secondary' vgamem='16384' heads='1'/ /video The resulting qemu command line change is the addition of: -device secondary-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x5 Signed-off-by: Zeng Junliang zengjunli...@huawei.com Signed-off-by: Wang Rui moon.wang

[libvirt] [PATCH V3 0/3] Some improvements for video model

2014-08-14 Thread Wang Rui
From: Zeng Junliang zengjunli...@huawei.com http://www.redhat.com/archives/libvir-list/2014-July/msg00644.html diff to v2: - hide vram attribute silently instead of reporting an error. - introduce three new capabilities for vga.vgamem_mb, vmvga.vgamem_mb and qxl.vgamem_mb. - fix some error

[libvirt] [PATCH V3 2/3] qemu: Introduce vgamem attribute for video model

2014-08-14 Thread Wang Rui
has no attribute named vram* vmvga vgamem vgamem_mb Signed-off-by: Zeng Junliang zengjunli...@huawei.com Signed-off-by: Wang Rui moon.wang...@huawei.com --- docs/formatdomain.html.in | 35 --- docs/schemas/domaincommon.rng

Re: [libvirt] [PATCH] build: Fix build warning on libvirt-python

2014-08-14 Thread Wang Rui
Ping. [python PATCH] On 2014/8/8 17:55, Wang Rui wrote: From: Mo Yuxiang moyuxi...@huawei.com On compiling libvirt-python, we get such a warning: libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’: libvirt-qemu-override.c:304: warning: suggest

Re: [libvirt] [PATCH v2 libvirt 1/8] conf: add model child element to filesystem

2014-08-12 Thread Wang Rui
On 2014/8/11 22:47, Giuseppe Scrivano wrote: @@ -6458,6 +6463,7 @@ virDomainFSDefParseXML(xmlNodePtr node, virDomainFSDefPtr def; xmlNodePtr cur, save_node = ctxt-node; char *type = NULL; +char *model = NULL; char *fsdriver = NULL; char *source = NULL;

Re: [libvirt] [PATCH 1/1] qemu: min_guarantee: Parameter 'min_guarantee' not supported

2014-08-12 Thread Wang Rui
On 2014/8/11 18:07, Erik Skultety wrote: The 'min_guarantee' is used by esx and vmx drivers, with qemu however, libvirt should report error when starting a domain, because this element is not used. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1122455 --- The idea seems good. I

[libvirt] [python-PATCH] Fix libvirt_longlongWrap returning a very large value

2014-08-11 Thread Wang Rui
...@huawei.com Signed-off-by: Wang Rui moon.wang...@huawei.com --- libvirt-override.c | 18 +- typewrappers.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libvirt-override.c b/libvirt-override.c index ed5e9e4..b2271ae 100644 --- a/libvirt-override.c +++ b

[libvirt] [PATCH] build: Fix build warning on libvirt-python

2014-08-08 Thread Wang Rui
From: Mo Yuxiang moyuxi...@huawei.com On compiling libvirt-python, we get such a warning: libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’: libvirt-qemu-override.c:304: warning: suggest explicit braces to avoid ambiguous ‘else’ Py_DECREF is a macro.

[libvirt] [PATCH] audit: Fix some comments

2014-08-07 Thread Wang Rui
Fix a comment in virDomainAuditNetDevice. Fix a typo in comment of qemuPhysIfaceConnect which is the caller of virDomainAuditNetDevice. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_audit.c | 4 ++-- src/qemu/qemu_command.c | 2 +- 2 files changed, 3 insertions(+), 3

Re: [libvirt] [PATCH] audit: Fix some comments

2014-08-07 Thread Wang Rui
On 2014/8/7 17:07, Ján Tomko wrote: On 08/07/2014 10:12 AM, Wang Rui wrote: Fix a comment in virDomainAuditNetDevice. Fix a typo in comment of qemuPhysIfaceConnect which is the caller of virDomainAuditNetDevice. Signed-off-by: Wang Rui moon.wang...@huawei.com --- src/conf/domain_audit.c

Re: [libvirt] [RFC PATCH 2/5] conf: Parse and format ivshmem device XML

2014-08-06 Thread Wang Rui
On 2014/8/6 0:48, Maxime Leroy wrote: This patch adds configuration support for the ivshmem device as described in the schema in the previous patch. Signed-off-by: Maxime Leroy maxime.le...@6wind.com --- src/conf/domain_conf.c | 234 ++-

Re: [libvirt] [RFC PATCH 1/5] doc: schema: Add basic documentation for the ivshmem support

2014-08-06 Thread Wang Rui
On 2014/8/6 0:48, Maxime Leroy wrote: This patch documents XML elements used for support of ivshmem devices. About ivshmem, please see the following documentation: http://git.qemu.org/?p=qemu.git;a=blob;f=docs/specs/ivshmem_device_spec.txt (Ivshmem documentation for qemu will be updated

Re: [libvirt] [RFC PATCH 4/5] qemu: Build command line for ivshmem device

2014-08-06 Thread Wang Rui
On 2014/8/6 0:48, Maxime Leroy wrote: This patch implements support for the ivshmem device in QEMU. Example from this xml: ivshmem server='yes'' role='master'/ s/'yes''/'yes' source file='/tmp/socket-ivshmem0'/ size unit='M'32/size msi vectors='32'

Re: [libvirt] [RFC PATCH 0/5] ivshmem support

2014-08-06 Thread Wang Rui
On 2014/8/6 0:48, Maxime Leroy wrote: The following patches are an implementation proposal for the ivshmem device support in libvirt. Any feedback is welcome. Note: SELinux is not supported (need to be done for the next patchset version) Just some questiones: Is there only one

  1   2   >