Re: [libvirt] [python v2 PATCH] Add dict check for setTime and allow pass one valid parameter

2014-10-27 Thread lhuang
Thanks your reply and i have a new idea about when time = None. On 10/28/2014 01:24 AM, Eric Blake wrote: On 10/27/2014 12:58 AM, Luyao Huang wrote: When pass None to time, it will set guest time to 0. When pass an empty dictionary, it will report error. Allow a one-element dictionary which

Re: [libvirt] [PATCH] Fix memory leak in cmdNetworkDHCPLeases

2014-10-30 Thread lhuang
On 10/30/2014 02:27 PM, Peter Krempa wrote: On 10/30/14 03:35, Luyao Huang wrote: After use cidr_format in function virAsprintf and vshPrintExtra, need free cidr_format. Fix the following memory leak from valgrind, like: 18 bytes in 1 blocks are definitely lost in loss record 41 of 192

Re: [libvirt] [PATCH] Fix a mismatch attribute name

2014-11-07 Thread lhuang
On 11/07/2014 05:15 PM, Eric Blake wrote: On 11/07/2014 09:24 AM, Luyao Huang wrote: From libvirt.org we know this attribute named: interface_mac MAC address of the network interface, not unique Shouldn't we instead be fixing the docs to match the code? Changing the code now may break

Re: [libvirt] [PATCH] Fix a mismatch attribute name

2014-11-07 Thread lhuang
On 11/07/2014 05:45 PM, Eric Blake wrote: On 11/07/2014 10:37 AM, lhuang wrote: On 11/07/2014 05:15 PM, Eric Blake wrote: On 11/07/2014 09:24 AM, Luyao Huang wrote: From libvirt.org we know this attribute named: interface_macMAC address of the network interface, not unique Shouldn't we

Re: [libvirt] [v2 PATCH] doc: Fix a mismatch attribute name

2014-11-07 Thread lhuang
On 11/07/2014 05:53 PM, Eric Blake wrote: On 11/07/2014 10:47 AM, Eric Blake wrote: On 11/07/2014 10:35 AM, Luyao Huang wrote: From virAccessDriverPolkitCheckInterface function, we know this attribute should named: interface_macaddr Eww. 'git am' strips an initial commit line beginning with

Re: [libvirt] [PATCH] security:selinux: Fix crash when tcon is NULL

2014-11-10 Thread lhuang
On 11/10/2014 03:57 PM, Martin Kletzander wrote: On Sat, Nov 08, 2014 at 06:17:26PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1161831 Libvirtd will crash when parameter tcon = NULL in virSecuritySELinuxSetFileconHelper function, because libvirt do not check the

Re: [libvirt] [PATCH] conf: Fix crash when src-hosts = NULL in virStorageFileBackendGlusterInit

2014-11-12 Thread lhuang
On 11/12/2014 04:50 PM, Peter Krempa wrote: On 11/12/14 09:47, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1162974 When do external snapshot for a gluster disk with no host name(ip) in snapshot xml, libvirtd will crash. Because when node do not have a children in

Re: [libvirt] [PATCH] qemu: output error when try to hotplug unsupport console

2014-11-26 Thread lhuang
On 11/26/2014 12:17 AM, Pavel Hrdina wrote: On 11/17/2014 03:31 PM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1164627 When try to use attach-device to hotplug a qemu unsupport sonsole, command will return success, and add a console in vm's xml.But this doesn't work in

Re: [libvirt] [PATCH] qemu: output error when try to hotplug unsupport console

2014-12-03 Thread lhuang
On 12/02/2014 11:59 PM, Ján Tomko wrote: On 11/26/2014 11:02 AM, lhuang wrote: On 11/26/2014 12:17 AM, Pavel Hrdina wrote: On 11/17/2014 03:31 PM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1164627 When try to use attach-device to hotplug a qemu unsupport sonsole

Re: [libvirt] [PATCHv2 2/2] security: Add a new func use stat to get process DAC label

2014-12-04 Thread lhuang
On 12/05/2014 12:58 AM, Ján Tomko wrote: On 12/03/2014 11:08 AM, Luyao Huang wrote: When use qemuProcessAttach to attach a qemu process, cannot get a right DAC label. Add a new func to get process label via stat func. Do not remove virDomainDefGetSecurityLabelDef before try to use stat to get

Re: [libvirt] [PATCHv4 2/2] security: Add a new func use stat to get process DAC label

2014-12-11 Thread lhuang
On 12/11/2014 05:45 PM, Ján Tomko wrote: On 12/09/2014 09:33 AM, Luyao Huang wrote: When use qemuProcessAttach to attach a qemu process, cannot get a right DAC label. Add a new func to get process label via stat func. Do not remove virDomainDefGetSecurityLabelDef before try to use stat to get

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

2014-12-17 Thread lhuang
On 12/16/2014 11:46 PM, Michal Privoznik wrote: 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

Re: [libvirt] [PATCHv2] lxc: fix show the wrong xml when guest start failed

2015-02-03 Thread lhuang
On 02/03/2015 11:01 PM, John Ferlan wrote: On 01/12/2015 09:33 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1176503 When guest start failed, libvirt will keep the current vm-def, this will make a issue that we cannot get a right xml after guest start failed. And don't

Re: [libvirt] [PATCH] conf: fix forget goto error when report a unsupport error

2015-02-04 Thread lhuang
On 02/04/2015 03:29 PM, Peter Krempa wrote: On Wed, Feb 04, 2015 at 10:33:29 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1188914 This will cause a issue that add a unsupport input device to a hypervisor which unsupport it, also will cause a wrong error message when

Re: [libvirt] [PATCH] qemu: Properly report error when cookin uuid not match the ctxt uuid

2015-02-05 Thread lhuang
On 02/05/2015 03:14 PM, Ján Tomko wrote: On Thu, Feb 05, 2015 at 11:42:26AM +0800, Luyao Huang wrote: Add the missing jump to the error label when cookin uuid does not match the ctxt uuid. 'cookie uuid' and 'ctxt uuid' don't seem clear enough to me. I have reworded the commit message: Add

Re: [libvirt] [PATCH 2/2] qemu: add a check when cold-plug a Chr device

2015-01-21 Thread lhuang
On 01/22/2015 07:16 AM, John Ferlan wrote: On 12/09/2014 01:48 AM, Luyao Huang wrote: Add a func just check the base target type which qemu support. But i still doubt this will be useful , we already have a check when we try to start the vm. And this check only check the target type, and the

Re: [libvirt] [PATCH v3 2/2] qemu: add a target type check when hot/cold-plug a Chr device

2015-01-22 Thread lhuang
On 01/22/2015 03:37 PM, Peter Krempa wrote: On Thu, Jan 22, 2015 at 10:28:19 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1164627 Add a func just check the base target type which qemu support. And this check will help to avoid add a qemu unsupport target type chr

Re: [libvirt] [PATCH] qemu: fix fail to start vm with one cell use memdev and another not

2015-01-16 Thread lhuang
On 01/16/2015 04:54 PM, Michal Privoznik wrote: On 16.01.2015 03:12, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1182467 We changed our build numa qemu cmd line way in f309db, But qemu cannot accept one cell use memdev and another not, so this cause a issue when we start a

Re: [libvirt] [PATCH] qemu: fix fail to start vm with one cell use memdev and another not

2015-01-16 Thread lhuang
On 01/16/2015 04:48 PM, Peter Krempa wrote: On Fri, Jan 16, 2015 at 10:12:49 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1182467 We changed our build numa qemu cmd line way in f309db, But qemu cannot accept one cell use memdev and another not, so this cause a issue

Re: [libvirt] [PATCHv2 1/2] qemu: output error when try to hotplug unsupport console

2015-01-20 Thread lhuang
On 01/21/2015 02:59 AM, John Ferlan wrote: Looks like this one may have been lost in the holidays... Aha, thanks a lot for 'save' this patch, I almost forget this patch ;) On 12/09/2014 01:48 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1164627 When try to use

Re: [libvirt] [PATCH 2/2] qemu: add a check when cold-plug a Chr device

2015-01-20 Thread lhuang
On 01/21/2015 03:00 AM, John Ferlan wrote: On 12/09/2014 01:48 AM, Luyao Huang wrote: Add a func just check the base target type which qemu support. But i still doubt this will be useful , we already have a check when we try to start the vm. And this check only check the target type, and the

Re: [libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread lhuang
On 02/11/2015 04:40 AM, Laine Stump wrote: On 02/10/2015 04:35 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the

Re: [libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread lhuang
On 02/11/2015 04:40 AM, Laine Stump wrote: On 02/10/2015 04:35 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the

Re: [libvirt] [PATCH v3] lxc: fix show the wrong xml when guest start failed

2015-02-12 Thread lhuang
On 02/13/2015 04:45 AM, John Ferlan wrote: On 02/04/2015 08:42 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1176503 When guest start failed, libvirt will keep the current vm-def, this will make a issue that we cannot get a right xml after guest start failed. And don't

Re: [libvirt] [PATCH] virsh: fix IP address in vncdisplay for listen type='network'

2015-02-16 Thread lhuang
On 02/16/2015 06:51 PM, Pavel Hrdina wrote: On Sun, Feb 15, 2015 at 04:49:09PM +0800, Luyao Huang wrote: Just like the fix for domdisplay in commit 1ba815. --- tools/virsh-domain.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c

Re: [libvirt] [PATCH] qemu: fix cannot set graphic passwd via qemuDomainSaveImageDefineXML

2015-01-28 Thread lhuang
On 01/29/2015 12:25 AM, Michal Privoznik wrote: On 20.01.2015 10:04, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1183890 When we try to update a xml to a image file, we will clear the graphics passwd settings, because we do not pass VIR_DOMAIN_XML_SECURE to

Re: [libvirt] [PATCH 05/12] libvirt_private: add 4 new func in libvirt_private.syms

2015-01-06 Thread lhuang
On 01/06/2015 04:11 PM, Peter Krempa wrote: On 01/06/15 09:10, lhuang wrote: On 01/05/2015 10:48 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: Signed-off-by: Luyao Huang lhu...@redhat.com --- src/libvirt_private.syms | 5 + 1 file changed, 5 insertions(+) diff --git

Re: [libvirt] [PATCH 11/12] qemu: Implement RNG device hotplug on live level

2015-01-05 Thread lhuang
On 01/05/2015 11:48 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: We have enough patches for hotplug RNG device, maybe we can implement live hotplug of a RNG device. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_driver.c | 8 - src/qemu/qemu_hotplug.c

Re: [libvirt] [PATCH 09/12] qemu_monitor: add 2 functions qemuMonitorDetachRNGDev and qemuMonitorAttachRNGDev

2015-01-05 Thread lhuang
On 01/05/2015 11:31 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: These 2 functions just do some basic check and then call qemuMonitorJSONAttachRNGDev and qemuMonitorDelObject to help us. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_monitor.c | 43

Re: [libvirt] [PATCH 07/12] qemu: introduce 2 func qemuDomainRNGInsert and qemuDomainRNGRemove

2015-01-05 Thread lhuang
On 01/05/2015 11:22 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: qemu side functions, call virDomainRNGInsert and virDomainRNGRemove to help us. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_hotplug.c | 23 +++ src/qemu/qemu_hotplug.h |

Re: [libvirt] [PATCH 03/12] conf: introduce a new func virDomainRNGEquals

2015-01-05 Thread lhuang
On 01/05/2015 11:00 PM, Peter Krempa wrote: Subject: ... How about conf: Introduce function to compare RNG devices. On 01/03/15 06:06, Luyao Huang wrote: virDomainRNGEquals is a func which check if two rng device are the same. Signed-off-by: Luyao Huang lhu...@redhat.com ---

Re: [libvirt] [PATCH 06/12] qemu: add id when build RNG device and rename object id

2015-01-05 Thread lhuang
On 01/05/2015 11:45 PM, Peter Krempa wrote: On 01/05/15 15:51, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: We didn't set a id when we build RNG device cmdline before. Give a id to every RNG device and we can hotunplug it via QMP cmd device_del. Signed-off-by: Luyao Huang

Re: [libvirt] [PATCH 01/12] qemu: introduce a new func qemuAssignDeviceRNGAlias for rng device

2015-01-05 Thread lhuang
On 01/05/2015 11:10 PM, Peter Krempa wrote: Subject: perhaps.. qemu: Add helper to assign RNG device aliases Thanks, good Subject On 01/03/15 06:06, Luyao Huang wrote: This function used to set a alias name for RNG device, usage just This function is used to assign an alias for a RNG

Re: [libvirt] [PATCH 02/12] qemu: rename qemuBuildRNGDeviceArgs to qemuBuildRNGDevStr and change something

2015-01-05 Thread lhuang
On 01/05/2015 11:18 PM, Peter Krempa wrote: Subject: change something? That's a really vague statement. How about: qemu: refactor qemuBuildRNGDeviceArgs to allow reuse in RNG hotplug Good subject :) Thanks On 01/03/15 06:06, Luyao Huang wrote: rename qemuBuildRNGDeviceArgs to

Re: [libvirt] [PATCH 10/12] audit: make function virDomainAuditRNG global

2015-01-05 Thread lhuang
On 01/05/2015 11:32 PM, Peter Krempa wrote: In subject: audit: export virDomainAuditRNG On 01/03/15 06:06, Luyao Huang wrote: Signed-off-by: Luyao Huang lhu...@redhat.com --- src/conf/domain_audit.c | 2 +- src/conf/domain_audit.h | 7 +++ src/libvirt_private.syms | 1 + 3 files

Re: [libvirt] [PATCH 08/12] qemu: introduce 2 functions for attach a rng object in json monitor

2015-01-05 Thread lhuang
On 01/05/2015 11:29 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: We need a new function to build a RNG device object, and need a function to build a props which will be used in qemuMonitorJSONAddObject. Signed-off-by: Luyao Huang lhu...@redhat.com ---

Re: [libvirt] [PATCH 04/12] conf: introduce 3 functions for RNG device

2015-01-06 Thread lhuang
On 01/05/2015 10:56 PM, Peter Krempa wrote: The subject is vague. Please try to condense what the patch is adding in a way that describes the functions instead of an opaque add 3 functions On 01/03/15 06:06, Luyao Huang wrote: the 3 functions are: virDomainRNGInsert: Insert a RNG device to

Re: [libvirt] [PATCH 05/12] libvirt_private: add 4 new func in libvirt_private.syms

2015-01-06 Thread lhuang
On 01/05/2015 10:48 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: Signed-off-by: Luyao Huang lhu...@redhat.com --- src/libvirt_private.syms | 5 + 1 file changed, 5 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index aa776b4..deab4cf

Re: [libvirt] [PATCH 12/12] qemu: Implement RNG device hotunplug on live level

2015-01-05 Thread lhuang
On 01/05/2015 11:54 PM, Peter Krempa wrote: On 01/03/15 06:06, Luyao Huang wrote: We have enough patches for hotunplug RNG device, maybe we can implement live hotunplug of a RNG device. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_driver.c | 4 +-

Re: [libvirt] [PATCH v2 07/12] qemu: add a functions for attach a rng object in json monitor

2015-01-11 Thread lhuang
On 01/10/2015 11:29 AM, Luyao Huang wrote: We need a new function to build a RNG device object. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_monitor_json.c | 46 src/qemu/qemu_monitor_json.h | 5 + 2 files changed, 51

Re: [libvirt] [PATCH 02/12] qemu: rename qemuBuildRNGDeviceArgs to qemuBuildRNGDevStr and change something

2015-01-06 Thread lhuang
On 01/07/2015 01:16 AM, Eric Blake wrote: On 01/05/2015 11:56 PM, lhuang wrote: On 01/05/2015 11:18 PM, Peter Krempa wrote: Subject: change something? That's a really vague statement. How about: qemu: refactor qemuBuildRNGDeviceArgs to allow reuse in RNG hotplug Good subject :) Thanks

Re: [libvirt] [PATCH] conf: fix cannot get mutli value settings when parse controllers XML

2015-01-07 Thread lhuang
On 01/07/2015 05:54 PM, Peter Krempa wrote: On 01/07/15 10:36, Luyao Huang wrote: We will free the old parameter value settings in next loop when we get scsi controller's driver specific options. This description doesn't really explain what is the actual problem you are fixing. Please be

Re: [libvirt] [PATCH] lxc: fix show the wrong xml when guest start failed

2015-01-06 Thread lhuang
On 01/06/2015 11:14 PM, Laine Stump wrote: On 01/06/2015 09:31 AM, Luyao Huang wrote: On 01/06/2015 10:11 PM, Michal Privoznik wrote: On 22.12.2014 08:21, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1176503 When guest start failed, libvirt will keep the current vm-def,

Re: [libvirt] [PATCH v2 07/12] qemu: add a functions for attach a rng object in json monitor

2015-01-12 Thread lhuang
On 01/13/2015 10:35 AM, Zhu Guihua wrote: Hi Luyao, Hi Guihua, On Mon, 2015-01-12 at 09:38 +0800, lhuang wrote: On 01/10/2015 11:29 AM, Luyao Huang wrote: We need a new function to build a RNG device object. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_monitor_json.c

Re: [libvirt] [PATCH] conf: fix crash when hotplug a channel chr device with no target

2015-01-13 Thread lhuang
On 01/13/2015 05:34 PM, Ján Tomko wrote: On 01/13/2015 09:41 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1181408 when we try to hotplug a channel chr device with no target, we will get success(which should fail) in virDomainChrDefParseXML, because we use goto cleanup

Re: [libvirt] [PATCH] qemu: fix crash in migrate when migrateuri do not have a scheme

2015-02-11 Thread lhuang
migrate test4 --live qemu+ssh://lhuang/system --migrateuri 127.0.0.1 target libvirtd will crashed because uri-scheme is NULL in qemuMigrationPrepareDirect this line: if (STRNEQ(uri-scheme, tcp) There is a similar check in doNativeMigrate: if (!(uribits = qemuMigrationParseURI(uri

Re: [libvirt] [PATCH] conf: Don't use the current state in def-data.network.actual when migrate

2015-01-07 Thread lhuang
On 01/07/2015 08:16 PM, Jiri Denemark wrote: On Thu, Dec 25, 2014 at 11:38:00 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1177194 When migrate a vm, we will generate a xml via qemuDomainDefFormatLive and pass this xml to target libvirtd. Libvirt will use the current

Re: [libvirt] [PATCH] conf: fix use the wrong type for period

2015-03-15 Thread lhuang
On 03/13/2015 10:38 PM, Martin Kletzander wrote: On Fri, Mar 13, 2015 at 05:15:32PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1140958 When we set period as unsigned int max value 4294967295 and start the vm, qemu will report error. This becuase we define period as

Re: [libvirt] [PATCH] qemu: fix sometimes error overwrite when we fail to start/migrate/restore

2015-03-19 Thread lhuang
On 03/19/2015 05:27 PM, Ján Tomko wrote: On Thu, Mar 19, 2015 at 11:14:39AM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1196934 Adding a comment in the bugzilla saying you posted a patch (with a link to libvir-list archives) can be helpful. Otherwise they might send

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread lhuang
On 03/10/2015 07:44 AM, John Ferlan wrote: On 03/09/2015 03:35 AM, lhuang wrote: ...snip... I think once you have an address you just return the first one found and document it that way avoiding this path completely. You could also note that if you want a specific address use the type

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-10 Thread lhuang
On 03/10/2015 07:50 AM, John Ferlan wrote: On 03/09/2015 11:37 AM, Luyao Huang wrote: On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress

Re: [libvirt] [PATCHv2 3/4] network: rework networkGetNetworkAddress to make it can get IPv6 address

2015-03-08 Thread lhuang
On 03/09/2015 07:50 AM, John Ferlan wrote: $SUBJ: network: Allow networkGetNetworkAddress to return IPv6 address On 02/28/2015 04:08 AM, Luyao Huang wrote: Export the required helpers and rework networkGetNetworkAddress to make it can get IPv6 address. Signed-off-by: Luyao Huang

Re: [libvirt] [PATCHv2 4/4] qemu: fix a error coverd issue in 2 place

2015-03-08 Thread lhuang
On 03/09/2015 07:51 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: we already set a more clearly error in networkGetNetworkAddress, so this error will cover our error in networkGetNetworkAddress. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_command.c |

Re: [libvirt] [PATCHv2 2/4] conf: introduce new family attribute in graphics listen for chose IP family

2015-03-08 Thread lhuang
On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: If a interface or network have both ipv6 and ipv4 address which can be used, we do not know use which be a listen address. So introduce a new attribute to help us chose this. graphics XML will like this

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread lhuang
On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and virNetDevGetIPv4Address to get IP address.

Re: [libvirt] [PATCH 4/6] qemu: check if domain is really active when do setvcpus with --live

2015-03-24 Thread lhuang
On 03/24/2015 05:31 PM, Pavel Hrdina wrote: On Tue, Mar 24, 2015 at 02:27:42PM +0800, lhuang wrote: On 03/20/2015 10:39 PM, Pavel Hrdina wrote: From: Luyao Huang lhu...@redhat.com Commit e105dc9 fix setting vcpus for offline domain, but forget check if vm is active when pass

Re: [libvirt] [PATCH] qemu: fix can use setmaxmem to change the maximum memory biger than max memory

2015-03-25 Thread lhuang
On 03/25/2015 04:48 PM, Peter Krempa wrote: On Tue, Mar 24, 2015 at 22:12:37 +0800, Luyao Huang wrote: When call qemuDomainSetMemoryFlags() to change maximum memory size, we do not check if the maximum memory is biger than the max memory, this will make vm disappear after libvirtd restart if

Re: [libvirt] [PATCH] qemu: fix cannot start a vm with memory device with address

2015-03-26 Thread lhuang
On 03/26/2015 04:24 PM, Peter Krempa wrote: On Thu, Mar 26, 2015 at 14:30:56 +0800, Luyao Huang wrote: When start a vm which have a memory device with address, the error like this : error: Failed to start domain test3 error: internal error: early end of file from monitor: possible problem:

Re: [libvirt] [PATCH] qemu: add a value check for granularity

2015-04-01 Thread lhuang
On 04/01/2015 04:12 PM, Michal Privoznik wrote: On 27.03.2015 10:56, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1206479 From our manual of virsh and qemu side code, we know this value must be power of 2, so instead of let qemu output error, we can add a check when we file

Re: [libvirt] [PATCH] tools: fix the wrong check when use virsh setvcpus --maximum

2015-03-22 Thread lhuang
On 03/20/2015 11:01 PM, Pavel Hrdina wrote: On Fri, Mar 20, 2015 at 04:22:24PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1204033 We will ignore --maximum option when only use setvcpus with this option, like this (this error is another issue): # virsh setvcpus

Re: [libvirt] [PATCH] qemu: check if domain is really active when do setvcpus with --live

2015-03-22 Thread lhuang
On 03/20/2015 10:52 PM, Pavel Hrdina wrote: On Fri, Mar 20, 2015 at 03:07:09PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1204006 Commit e105dc9 fix setting vcpus for offline domain, but forget check if vm is active when pass VIR_DOMAIN_AFFECT_LIVE flags. # virsh

Re: [libvirt] [PATCH] docs: add a mention for start a vm with rawio = 'yes'

2015-03-02 Thread lhuang
On 03/02/2015 06:43 PM, Daniel P. Berrange wrote: On Mon, Mar 02, 2015 at 06:04:44PM +0800, Luyao Huang wrote: When we start a vm which have rawio = 'yes' settings without any file caps settings for qemu, qemu process still cannot use this caps (CAP_SYS_RAWIO) and the /proc/pidofqemu/status

Re: [libvirt] [PATCH] qemu: fix not remove the pidfile when close a vm after restart libvirtd

2015-03-03 Thread lhuang
On 03/03/2015 06:57 PM, Michal Privoznik wrote: On 02.03.2015 10:37, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1197600 when create a happy vm and then restart libvirtd, we will loss priv-pidfile, because we don't check if it is there is a pidfile. However we only use this

Re: [libvirt] [PATCH 1/4] util: introduce a new helper for get interface IPv6 address

2015-02-27 Thread lhuang
On 02/25/2015 11:55 PM, Laine Stump wrote: On 02/25/2015 04:50 AM, lhuang wrote: And i also thought about another issue after your reminding: An interface can have more than one IPv6 address. But i still couldn't find a good way until now to chose which IPv6 address if we find more than one

Re: [libvirt] [PATCH] conf: fix not jump to cleanup when parse a host id is invalid

2015-02-26 Thread lhuang
On 02/26/2015 03:56 PM, Ján Tomko wrote: On Thu, Feb 26, 2015 at 02:14:20PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1196503 We already check whether the host id is valid or not, add a jump to forbid invalid host id. Signed-off-by: Luyao Huang lhu...@redhat.com

Re: [libvirt] [PATCH 1/4] util: introduce a new helper for get interface IPv6 address

2015-02-26 Thread lhuang
On 02/25/2015 11:55 PM, Laine Stump wrote: On 02/25/2015 04:50 AM, lhuang wrote: And i also thought about another issue after your reminding: An interface can have more than one IPv6 address. But i still couldn't find a good way until now to chose which IPv6 address if we find more than one

Re: [libvirt] [PATCH 1/4] util: introduce a new helper for get interface IPv6 address

2015-02-25 Thread lhuang
On 02/25/2015 12:12 AM, John Ferlan wrote: On 02/13/2015 02:17 AM, Luyao Huang wrote: Introduce a new function to help to get interface IPv6 address. s/Introduce a new function to help to/Introduce virNetDevGetIPv6Address/ Signed-off-by: Luyao Huang lhu...@redhat.com ---

Re: [libvirt] [PATCH 1/4] util: introduce a new helper for get interface IPv6 address

2015-02-25 Thread lhuang
On 02/25/2015 01:42 AM, John Ferlan wrote: On 02/24/2015 11:12 AM, John Ferlan wrote: ...snip... As I'm reading the next patch I'm thinking I forgot something in the previous one... The default has been IPv4 and would seem to be the right thing to return once we find an address; however, if

Re: [libvirt] [PATCH 3/4] network: rework networkGetNetworkAddress to make it can get IPv6 address

2015-02-25 Thread lhuang
On 02/25/2015 02:22 AM, John Ferlan wrote: On 02/13/2015 02:17 AM, Luyao Huang wrote: Export the required helpers and rework networkGetNetworkAddress to make it can get IPv6 address. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/conf/network_conf.c | 2 +-

Re: [libvirt] [PATCH 4/4] qemu: fix a error coverd issue in 2 place

2015-02-25 Thread lhuang
On 02/25/2015 02:52 AM, John Ferlan wrote: On 02/13/2015 02:17 AM, Luyao Huang wrote: we already set a more clearly error in networkGetNetworkAddress, so this error will cover our error in networkGetNetworkAddress. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_command.c |

Re: [libvirt] [PATCH 4/4] qemu: fix a error coverd issue in 2 place

2015-02-26 Thread lhuang
On 02/25/2015 10:51 PM, Ján Tomko wrote: On Tue, Feb 24, 2015 at 01:52:08PM -0500, John Ferlan wrote: On 02/13/2015 02:17 AM, Luyao Huang wrote: we already set a more clearly error in networkGetNetworkAddress, so this error will cover our error in networkGetNetworkAddress. Signed-off-by:

Re: [libvirt] [PATCH 4/6] qemu: check if domain is really active when do setvcpus with --live

2015-03-24 Thread lhuang
On 03/20/2015 10:39 PM, Pavel Hrdina wrote: From: Luyao Huang lhu...@redhat.com Commit e105dc9 fix setting vcpus for offline domain, but forget check if vm is active when pass VIR_DOMAIN_AFFECT_LIVE flags. # virsh setvcpus test3 4 --live error: Failed to create controller cpu for group:

Re: [libvirt] [PATCH] lxc: fix 2 issue around cpuset

2015-04-20 Thread lhuang
On 04/20/2015 10:04 PM, Ján Tomko wrote: On Fri, Apr 03, 2015 at 06:11:15PM +0800, Luyao Huang wrote: There are two bugs in this function: 1. cannot start a vm with cpuset but without numatune settings # virsh -c lxc:/// start helloworld error: Failed to start domain helloworld error:

Re: [libvirt] [PATCH 0/2] rework the check for the numa cpus

2015-04-21 Thread lhuang
On 04/20/2015 10:39 PM, Michal Privoznik wrote: On 02.04.2015 10:02, Luyao Huang wrote: We introduce a check for numa cpu total count in 5f7b71, But seems this check cannot work well. There are some scenarioes: 1. one of cpu id is out of maxvcpus, can set success(cpu count = 5 10): vcpu

Re: [libvirt] [PATCH] docs: add dimm address document in docs

2015-05-14 Thread lhuang
On 05/14/2015 07:57 PM, Peter Krempa wrote: On Thu, May 14, 2015 at 17:08:53 +0800, Luyao Huang wrote: As we have a new device address type 'dimm', add some document and an example to our docs. Signed-off-by: Luyao Huang lhu...@redhat.com --- docs/formatdomain.html.in | 8 1 file

Re: [libvirt] [PATCHv2] virsh: fix no error output when parse cpulist fail

2015-05-14 Thread lhuang
On 05/14/2015 08:33 PM, Michal Privoznik wrote: On 11.05.2015 10:25, Luyao Huang wrote: When we pass a invalid cpulist or the lastcpu in the cpulist exceed the maxcpu, we cannot get any error. like this: # virsh vcpupin test3 1 aaa # virsh vcpupin test3 1 1000 Because virBitmapParse()

Re: [libvirt] [PATCHv2] conf: fix no error when set an unsupport string in ./devices/shmem/msi[@ioeventfd]

2015-05-12 Thread lhuang
On 05/11/2015 10:08 PM, Martin Kletzander wrote: On Mon, May 11, 2015 at 08:59:37PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1220265 Pass the return value to an enum directly is not safe. When pass a invalid @ioeventfd and virTristateSwitchTypeFromString return -1

Re: [libvirt] [PATCH] qemu: fix double free when fail to cold-plug a rng device

2015-05-12 Thread lhuang
On 05/12/2015 11:14 PM, Michal Privoznik wrote: On 12.05.2015 15:55, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1220809 When cold-plug a rng device and get failed in qemuDomainAssignAddresses, we will double free the rng device. Free the pointer after we Insert the device

Re: [libvirt] [PATCH] conf: fix memleak in qemuRestoreCgroupState

2015-04-08 Thread lhuang
On 04/08/2015 06:00 PM, Ján Tomko wrote: The subject prefix is incorrect - this is not in src/conf. I just removed it completely, there's still a reference to qemu driver in the function name. Oh, that is a mistake, i can't remember why i chose conf as this commit subject prefix (maybe i

Re: [libvirt] [PATCHv4 0/3] Support IPv6 addresses for graphics listening on networks

2015-04-09 Thread lhuang
On 04/08/2015 11:35 PM, Ján Tomko wrote: v1: https://www.redhat.com/archives/libvir-list/2015-February/msg00442.html v2: https://www.redhat.com/archives/libvir-list/2015-February/msg01228.html v3: https://www.redhat.com/archives/libvir-list/2015-March/msg00423.html changes in v4: * remove the

Re: [libvirt] [PATCH] qemu: fix wrong call addressrelease function when attach RNG device success

2015-06-02 Thread lhuang
On 06/03/2015 02:04 AM, John Ferlan wrote: On 05/31/2015 07:29 AM, Luyao Huang wrote: Add a return value check to avoid the wrong address release. Signed-off-by: Luyao Huang lhu...@redhat.com --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ACK -

Re: [libvirt] [PATCH] conf:audit: fix no audit log when start a vm with iothread

2015-06-02 Thread lhuang
On 06/03/2015 02:06 AM, John Ferlan wrote: On 05/31/2015 10:07 AM, Luyao Huang wrote: Signed-off-by: Luyao Huang lhu...@redhat.com --- src/conf/domain_audit.c | 2 ++ 1 file changed, 2 insertions(+) ACK - Will adjust commit message slightly before pushing... Thanks again for your

Re: [libvirt] [PATCH] qemu: fix forget pass the return value to variable @ret

2015-06-02 Thread lhuang
On 06/03/2015 02:05 AM, John Ferlan wrote: On 05/31/2015 09:27 AM, Luyao Huang wrote: If we do not pass the return value from qemuDomainRemoveRNGDevice() function to variable @ret, qemuDomainRemoveDevice() functiuon will always fail when recive rng device unplug event from qemu monitor.

Re: [libvirt] [PATCH] conf: fix not format priority when it is zero

2015-06-25 Thread lhuang
On 06/26/2015 05:26 AM, Martin Kletzander wrote: On Wed, Jun 24, 2015 at 12:00:36PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1235116 We do not format the priority if it is 0, but this will be a broken settings in guest. Change the condition of format priority

Re: [libvirt] [PATCH] qemu:lxc:xml:libxl:xen: improve the error in openconsole/channel

2015-06-24 Thread lhuang
On 06/24/2015 04:12 PM, Martin Kletzander wrote: On Mon, Jun 15, 2015 at 09:58:36PM +0800, Luyao Huang wrote: We allow do not pass the dev_name to openconsole() and openchannel() function, but the error message is not good when we do not specified the console/channel name. the error message

Re: [libvirt] [PATCH] conf: improve the way we format blkiotune and cputune

2015-06-24 Thread lhuang
On 06/24/2015 05:32 PM, Martin Kletzander wrote: On Tue, Jun 23, 2015 at 09:24:25PM +0800, Luyao Huang wrote: Just refactor existing code to use a child buf instead of check all element before format blkiotune and cputune. This will avoid the more and more bigger element check during we

Re: [libvirt] [PATCH] qemu:conf: introduce a function to delete vcpu sched

2015-06-24 Thread lhuang
On 06/24/2015 08:51 PM, Peter Krempa wrote: On Wed, Jun 24, 2015 at 16:44:22 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1235180 We have API allow vpu to be deleted, but an vcpu may be included in some domain vcpu sched, so add a new API to allow removing an iothread

Re: [libvirt] [PATCH] qemu: fix wrong remove guest cfg if migrate fail

2015-06-25 Thread lhuang
On 06/25/2015 04:25 PM, Jiri Denemark wrote: On Thu, Jun 25, 2015 at 09:38:57 +0800, Luyao Huang wrote: If we get fail in qemuMigrationPrepareAny, we forget check if the vm is persistent then always call qemuDomainRemoveInactive to clean the inactive settings. Add a check to avoid this. This

Re: [libvirt] [PATCHv1.5 1/2] cpu:x86: fix specified features will disappear after migrate/restore

2015-06-22 Thread lhuang
On 06/18/2015 09:29 PM, Jiri Denemark wrote: On Wed, Jun 17, 2015 at 22:22:44 +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1207095 We allow set the feature with the host-passthrough cpu, but won't save them in the migration xml, the features we specified will

Re: [libvirt] [PATCHv3] qemu: add a check for slot and base when build dimm address

2015-06-22 Thread lhuang
On 06/18/2015 08:12 PM, John Ferlan wrote: On 06/15/2015 08:33 AM, Luyao Huang wrote: When hot-plug a memory device, we don't check if there is a memory device have the same address with the memory device we want hot-pluged. Qemu forbid use/hot-plug 2 memory device with same slot or the same

Re: [libvirt] [PATCH 2/2] qemu: fix a document issue as we support host-passthrough with features

2015-06-22 Thread lhuang
On 06/18/2015 08:42 PM, Jiri Denemark wrote: On Wed, Jun 17, 2015 at 22:22:45 +0800, Luyao Huang wrote: From the documentation :With this mode, the CPU visible to the guest should be exactly the same as the host CPU even in the aspects that libvirt does not understand. So this place document

Re: [libvirt] [PATCH] qemu: fix cannot attach a virtio channel

2015-06-15 Thread lhuang
On 06/15/2015 04:25 PM, Ján Tomko wrote: I'd rather be more specific in the commit summary, e.g.: fix address allocation on chardev hotplug good summary, thanks for you help On Wed, Jun 10, 2015 at 10:49:37PM +0800, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1230039

Re: [libvirt] [PATCHv3] qemu: add a check for slot and base when build dimm address

2015-06-15 Thread lhuang
On 06/16/2015 08:27 AM, zhang bo wrote: On 2015/6/15 20:33, Luyao Huang wrote: When hot-plug a memory device, we don't check if there is a memory device have the same address with the memory device we want hot-pluged. Qemu forbid use/hot-plug 2 memory device with same slot or the same

Re: [libvirt] [PATCHv2] qemu: add a check for slot and base when build dimm address

2015-06-10 Thread lhuang
On 06/11/2015 03:12 AM, John Ferlan wrote: On 05/27/2015 05:50 AM, Luyao Huang wrote: When hot-plug a memory device, we don't check if there is a memory device have the same address with the memory device we want hot-pluged. Qemu forbid use/hot-plug 2 memory device with same slot or the same

Re: [libvirt] [PATCH] conf: improve the address check for dimm type

2015-05-27 Thread lhuang
On 05/27/2015 03:03 PM, Peter Krempa wrote: On Wed, May 27, 2015 at 14:39:58 +0800, Luyao Huang wrote: When hot-plug/cold-plug a memory device, we use memcmp() function to check if there is a memory device have the same address with the memory device we want hot-pluged. But qemu forbid

Re: [libvirt] [PATCH] util: improve the sysinfo element XML format

2015-05-27 Thread lhuang
On 05/27/2015 07:59 AM, John Ferlan wrote: On 05/22/2015 05:26 AM, Luyao Huang wrote: When set sysinfo element without sub-elements, libvirt will format it as: sysinfo type='smbios' /sysinfo After improve the format: sysinfo type='smbios'/ Signed-off-by: Luyao Huang

Re: [libvirt] [PATCH] conf: do not format redirfilter element if it do not have sub-element

2015-05-27 Thread lhuang
On 05/27/2015 08:00 AM, John Ferlan wrote: On 05/22/2015 05:26 AM, Luyao Huang wrote: When set a redirfilter element without sub-element, libvirt will format it like this: redirfilter /redirfilter Just drop this element if it do not have any sub-element. Signed-off-by: Luyao

Re: [libvirt] [PATCH] qemu: fix not end the job after use OpenGraphics(FD) and get fail when exit monitor

2015-07-01 Thread lhuang
On 07/01/2015 02:15 PM, Martin Kletzander wrote: On Tue, Jun 30, 2015 at 11:35:13AM +0800, Luyao Huang wrote: If guest unexpect exit(qemu process be killed) and get failed when exit the monitor, guest job still handled by old function, this will make guest cannot start later. Need call

Re: [libvirt] [PATCH 03/10] qemu: Refactor creation of shared memory device commandline

2015-07-06 Thread lhuang
On 07/06/2015 01:38 PM, Martin Kletzander wrote: On Mon, Jul 06, 2015 at 10:23:59AM +0800, lhuang wrote: On 07/03/2015 08:56 PM, Martin Kletzander wrote: On Wed, Jun 17, 2015 at 11:56:14AM +0800, Luyao Huang wrote: Rename qemuBuildShmemDevCmd to qemuBuildShmemDevStr and change the return

Re: [libvirt] [PATCH] virsh: report error if vcpu number exceed the guest maxvcpu number

2015-07-01 Thread lhuang
On 07/02/2015 04:29 AM, John Ferlan wrote: On 06/28/2015 10:10 PM, Luyao Huang wrote: If usr pass a vcpu which exceed guest maxvcpu number, virsh client will only output an header like this: # virsh vcpupin test3 1000 VCPU: CPU Affinity -- After this

  1   2   >