Re: [libvirt] [libvirt-perl][PATCH] Fix typo in domain help page

2013-05-20 Thread Alex Jia
ACK. -- Regards, Alex - Original Message - From: "Zhe Peng" To: libvir-list@redhat.com Sent: Tuesday, May 21, 2013 10:46:03 AM Subject: [libvirt] [libvirt-perl][PATCH] Fix typo in domain help page The help page of $dom->set_metadata have a typo,this patch fix it. --- lib/Sys/Vir

[libvirt] [PATCH] cgroup: be robust against cgroup movement races

2013-05-20 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=965169 documents a problem starting domains when cgroups are enabled; I was able to reliably reproduce the race about 5% of the time when I added hooks to domain startup by 3 seconds (as that seemed to be about the length of time that qemu created and the

[libvirt] [libvirt-perl][PATCH] Fix typo in domain help page

2013-05-20 Thread Zhe Peng
The help page of $dom->set_metadata have a typo,this patch fix it. --- lib/Sys/Virt/Domain.pm |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index a502029..053f127 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Doma

Re: [libvirt] [PATCH v4 04/13] _virConnectCredential: turn @prompt into char *

2013-05-20 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: > Currently, @prompt member within _virConnectCredential struct is const > char. This violates const correctness as we are not just strdup()-ing > the value, we are even changing it (e.g. in virNetSSHKbIntCb()). > --- > include/libvirt/libvirt.h.in |

Re: [libvirt] [PATCH v4 03/13] Change virConnectDomainEventGraphicsCallback signature

2013-05-20 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: > For future work we need _virDomainEventGraphicsAddress and > _virDomainEventGraphicsSubjectIdentity members to be char * not > const char *. We are strdup()ing them anyway, so they should have > been char * anyway (from const correctness POV). Howev

Re: [libvirt] [PATCH v4 02/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/openvz/*

2013-05-20 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: > --- > src/openvz/openvz_conf.c | 45 ++--- > src/openvz/openvz_driver.c | 29 ++--- > 2 files changed, 32 insertions(+), 42 deletions(-) > > +++ b/src/openvz/openvz_driver.c > @@ -9

Re: [libvirt] [PATCH] esx: Replace almost all esxVI_String_DeepCopyValue vith VIR_STRDUP

2013-05-20 Thread Matthias Bolte
2013/5/20 Daniel P. Berrange : > On Sun, May 19, 2013 at 12:02:49AM +0200, Matthias Bolte wrote: >> --- >> src/esx/esx_driver.c|8 >> src/esx/esx_network_driver.c|6 ++ >> src/esx/esx_storage_backend_iscsi.c |2 +- >> src/esx/esx_storage_backend_vmf

Re: [libvirt] [PATCH v4 01/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/*

2013-05-20 Thread Eric Blake
On 05/20/2013 11:55 AM, Michal Privoznik wrote: > --- > src/conf/capabilities.c | 30 --- > src/conf/cpu_conf.c | 20 > src/conf/domain_conf.c | 119 > > src/conf/domain_event.c | 41 +++ > src/conf/

Re: [libvirt] [PATCH] vmware: Restore OOM error reporting in vmwareCopyVMXFileName

2013-05-20 Thread Matthias Bolte
2013/5/19 Michal Privoznik : > On 19.05.2013 00:01, Matthias Bolte wrote: >> Got lost in commit e6ab10098066dd04794ff2ee5d10bc9b1db93327. >> --- >> src/vmware/vmware_conf.c |2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_c

Re: [libvirt] [PATCH 11/11] Convert Xen domain core dump driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain coredump > APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the name p

Re: [libvirt] [PATCH 10/11] Convert Xen domain stats/peek driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain stats & > peek APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the na

Re: [libvirt] [PATCH 09/11] Convert Xen domain scheduler driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain scheduler > APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the name

Re: [libvirt] [PATCH 08/11] Convert Xen domain autostart driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain autostart > APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the name

Re: [libvirt] [PATCH 07/11] Convert Xen domain device hotplug driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain hotplug > APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the name po

Re: [libvirt] [PATCH 4/4] maint: enforce correct copyright usage

2013-05-20 Thread Eric Blake
On 05/16/2013 12:53 AM, Martin Kletzander wrote: > On 05/16/2013 02:23 AM, Eric Blake wrote: >> To ensure we don't regress and cause the need for further >> cleanups, add a 'make syntax-check' rule that ensures new >> files have proper copyright contents. >> >> * cfg.mk (sc_copyright_file): New rul

Re: [libvirt] [PATCH 3/4] maint: refer to correct license file

2013-05-20 Thread Eric Blake
On 05/16/2013 12:50 AM, Martin Kletzander wrote: > On 05/16/2013 02:23 AM, Eric Blake wrote: >> Now that COPYING no longer contains the text of the LGPL, >> modify the LGPLv2-only files from vbox to call out the >> correct file. >> >> * src/vbox/vbox_CAPI_v2_2.h: Refer to correct file. >> * src/vbo

Re: [libvirt] [PATCH 2/4] maint: follow recommended practice for using LGPL

2013-05-20 Thread Eric Blake
On 05/16/2013 12:50 AM, Martin Kletzander wrote: > On 05/16/2013 02:23 AM, Eric Blake wrote: >> https://www.gnu.org/licenses/gpl-howto.html states: >> >> You should also include a copy of the license itself somewhere in the >> distribution of your program. All programs, whether they are released >>

Re: [libvirt] [PATCH 1/4] maint: use LGPL correctly

2013-05-20 Thread Eric Blake
On 05/16/2013 12:47 AM, Martin Kletzander wrote: > On 05/16/2013 02:23 AM, Eric Blake wrote: >> Several files called out COPYING or COPYING.LIB instead of using >> the normal boilerplate. It's especially important that we don't >> call out COPYING from an LGPL file, since COPYING is traditionally

Re: [libvirt] [PATCH v3 25/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/util/*

2013-05-20 Thread Eric Blake
On 05/20/2013 06:12 AM, Michal Privoznik wrote: >> I've only found one that doesn't: >> src/storage/parthelper.c: >> if (virFileResolveLink(path, &canonical_path) != 0) { >> >> But you still should update the comments stating that they return 0 on >> success. >> > > Huh, "Returns 0 or 1 o

Re: [libvirt] [PATCH 3/5] storage_conf: Various fixes or improvements on pool def parsing

2013-05-20 Thread Eric Blake
On 05/16/2013 06:40 AM, Osier Yang wrote: > virStorageDefParsePerms: > * Use uid_t/gid_t to do casting > > @@ -780,22 +785,22 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, > perms->uid = (uid_t) -1; > } else { > if (virXPathLong("number(./owner)", ctxt, &v) < 0) { >

Re: [libvirt] [PATCH 3/3] LXC: move the comments to the proper place

2013-05-20 Thread Eric Blake
On 05/20/2013 04:42 AM, Daniel P. Berrange wrote: > On Mon, May 20, 2013 at 06:12:19PM +0800, Gao feng wrote: >> The comments is for virLXCControllerSetupPrivateNS. >> >> Signed-off-by: Gao feng >> --- >> src/lxc/lxc_controller.c | 41 + >> 1 file changed,

Re: [libvirt] [PATCH] qemuDomainChangeEjectableMedia: Unlock domain while waiting for event

2013-05-20 Thread Eric Blake
On 05/20/2013 11:41 AM, Michal Privoznik wrote: > In 84c59ffa I've tried to fix changing ejectable media process. The > process should go like this: > > 1) we need to call 'eject' on the monitor > 2) we should wait for 'DEVICE_TRAY_MOVED' event > 3) now we can issue 'change' command > > However,

[libvirt] ANNOUNCE: libvirt 0.10.2.5 maintenance release

2013-05-20 Thread Cole Robinson
libvirt 0.10.2.5 maintenance release is now available. This is libvirt 0.10.2 with additional bugfixes that have accumulated upstream since the initial release. This release can be downloaded at: http://libvirt.org/sources/stable_updates/libvirt-0.10.2.5.tar.gz Changes in this version: * Fix TL

[libvirt] ANNOUNCE: libvirt 1.0.5.1 maintenance release

2013-05-20 Thread Cole Robinson
libvirt 1.0.5.1 maintenance release is now available. This is libvirt 1.0.5 with additional bugfixes that have accumulated upstream since the initial release. This release can be downloaded at: http://libvirt.org/sources/stable_updates/libvirt-1.0.5.1.tar.gz Changes in this version: * tests: us

Re: [libvirt] [PATCH 06/11] Convert Xen domain VCPU driver methods to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain VCPU > APIs to simplify introduction of ACL security checks. > The virDomainPtr cannot be safely used, since the app > may have supplied mis-matching name/uuid/id fields. eg > the name point

[libvirt] [PATCH v4 06/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/remote/*

2013-05-20 Thread Michal Privoznik
--- src/remote/remote_driver.c | 114 + 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 97be2a0..ed3467f 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.

[libvirt] [PATCH v4 13/13] Introduce syntax-check rule to prefer VIR_STRDUP over strdup

2013-05-20 Thread Michal Privoznik
--- cfg.mk | 8 1 file changed, 8 insertions(+) diff --git a/cfg.mk b/cfg.mk index bb93c6a..c714915 100644 --- a/cfg.mk +++ b/cfg.mk @@ -387,6 +387,11 @@ sc_prohibit_asprintf: halt='use strdup instead of virAsprintf with "%s"' \ $(_sc_search_regexp) +sc_p

[libvirt] [PATCH v4 01/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/*

2013-05-20 Thread Michal Privoznik
--- src/conf/capabilities.c | 30 --- src/conf/cpu_conf.c | 20 src/conf/domain_conf.c | 119 src/conf/domain_event.c | 41 +++ src/conf/node_device_conf.c | 28 +-- src/conf/nwfilter_conf.c

[libvirt] [PATCH v4 07/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/rpc/*

2013-05-20 Thread Michal Privoznik
--- src/rpc/gendispatch.pl | 21 src/rpc/virnetclient.c | 16 - src/rpc/virnetmessage.c | 27 +-- src/rpc/virnetsaslcontext.c | 6 ++-- src/rpc/virnetserver.c | 6 ++-- src/rpc/virnetserverclient.c | 10 ++ src/rpc/virnetservermdns.c

[libvirt] [PATCH v4 08/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/security/*

2013-05-20 Thread Michal Privoznik
--- src/security/security_apparmor.c | 20 ++ src/security/security_dac.c | 21 +++ src/security/security_nop.c | 7 +--- src/security/security_selinux.c | 79 +++- src/security/virt-aa-helper.c| 4 +- 5 files changed, 35 inserti

[libvirt] [PATCH v4 03/13] Change virConnectDomainEventGraphicsCallback signature

2013-05-20 Thread Michal Privoznik
For future work we need _virDomainEventGraphicsAddress and _virDomainEventGraphicsSubjectIdentity members to be char * not const char *. We are strdup()ing them anyway, so they should have been char * anyway (from const correctness POV). However, we don't want users to change passed values, so we n

[libvirt] [PATCH v4 12/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/xenxs/*

2013-05-20 Thread Michal Privoznik
--- src/xenxs/xen_sxpr.c | 200 ++- src/xenxs/xen_xm.c | 91 +++ 2 files changed, 125 insertions(+), 166 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 9a76d04..aa99a61 100644 --- a/src/xenxs/xen_s

[libvirt] [PATCH v4 10/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/xen/*

2013-05-20 Thread Michal Privoznik
--- src/xen/block_stats.c| 16 ++-- src/xen/xen_driver.c | 9 +++ src/xen/xen_hypervisor.c | 19 -- src/xen/xen_inotify.c| 15 +++ src/xen/xend_internal.c | 68 src/xen/xm_internal.c| 9 +++ src

[libvirt] [PATCH v4 04/13] _virConnectCredential: turn @prompt into char *

2013-05-20 Thread Michal Privoznik
Currently, @prompt member within _virConnectCredential struct is const char. This violates const correctness as we are not just strdup()-ing the value, we are even changing it (e.g. in virNetSSHKbIntCb()). --- include/libvirt/libvirt.h.in | 2 +- src/remote/remote_driver.c | 2 +- 2 files change

[libvirt] [PATCH v4 11/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/xenapi/*

2013-05-20 Thread Michal Privoznik
--- src/xenapi/xenapi_driver.c | 59 -- src/xenapi/xenapi_utils.c | 39 +++--- 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 7e64df6..cc8da49 100644

[libvirt] [PATCH v4 02/13] Adapt to VIR_STRDUP and VIR_STRNDUP in src/openvz/*

2013-05-20 Thread Michal Privoznik
--- src/openvz/openvz_conf.c | 45 ++--- src/openvz/openvz_driver.c | 29 ++--- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index bea08d8..90b4483 100644 --- a

[libvirt] [PATCH v4 00/13] Introduce VIR_STRDUP

2013-05-20 Thread Michal Privoznik
Previously this aimed on dropping OOM report from almost everywhere (v1), then just prepare the ground (v2). Now, it just aims on introducing VIR_STRDUP and VIR_STRNDUP which do report OOM error. This will cause rebase conflicts, for sure. Sorry. Patches available at: git://gitorious.org/~zippy2

[libvirt] [PATCH] qemuDomainChangeEjectableMedia: Unlock domain while waiting for event

2013-05-20 Thread Michal Privoznik
In 84c59ffa I've tried to fix changing ejectable media process. The process should go like this: 1) we need to call 'eject' on the monitor 2) we should wait for 'DEVICE_TRAY_MOVED' event 3) now we can issue 'change' command However, while waiting in step 2) the domain monitor was locked. So even

Re: [libvirt] [PATCH 05/11] Convert Xen domain start/migration APIs to use virDomainDefPtr

2013-05-20 Thread Jim Fehlig
I finally have some time to continue reviewing this series... Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Introduce use of a virDomainDefPtr in the domain migrate & > start APIs to simplify introduction of ACL security checks. > Not really the 'start' API, but GetXMLDesc, Defin

Re: [libvirt] [PATCHv3 11/11] qemu: Enable multiqueue network

2013-05-20 Thread Laine Stump
On 05/16/2013 08:49 AM, Michal Privoznik wrote: > --- > src/qemu/qemu_command.c | 26 ++ > src/qemu/qemu_hotplug.c | 27 --- > 2 files changed, 34 insertions(+), 19 deletions(-) > > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c > ind

Re: [libvirt] [PATCHv3 10/11] qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net

2013-05-20 Thread Michal Privoznik
On 20.05.2013 19:15, Laine Stump wrote: > On 05/16/2013 08:49 AM, Michal Privoznik wrote: >> --- >> src/qemu/qemu_command.c | 82 >> ++--- >> 1 file changed, 58 insertions(+), 24 deletions(-) >> >> goto cleanup; >> } else if (actualTy

Re: [libvirt] [PATCHv3 10/11] qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net

2013-05-20 Thread Laine Stump
On 05/16/2013 08:49 AM, Michal Privoznik wrote: > --- > src/qemu/qemu_command.c | 82 > ++--- > 1 file changed, 58 insertions(+), 24 deletions(-) > > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c > index f2c6d47..5d64705 100644 > --- a/

Re: [libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Michal Privoznik
On 20.05.2013 17:54, Eric Blake wrote: > On 05/20/2013 07:47 AM, Michal Privoznik wrote: >> Currently, the openvzDomainSetNetwork function constructs an >> array of strings representing a command line for VZCTL binary. >> This is a overkill since our virCommand APIs can cover all the >> functionali

Re: [libvirt] two nasty races

2013-05-20 Thread Daniel P. Berrange
On Mon, May 20, 2013 at 10:09:20AM -0600, Eric Blake wrote: > On 05/20/2013 03:26 AM, Daniel P. Berrange wrote: > > It is worse than that - you can't simply ignore ESRCH. In the same way > > that existing processes can exit, new processes can come into live. > > The virCgroupMoveTask method doesn't

Re: [libvirt] [PATCH 0/2] qemu: Rework CD/DVD changing

2013-05-20 Thread Michal Privoznik
On 20.05.2013 18:25, Eric Blake wrote: > On 05/19/2013 03:51 AM, Michal Privoznik wrote: >> >> I think I know where the bug is. When waiting on tray to open, we don't >> unlock the domain. So later, when an event arrives, the first thing that the >> event handler does is locking the domain. Hence

Re: [libvirt] [PATCH 0/2] qemu: Rework CD/DVD changing

2013-05-20 Thread Eric Blake
On 05/19/2013 03:51 AM, Michal Privoznik wrote: > > I think I know where the bug is. When waiting on tray to open, we don't > unlock the domain. So later, when an event arrives, the first thing that the > event handler does is locking the domain. Hence, it seems like the event is > delivered ri

Re: [libvirt] [PATCH] esx: Fix dynamic VI object type detection

2013-05-20 Thread Eric Blake
On 05/18/2013 04:03 PM, Matthias Bolte wrote: > VI objects support inheritance with subtype polymorphism. For example the > FileInfo object type is extended by FloppyImageFileInfo, FolderFileInfo > etc. Then SearchDatastore_Task returns an array of FileInfo objects and > depending on the represente

Re: [libvirt] [PATCH] esx: Implement esxDomainSetMemoryFlags

2013-05-20 Thread Eric Blake
On 05/18/2013 04:03 PM, Matthias Bolte wrote: > --- > src/esx/esx_driver.c | 22 ++ > 1 file changed, 22 insertions(+) > > diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c > index b55ef45..3962bf1 100644 > --- a/src/esx/esx_driver.c > +++ b/src/esx/esx_driver.c > @@

Re: [libvirt] [PATCH] esx: Accept VIR_DOMAIN_AFFECT_CURRENT in addition to VIR_DOMAIN_AFFECT_LIVE

2013-05-20 Thread Eric Blake
On 05/18/2013 04:02 PM, Matthias Bolte wrote: > Basically autotranslate VIR_DOMAIN_AFFECT_CURRENT to VIR_DOMAIN_AFFECT_LIVE. > > Modification impact is handled lax anyway. There is no distinction between > a live and a stored config in the VMware world. A strict modification impact > handling woul

Re: [libvirt] two nasty races

2013-05-20 Thread Eric Blake
On 05/20/2013 03:26 AM, Daniel P. Berrange wrote: > It is worse than that - you can't simply ignore ESRCH. In the same way > that existing processes can exit, new processes can come into live. > The virCgroupMoveTask method doesn't take any of this into account. > Are you talking about the potent

Re: [libvirt] [PATCH] esx: Implement esxDomainGetMetadata for VIR_DOMAIN_METADATA_DESCRIPTION

2013-05-20 Thread Eric Blake
On 05/18/2013 04:00 PM, Matthias Bolte wrote: > --- > src/esx/esx_driver.c | 47 +++ > 1 file changed, 47 insertions(+) > > diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c > index b23e7f6..f53b9c4 100644 > --- a/src/esx/esx_driver.c > +++ b/s

Re: [libvirt] [PATCH] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Eric Blake
On 05/20/2013 02:46 AM, Ján Tomko wrote: >> -if (prog[0] != NULL) { >> -ADD_ARG_LIT("--save"); >> -if (virRun(prog, NULL) < 0) { >> +if (cmd) { > > cmd may be NULL here on OOM too. That, and virCommandRun is designed to report OOM on your behalf if cmd is NULL, so that you

Re: [libvirt] [PATCH] vbox: fix VIR_STRDUP value check

2013-05-20 Thread Eric Blake
On 05/20/2013 03:59 AM, Ján Tomko wrote: > In my review of 31532ca I missed the fact that VIR_STRDUP > now returns 1 on success, and 0 if the source was NULL. > > (This still doesn't add proper OOM error handling.) > --- > src/vbox/vbox_tmpl.c | 12 ++-- > 1 file changed, 6 insertions(+),

Re: [libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Eric Blake
On 05/20/2013 07:47 AM, Michal Privoznik wrote: > Currently, the openvzDomainSetNetwork function constructs an > array of strings representing a command line for VZCTL binary. > This is a overkill since our virCommand APIs can cover all the > functionality. Moreover, the function is not following o

[libvirt] RFC: Improving unit test coverage

2013-05-20 Thread Daniel P. Berrange
Over the many years that libvirt has been in existance, we have developed a huge number of features, and rate of change in the codebase shows no sign of slowing down. Unfortunately the rate of regressions and/or new bugs also shows no sign of decreasing. As libvirt is used ever more widely, poor q

Re: [libvirt] [PATCH] esx: Replace almost all esxVI_String_DeepCopyValue vith VIR_STRDUP

2013-05-20 Thread Daniel P. Berrange
On Sun, May 19, 2013 at 12:02:49AM +0200, Matthias Bolte wrote: > --- > src/esx/esx_driver.c|8 > src/esx/esx_network_driver.c|6 ++ > src/esx/esx_storage_backend_iscsi.c |2 +- > src/esx/esx_storage_backend_vmfs.c |4 ++-- > src/esx/esx_util.c

Re: [libvirt] [PATCHv3 09/11] qemu: Adapt qemuDomainAttachNetDevice to multiqueue net

2013-05-20 Thread Laine Stump
On 05/16/2013 08:49 AM, Michal Privoznik wrote: > --- > src/qemu/qemu_hotplug.c | 96 > +++-- > 1 file changed, 61 insertions(+), 35 deletions(-) > > diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c > index 953339b..695edc7 100644 > --- a/

Re: [libvirt] [PATCH] vbox: fix VIR_STRDUP value check

2013-05-20 Thread Michal Privoznik
On 20.05.2013 11:59, Ján Tomko wrote: > In my review of 31532ca I missed the fact that VIR_STRDUP > now returns 1 on success, and 0 if the source was NULL. > > (This still doesn't add proper OOM error handling.) > --- > src/vbox/vbox_tmpl.c | 12 ++-- > 1 file changed, 6 insertions(+), 6

Re: [libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Ján Tomko
On 05/20/2013 03:49 PM, Michal Privoznik wrote: > On 20.05.2013 15:47, Michal Privoznik wrote: >> Currently, the openvzDomainSetNetwork function constructs an >> array of strings representing a command line for VZCTL binary. >> This is a overkill since our virCommand APIs can cover all the >> funct

Re: [libvirt] [libvirt-perl PATCH] interface: list active and inactive interface by default

2013-05-20 Thread Daniel P. Berrange
On Mon, May 20, 2013 at 09:44:46PM +0800, Guannan Ren wrote: > flags with 0 can not list interfaces, use flags in libvirt.h > by default to list all of active and inactive interfaces > > VIR_CONNECT_LIST_INTERFACES_INACTIVE = 1 << 0 > VIR_CONNECT_LIST_INTERFACES_ACTIVE = 1 << 1 > --- > Virt.x

Re: [libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Michal Privoznik
On 20.05.2013 15:47, Michal Privoznik wrote: > Currently, the openvzDomainSetNetwork function constructs an > array of strings representing a command line for VZCTL binary. > This is a overkill since our virCommand APIs can cover all the > functionality. Moreover, the function is not following our

[libvirt] [PATCH v2] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Michal Privoznik
Currently, the openvzDomainSetNetwork function constructs an array of strings representing a command line for VZCTL binary. This is a overkill since our virCommand APIs can cover all the functionality. Moreover, the function is not following our structure where return value is set to -1 initially,

[libvirt] [libvirt-perl PATCH] interface: list active and inactive interface by default

2013-05-20 Thread Guannan Ren
flags with 0 can not list interfaces, use flags in libvirt.h by default to list all of active and inactive interfaces VIR_CONNECT_LIST_INTERFACES_INACTIVE = 1 << 0 VIR_CONNECT_LIST_INTERFACES_ACTIVE = 1 << 1 --- Virt.xs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vir

Re: [libvirt] [PATCH v4] qemu: Add callback struct for qemuBuildCommandLine

2013-05-20 Thread Osier Yang
On 20/05/13 19:36, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 06:34:24PM +0800, Osier Yang wrote: Since 0d70656afded, it starts to access the sysfs files to build the qemu command line (by virSCSIDeviceGetSgName, which is to find out the scsi generic device name by adpater:bus:target:unit

Re: [libvirt] [PATCH v3 25/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/util/*

2013-05-20 Thread Michal Privoznik
On 20.05.2013 13:54, Ján Tomko wrote: > On 05/20/2013 01:40 PM, Michal Privoznik wrote: >> On 20.05.2013 13:07, Ján Tomko wrote: >>> On 05/03/2013 04:53 PM, Michal Privoznik wrote: 32 files changed, 356 insertions(+), 567 deletions(-) >>> >>> These functions returned 0 on success before and w

Re: [libvirt] [PATCH 5/5] storage_conf: Improve the coding style in storage_conf.h

2013-05-20 Thread Osier Yang
On 20/05/13 19:33, Daniel P. Berrange wrote: On Thu, May 16, 2013 at 08:40:54PM +0800, Osier Yang wrote: Changes: * Remove useless comments * Remove useless blank lines * If the struct member is a enum type, comment it like /* enum fooBar */ * Break the long lines * Prefer th

Re: [libvirt] [PATCH 2/5] storage_conf: Fix indentions in storage_conf.c

2013-05-20 Thread Osier Yang
On 20/05/13 19:27, Daniel P. Berrange wrote: On Thu, May 16, 2013 at 08:40:51PM +0800, Osier Yang wrote: Uses the 4 spaces for indention. --- src/conf/storage_conf.c | 176 1 file changed, 88 insertions(+), 88 deletions(-) ACK Pushed. --

Re: [libvirt] traffic control

2013-05-20 Thread Peter V. Saveliev
On 05/20/2013 11:21 AM, Daniel P. Berrange wrote: Yes, the choice language *today* does matter, because it impacts on the minimum install base size possible with libvirt. It also impacts on operational aspects becasue python is not a low footprint runtime from a memory POV, and not OOM friendly.

Re: [libvirt] [PATCH 1/5] storage_conf: Fix the coding stype in storage_conf.c

2013-05-20 Thread Osier Yang
On 20/05/13 19:26, Daniel P. Berrange wrote: On Thu, May 16, 2013 at 08:40:50PM +0800, Osier Yang wrote: >Changes: > * Remove the useless space in "for" statement (e.g. > for (i = 0 ; i < something ; i++) It would be pretty easy to extend build-aux/bracket-spacing.pl to validate correct w

Re: [libvirt] [PATCH 4/7] qemu: Abstract code for cpuset controller setting into a helper

2013-05-20 Thread Osier Yang
On 20/05/13 19:10, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 07:59:34PM +0800, Osier Yang wrote: --- src/qemu/qemu_cgroup.c | 73 -- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_c

Re: [libvirt] [PATCH 4/7] qemu: Abstract code for cpuset controller setting into a helper

2013-05-20 Thread Osier Yang
On 20/05/13 19:10, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 07:59:34PM +0800, Osier Yang wrote: --- src/qemu/qemu_cgroup.c | 73 -- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_c

Re: [libvirt] [PATCH 3/7] qemu: Abstract code for devices controller setting into a helper

2013-05-20 Thread Osier Yang
On 20/05/13 19:10, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 07:59:33PM +0800, Osier Yang wrote: --- src/qemu/qemu_cgroup.c | 195 +++-- 1 file changed, 107 insertions(+), 88 deletions(-) ACK Pushed. -- libvir-list mailing list libvir-l

Re: [libvirt] [PATCH v3 25/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/util/*

2013-05-20 Thread Ján Tomko
On 05/20/2013 01:40 PM, Michal Privoznik wrote: > On 20.05.2013 13:07, Ján Tomko wrote: >> On 05/03/2013 04:53 PM, Michal Privoznik wrote: >>> 32 files changed, 356 insertions(+), 567 deletions(-) >> >> These functions returned 0 on success before and will need to be adjusted >> since VIR_STRDUP r

Re: [libvirt] [PATCH v3 25/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/util/*

2013-05-20 Thread Michal Privoznik
On 20.05.2013 13:07, Ján Tomko wrote: > On 05/03/2013 04:53 PM, Michal Privoznik wrote: >> 32 files changed, 356 insertions(+), 567 deletions(-) > > These functions returned 0 on success before and will need to be adjusted > since VIR_STRDUP returns 1 on a successful copy now. I don't think so,

Re: [libvirt] [PATCH 5/5] storage_conf: Improve the coding style in storage_conf.h

2013-05-20 Thread Daniel P. Berrange
On Thu, May 16, 2013 at 08:40:54PM +0800, Osier Yang wrote: > Changes: > * Remove useless comments > * Remove useless blank lines > * If the struct member is a enum type, comment it like > /* enum fooBar */ > * Break the long lines > * Prefer the common function style for the inline f

Re: [libvirt] [PATCH v4] qemu: Add callback struct for qemuBuildCommandLine

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 06:34:24PM +0800, Osier Yang wrote: > Since 0d70656afded, it starts to access the sysfs files to build > the qemu command line (by virSCSIDeviceGetSgName, which is to find > out the scsi generic device name by adpater:bus:target:unit), there > is no way to work around, qemu

Re: [libvirt] [PATCH 2/7] qemu: Abstract code for memory controller setting into a helper

2013-05-20 Thread Osier Yang
On 20/05/13 19:08, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 07:59:32PM +0800, Osier Yang wrote: --- src/qemu/qemu_cgroup.c | 120 - 1 file changed, 68 insertions(+), 52 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_c

Re: [libvirt] [PATCH 4/5] storage_conf: Left fixes or improvements for storage_conf.c

2013-05-20 Thread Daniel P. Berrange
On Thu, May 16, 2013 at 08:40:53PM +0800, Osier Yang wrote: > virStorageVolDefParseXML: > * Create "virStorageVolDefPtr def", and use ret to track the > return value; frees the strings at "cleanup" label instead > of freeing them in the middle. > > virStorageVolDefFormat: > * Use macro

Re: [libvirt] [PATCH 3/5] storage_conf: Various fixes or improvements on pool def parsing

2013-05-20 Thread Daniel P. Berrange
On Thu, May 16, 2013 at 08:40:52PM +0800, Osier Yang wrote: > virStorageDefParsePerms: > * Use uid_t/gid_t to do casting Bug fix > > virStoragePoolDefParseSource: > * Improve the error message for source "name" parsing > * Remove the useless casting (const char *) > > virStoragePoolDefPar

Re: [libvirt] [PATCH 1/5] storage_conf: Fix the coding stype in storage_conf.c

2013-05-20 Thread Daniel P. Berrange
On Thu, May 16, 2013 at 08:40:50PM +0800, Osier Yang wrote: > Changes: > * Remove the useless space in "for" statement (e.g. > for (i = 0 ; i < something ; i++) It would be pretty easy to extend build-aux/bracket-spacing.pl to validate correct whitespace around the ';' in for loops. > >

Re: [libvirt] [PATCH 2/5] storage_conf: Fix indentions in storage_conf.c

2013-05-20 Thread Daniel P. Berrange
On Thu, May 16, 2013 at 08:40:51PM +0800, Osier Yang wrote: > Uses the 4 spaces for indention. > --- > src/conf/storage_conf.c | 176 > > 1 file changed, 88 insertions(+), 88 deletions(-) ACK Daniel -- |: http://berrange.com -o-http://

Re: [libvirt] [PATCH 1/7] qemu: Abstract the code for blkio controller setting into a helper

2013-05-20 Thread Osier Yang
On 20/05/13 19:06, Daniel P. Berrange wrote: On Fri, May 17, 2013 at 07:59:31PM +0800, Osier Yang wrote: --- src/qemu/qemu_cgroup.c | 90 -- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_c

Re: [libvirt] [PATCH 6/7] qemu: Set cpuset.cpus for domain process

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:36PM +0800, Osier Yang wrote: > When either "cpuset" of is specified, or the "placement" of > is "auto", only setting the cpuset.mems might cause the guest > starting to fail. E.g. ("placement" of both and is > "auto"): > > 1) Related XMLs > 4 > > > >

Re: [libvirt] [PATCH 5/7] qemu: Abstract code for the cpu controller setting into a helper

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:35PM +0800, Osier Yang wrote: > --- > src/qemu/qemu_cgroup.c | 63 > ++ > 1 file changed, 38 insertions(+), 25 deletions(-) > > diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c > index 8f84ef9..8a2cc9d 1006

Re: [libvirt] [PATCH 4/7] qemu: Abstract code for cpuset controller setting into a helper

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:34PM +0800, Osier Yang wrote: > --- > src/qemu/qemu_cgroup.c | 73 > -- > 1 file changed, 47 insertions(+), 26 deletions(-) > > diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c > index 1e8afb1..8f84ef9 1006

Re: [libvirt] [PATCH 3/7] qemu: Abstract code for devices controller setting into a helper

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:33PM +0800, Osier Yang wrote: > --- > src/qemu/qemu_cgroup.c | 195 > +++-- > 1 file changed, 107 insertions(+), 88 deletions(-) ACK Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :

Re: [libvirt] [PATCH v3 25/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/util/*

2013-05-20 Thread Ján Tomko
On 05/03/2013 04:53 PM, Michal Privoznik wrote: > 32 files changed, 356 insertions(+), 567 deletions(-) These functions returned 0 on success before and will need to be adjusted since VIR_STRDUP returns 1 on a successful copy now. > diff --git a/src/util/viridentity.c b/src/util/viridentity.c >

Re: [libvirt] [PATCH 2/7] qemu: Abstract code for memory controller setting into a helper

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:32PM +0800, Osier Yang wrote: > --- > src/qemu/qemu_cgroup.c | 120 > - > 1 file changed, 68 insertions(+), 52 deletions(-) > > diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c > index 0c4792e..2751be0 1006

Re: [libvirt] [PATCH 1/7] qemu: Abstract the code for blkio controller setting into a helper

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 07:59:31PM +0800, Osier Yang wrote: > --- > src/qemu/qemu_cgroup.c | 90 > -- > 1 file changed, 50 insertions(+), 40 deletions(-) > > diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c > index 9784f31..0c4792e 1006

Re: [libvirt] [PATCH 2/3] LXC: fix memory leak in virLXCControllerSetupDevPTS

2013-05-20 Thread Daniel P. Berrange
On Mon, May 20, 2013 at 06:12:18PM +0800, Gao feng wrote: > We forgot to free the mount_options. > > Signed-off-by: Gao feng > --- > src/lxc/lxc_controller.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c > index 2f01958..e311f38 100

Re: [libvirt] [PATCH 1/3] LXC: remove unnecessary check on root filesystem

2013-05-20 Thread Daniel P. Berrange
On Mon, May 20, 2013 at 06:12:17PM +0800, Gao feng wrote: > After commit c131525bec5af248e3843224bc5ce8d6435760f0 > "Auto-add a root element to LXC containers on startup" > for libvirt lxc, root must be existent. > > Signed-off-by: Gao feng > --- > src/lxc/lxc_container.c | 18 +++-

Re: [libvirt] [PATCH 3/3] LXC: move the comments to the proper place

2013-05-20 Thread Daniel P. Berrange
On Mon, May 20, 2013 at 06:12:19PM +0800, Gao feng wrote: > The comments is for virLXCControllerSetupPrivateNS. > > Signed-off-by: Gao feng > --- > src/lxc/lxc_controller.c | 41 + > 1 file changed, 21 insertions(+), 20 deletions(-) > > diff --git a/src/l

[libvirt] [PATCH 3/3] LXC: move the comments to the proper place

2013-05-20 Thread Gao feng
The comments is for virLXCControllerSetupPrivateNS. Signed-off-by: Gao feng --- src/lxc/lxc_controller.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index e311f38..b3fc598 1006

[libvirt] [PATCH 2/3] LXC: fix memory leak in virLXCControllerSetupDevPTS

2013-05-20 Thread Gao feng
We forgot to free the mount_options. Signed-off-by: Gao feng --- src/lxc/lxc_controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 2f01958..e311f38 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1353,6

[libvirt] [PATCH 1/3] LXC: remove unnecessary check on root filesystem

2013-05-20 Thread Gao feng
After commit c131525bec5af248e3843224bc5ce8d6435760f0 "Auto-add a root element to LXC containers on startup" for libvirt lxc, root must be existent. Signed-off-by: Gao feng --- src/lxc/lxc_container.c | 18 +++--- src/lxc/lxc_controller.c | 11 --- 2 files changed, 7 insert

[libvirt] [PATCH] vbox: fix VIR_STRDUP value check

2013-05-20 Thread Ján Tomko
In my review of 31532ca I missed the fact that VIR_STRDUP now returns 1 on success, and 0 if the source was NULL. (This still doesn't add proper OOM error handling.) --- src/vbox/vbox_tmpl.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/sr

Re: [libvirt] two nasty races

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 10:05:25PM -0600, Eric Blake wrote: > I found root cause on two nasty races today, but ran out of time to > write the patches until next week. > > 1. We have a TOCTTOU race when moving processes between cgroups. > virCgroupMoveTask can fail if listing the threads in the par

Re: [libvirt] traffic control

2013-05-20 Thread Daniel P. Berrange
On Fri, May 17, 2013 at 08:04:30PM +0200, Peter V. Saveliev wrote: > On 05/17/2013 07:06 PM, Daniel P. Berrange wrote: > > > > The idea of handing off this to an external python daemon isn't > > really very appealing to me, because I don't really like libvirt > > core functionality depending on a

Re: [libvirt] [PATCH] openvzDomainSetNetwork: use virCommand

2013-05-20 Thread Ján Tomko
On 05/19/2013 11:52 AM, Michal Privoznik wrote: > Currently, the openvzDomainSetNetwork function constructs an > array of strings representing a command line for VZCTL binary. > This is a overkill since our virCommand APIs can cover all the > functionality. > --- > src/openvz/openvz_driver.c | 56