[libvirt] [PATCH] conf: Fix virtType check

2015-09-25 Thread John Ferlan
Commit id '7383b8cc' changed virDomainDef 'virtType' to an enum, that caused a build failure on some archs due to comparing an unsigned value to < 0. Adjust the fetch of 'type' to be into temporary 'int virtType' and then assign that virtType to the def->virtType Signed-off-by: John Ferlan --- P

Re: [libvirt] [PATCH] Remove unused variables.

2015-09-25 Thread Martin Kletzander
On Fri, Sep 25, 2015 at 02:21:52PM -0600, Eric Blake wrote: On 09/24/2015 01:35 AM, Martin Kletzander wrote: I was playing with coccinelle tool the other day and just for the fun of it, I tried removing some useless things from our code. And look what came up. No functional change, and we're d

Re: [libvirt] [PATCH] virsh: Preserve startupPolicy in change-media command

2015-09-25 Thread John Ferlan
On 09/24/2015 12:05 PM, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1250331 > > Even after my rework of startupPolicy handling, one command > slipped my attention. The change-media command has a very unique > approach to constructing disk XML. However, it will not prese

Re: [libvirt] [PATCH 0/2] Update pool allocation with new values on volume creation

2015-09-25 Thread John Ferlan
On 09/24/2015 11:15 AM, Ján Tomko wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1163091 > > Ján Tomko (2): > Update pool allocation with new values on volume creation > Create a shallow copy for volume building only if supported > > src/storage/storage_driver.c | 38

Re: [libvirt] [PATCH] Remove unused variables.

2015-09-25 Thread Eric Blake
On 09/24/2015 01:35 AM, Martin Kletzander wrote: > I was playing with coccinelle tool the other day and just for the fun of > it, I tried removing some useless things from our code. And look what > came up. No functional change, and we're down in the number of lines by > about a hundred. It woul

Re: [libvirt] [PATCH] Remove unused variables.

2015-09-25 Thread John Ferlan
On 09/24/2015 03:35 AM, Martin Kletzander wrote: > I was playing with coccinelle tool the other day and just for the fun of > it, I tried removing some useless things from our code. And look what > came up. No functional change, and we're down in the number of lines by > about a hundred. > > S

Re: [libvirt] [PATCH 0/3] Introduce new virtType enum item

2015-09-25 Thread John Ferlan
On 09/17/2015 04:46 AM, Shivangi Dhir wrote: > These patches solve a BiteSizedTask - Introduce new virtType enum item[0] > > [0] > http://wiki.libvirt.org/page/BiteSizedTasks#Introduce_new_virtType_enum_item > > Shivangi Dhir (3): > conf: Add new VIR_DOMAIN_VIRT_NONE enum > qemu: Make virt

Re: [libvirt] [PATCH 0/4] improve virConnectListAllInterfaces()

2015-09-25 Thread Laine Stump
On 09/25/2015 01:27 PM, Daniel P. Berrange wrote: So, I instrumented the netcf and augeas code to checking timings. The aug_get calls time less than a millisecond, as do the various other calls. I found the bulk of the time is actually coming from the netcf function "get_augeas", which in turns

Re: [libvirt] [PATCH 0/4] improve virConnectListAllInterfaces()

2015-09-25 Thread Laine Stump
On 09/25/2015 01:27 PM, Daniel P. Berrange wrote: On Fri, Sep 25, 2015 at 05:22:30PM +0100, Daniel P. Berrange wrote: On Fri, Sep 25, 2015 at 11:13:52AM -0400, Laine Stump wrote: There's a bit of background about this here: https://www.redhat.com/archives/augeas-devel/2015-September/msg1.h

Re: [libvirt] [PATCH 0/4] improve virConnectListAllInterfaces()

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 05:22:30PM +0100, Daniel P. Berrange wrote: > On Fri, Sep 25, 2015 at 11:13:52AM -0400, Laine Stump wrote: > > There's a bit of background about this here: > > > > https://www.redhat.com/archives/augeas-devel/2015-September/msg1.html > > > > In short, virt-manager is c

Re: [libvirt] [PATCH 0/2] Add support for gic-version machine option

2015-09-25 Thread Martin Kletzander
On Fri, Sep 25, 2015 at 05:46:22PM +0300, Pavel Fedin wrote: qemu now supports gic-version option for the virt machine. This patch allows to use it in libvirt. I decided not to add a new capability because qemu correctly complains by itself if it does not have this option. It's nice that QEMU

[libvirt] [PATCH v2 3/6] libxl: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
Since the strtok_r call in libxlCapsInitGuests expects a non NULL first parameter when the third parameter is NULL, we need to check that the returned 'capabilities' from a libxl_get_version_info call is not NULL and error out if so since the code expects it. Signed-off-by: John Ferlan --- src/l

[libvirt] [PATCH v2 0/6] Fix some Coverity issues

2015-09-25 Thread John Ferlan
This series is based off the review of patch 1 from the series: http://www.redhat.com/archives/libvir-list/2015-September/msg00841.html In review of patch 1: http://www.redhat.com/archives/libvir-list/2015-September/msg00859.html it was noted that instead of using sa_assert, the proper checks s

[libvirt] [PATCH v2 4/6] esx: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
Coverity complains that strtok_r cannot be called if the first and third parameters are NULL. On entry, the 'path' parameter is not checked for being NULL before the VIR_STRDUP which will set the target to NULL if the source (eg path) is NULL. Thus add a check for NULL path. NB: Checks were made

[libvirt] [PATCH v2 5/6] qemu: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
Coverity notices that net->ifname is potentially referenced after a VIR_FREE(). Looking through history, the vport check code was added by commit id 'df8100463' and later augmented by commit id 'd490f47b'. The data is allocated via virNetDevMacVLanCreateWithVPortProfile, so it is reasonable that i

[libvirt] [PATCH v2 6/6] xenapi: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
Coverity flagged that if the input 'mask'parameter was NULL, then the strtok_r call would have a NULL first and third parameter, which would cause an issue. Although the caller doesn't call getCpuBitMapfromString with a non-NULL mask value, Coverity doesn't check that. A fix could have been to che

[libvirt] [PATCH v2 2/6] openvz: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
Coverity complains that strtok_r cannot be called if the first and third parameters are NULL. On entry if the 'value' parameter is not checked for being NULL before the VIR_STRDUP which will set the target to NULL if the source (eg value) is NULL. Thus add a check for NULL value. NB: Although eac

[libvirt] [PATCH v2 1/6] openvz: Resolve Coverity FORWARD_NULL

2015-09-25 Thread John Ferlan
In openvzGetVPSUUID while parsing the conf_file, if "line" is for some reason returned as NULL from a getline() call with a successful status, then the subsequent call to strtok_r would attempt to reference the 'saveptr' which was initialized to NULL leading to an issue. Altough getline() claims i

Re: [libvirt] [PATCH 3/4] interface: re-use name and mac address rather than re-retrieving

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 11:13:55AM -0400, Laine Stump wrote: > Getting the MAC address of an interface is actually fairly expensive, > and we've already gotten it and stored it into def, so just keep def > around a bit longer and retrieve it from there. > > This reduces the time for "virsh iface-l

Re: [libvirt] [PATCH 4/4] interface: let netcf pre-filter for active vs. inactive

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 11:13:56AM -0400, Laine Stump wrote: > If a system has a large number of active or active interfaces, it can s/active/inactive/ for one of them presuambly. > be a big waste of time to retrieve and qualify all interfaces if the > caller only wanted one subset. Since netcf h

Re: [libvirt] [PATCH 2/4] interface: report correct interface count when not returning list

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 11:13:54AM -0400, Laine Stump wrote: > The spec for virConnectListAllInterfaces says that if the pointer that > is supposed to hold the list of interfaces is NULL, the function > should just return the count of interfaces that matched the filter, > but the code never increme

Re: [libvirt] [PATCH 0/4] improve virConnectListAllInterfaces()

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 11:13:52AM -0400, Laine Stump wrote: > There's a bit of background about this here: > > https://www.redhat.com/archives/augeas-devel/2015-September/msg1.html > > In short, virt-manager is calling the virInterface APIs and that ties > up a libvirt thread (and CPU core)

Re: [libvirt] [PATCH 1/4] interface: fail on OOM from virGetInterface()

2015-09-25 Thread Daniel P. Berrange
On Fri, Sep 25, 2015 at 11:13:53AM -0400, Laine Stump wrote: > --- > src/interface/interface_backend_netcf.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) ACK Regards, Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org

[libvirt] [PATCH 0/4] improve virConnectListAllInterfaces()

2015-09-25 Thread Laine Stump
There's a bit of background about this here: https://www.redhat.com/archives/augeas-devel/2015-September/msg1.html In short, virt-manager is calling the virInterface APIs and that ties up a libvirt thread (and CPU core) for a very long time on hosts that have a large number of interfaces. The

[libvirt] [PATCH 3/4] interface: re-use name and mac address rather than re-retrieving

2015-09-25 Thread Laine Stump
Getting the MAC address of an interface is actually fairly expensive, and we've already gotten it and stored it into def, so just keep def around a bit longer and retrieve it from there. This reduces the time for "virsh iface-list --all" from 28 to 23 seconds when there are 400 interfaces. --- sr

[libvirt] [PATCH 2/4] interface: report correct interface count when not returning list

2015-09-25 Thread Laine Stump
The spec for virConnectListAllInterfaces says that if the pointer that is supposed to hold the list of interfaces is NULL, the function should just return the count of interfaces that matched the filter, but the code never increments the count if the list pointer is NULL. --- src/interface/interfa

[libvirt] [PATCH 1/4] interface: fail on OOM from virGetInterface()

2015-09-25 Thread Laine Stump
--- src/interface/interface_backend_netcf.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index 947f1e2..9f74541 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/

[libvirt] [PATCH 4/4] interface: let netcf pre-filter for active vs. inactive

2015-09-25 Thread Laine Stump
If a system has a large number of active or active interfaces, it can be a big waste of time to retrieve and qualify all interfaces if the caller only wanted one subset. Since netcf has a simple flag for this, translate the libvirt flag into a netcf flag and let netcf pre-filter. --- src/interface

Re: [libvirt] [PATCH v2] lxc: fuse mount for /proc/cpuinfo

2015-09-25 Thread Serge Hallyn
Quoting Daniel P. Berrange (berra...@redhat.com): > On Thu, Sep 24, 2015 at 03:53:24PM +, Serge Hallyn wrote: > > Quoting Daniel P. Berrange (berra...@redhat.com): > > > On Thu, Sep 24, 2015 at 02:41:49PM +, Serge Hallyn wrote: > > > > Quoting Fabio Kung (fabio.k...@gmail.com): > > > > > On

[libvirt] [PATCH 1/2] qemu: Add support for gic-version machine option

2015-09-25 Thread Pavel Fedin
Support for GICv3 has been recently introduced in qemu using gic-version option for the 'virt' machine. The option can actually take values of '2', '3' and 'host', however, since in libvirt this is a numeric parameter, we limit it only to 2 and 3. Value of 2 is not added to the command line in orde

[libvirt] [PATCH 0/2] Add support for gic-version machine option

2015-09-25 Thread Pavel Fedin
qemu now supports gic-version option for the virt machine. This patch allows to use it in libvirt. I decided not to add a new capability because qemu correctly complains by itself if it does not have this option. Pavel Fedin (2): qemu: Add support for gic-version machine option qemu: Add test

[libvirt] [PATCH 2/2] qemu: Add test case for gic-version option

2015-09-25 Thread Pavel Fedin
Signed-off-by: Pavel Fedin --- .../qemuxml2argv-aarch64-gicv3.args| 6 + .../qemuxml2argv-aarch64-gicv3.xml | 26 ++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 tests/qem

Re: [libvirt] [PATCH] Use daemon log facility for journald

2015-09-25 Thread Guido Günther
Hi, On Thu, Sep 24, 2015 at 08:31:00AM +0200, Ján Tomko wrote: > On Wed, Sep 23, 2015 at 08:13:02PM +0200, Guido Günther wrote: > > otherwise messages end up in /var/log/kern.log if journald forwards to > > syslog. > > > > Closes: #799633 > > Please use the full URL: > https://bugs.debian.org/cgi

Re: [libvirt] [PATCH v3 04/14] migration: remove direct migration dependency on version1 of driver

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:42 +0300, Nikolay Shirokovskiy wrote: > From: Michal Privoznik > > Direct migration should work if *perform3 is present but *perform > is not. This is situation when driver migration is implemented > after new version of driver function is introduced. We should not >

Re: [libvirt] [PATCH v3 05/14] migration: refactor: rename uri parameter to miguri

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:43 +0300, Nikolay Shirokovskiy wrote: > We use miguri name for this parameter in other places. So > make naming more consitent. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/libvirt-domain.c | 12 ++-- > 1 files changed, 6 insertions(+), 6 deletions(

Re: [libvirt] [PATCH v3 07/14] migration: refactor: introduce params version of unmanaged

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:45 +0300, Nikolay Shirokovskiy wrote: > Let's put main functionality into params version of virDomainMigrateUnmanaged > as a preparation step for merging it with virDomainMigratePeer2PeerParams. > virDomainMigrateUnmanaged then does nothing more then just adapting argu

Re: [libvirt] [PATCH 2/3] Qemu: add CMT support

2015-09-25 Thread Ren, Qiaowei
> -Original Message- > From: libvir-list-boun...@redhat.com [mailto:libvir-list-boun...@redhat.com] > On Behalf Of Ren, Qiaowei > Sent: Monday, August 10, 2015 9:06 AM > To: 'Daniel P. Berrange' > Cc: 'libvir-list@redhat.com' > Subject: Re: [libvirt] [PATCH 2/3] Qemu: add CMT support > >

Re: [libvirt] [PATCH v3 06/14] migration: refactor: merge direct and p2p into unmanaged

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:44 +0300, Nikolay Shirokovskiy wrote: > p2p plain and direct function are good candidates for code reuse. Their main > function is same - to branch among different versions of migration protocol > and > implementation of this function is also same. Also they have othe

Re: [libvirt] [PATCH v3 01/14] migration: refactor: get rid of use_params p2p_full

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:39 +0300, Nikolay Shirokovskiy wrote: > 'useParams' parameter usage is an example of control coupling. Most of the > work > inside the function is done differently except for the uri check. Lets split > this function into two, one with extensible parameters set and on

Re: [libvirt] [PATCH v3 03/14] migration: move implementation check to branches in p2p

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:41 +0300, Nikolay Shirokovskiy wrote: > This is more structured code so it will be easier to add branch for _PARAMS > protocol here. It is not a pure refactoring strictly speaking as we remove > scenarios for broken cases when driver defines V3 feature and implements >

Re: [libvirt] [PATCH v3 02/14] migration: refactor: reuse p2p url check

2015-09-25 Thread Jiri Denemark
On Fri, Sep 18, 2015 at 18:05:40 +0300, Nikolay Shirokovskiy wrote: > Refactor dconnuri local server URI check to common API. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/libvirt-domain.c | 44 > 1 files changed, 24 insertions(+), 20 deletion

Re: [libvirt] [PATCH] qemuDomainAttachDeviceLive: Check provided disk address

2015-09-25 Thread Martin Kletzander
On Fri, Sep 25, 2015 at 06:41:44AM -0400, John Ferlan wrote: On 09/25/2015 05:38 AM, Michal Privoznik wrote: On 25.09.2015 11:36, Martin Kletzander wrote: On Thu, Sep 24, 2015 at 05:43:08PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1257844 Imagine an user wh

Re: [libvirt] [FIRST-PATCH] updated the negation STREQ to STRNEQ

2015-09-25 Thread Michal Privoznik
On 24.09.2015 15:11, Lasya Venneti wrote: > Dear Sir, > The cfg.mk link isn't working for me sir.. > From what I understand Makefile will have the following: > > target: dependency1 dependency2 ... > [TAB] action1 > [TAB] action2 > > Does the syntax-check rule have to be in place of 'actions' in

Re: [libvirt] [PATCH] tools: Link libvirt.la to libvirt_shell.a

2015-09-25 Thread Erik Skultety
On 25/09/15 13:38, Michal Privoznik wrote: > So, our mingw build is broken. It's because while libvirt_shell > library is using some of our internal APIs, e.g. virStrndup, it's > not being linked with libvirt.la. Only subsequent users of the > library, like virsh, do link to libvirt.la. In fact, I'

[libvirt] [PATCH] tools: Link libvirt.la to libvirt_shell.a

2015-09-25 Thread Michal Privoznik
So, our mingw build is broken. It's because while libvirt_shell library is using some of our internal APIs, e.g. virStrndup, it's not being linked with libvirt.la. Only subsequent users of the library, like virsh, do link to libvirt.la. In fact, I'm surprised Linux linker doesn't care, because how

Re: [libvirt] [PATCH] add compress stream support

2015-09-25 Thread Vasiliy Tolstov
2015-09-25 14:30 GMT+03:00 Vasiliy Tolstov : > Also as i see in case ofr strage pool - dir, and image file layout on > disk, fdstream used only to OpenInternal with libvirt iohelper, after > that no fdstream Read/Write function used =(. My fail =(. When libvirt gets VolDownload fdstream uses Read

Re: [libvirt] [PATCH] add compress stream support

2015-09-25 Thread Vasiliy Tolstov
2015-09-25 12:39 GMT+03:00 Vasiliy Tolstov : > I have a problems with enabling compression in fdstream. In my case > use pass flag to VolDownload, in storage_driver i don't have ability > to access privateData of the stream, so i need to create additional > variable in stream struct ? > Or i miss s

Re: [libvirt] [PATCH] qemuDomainAttachDeviceLive: Check provided disk address

2015-09-25 Thread John Ferlan
On 09/25/2015 05:38 AM, Michal Privoznik wrote: > On 25.09.2015 11:36, Martin Kletzander wrote: >> On Thu, Sep 24, 2015 at 05:43:08PM +0200, Michal Privoznik wrote: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1257844 >>> >>> Imagine an user who is trying to attach a disk to a domain with >>>

Re: [libvirt] [PATCH] qemuDomainAttachDeviceLive: Check provided disk address

2015-09-25 Thread Michal Privoznik
On 25.09.2015 11:36, Martin Kletzander wrote: > On Thu, Sep 24, 2015 at 05:43:08PM +0200, Michal Privoznik wrote: >> https://bugzilla.redhat.com/show_bug.cgi?id=1257844 >> >> Imagine an user who is trying to attach a disk to a domain with >> the following XML: >> >> >> >> >> >> >>

Re: [libvirt] [PATCH] add compress stream support

2015-09-25 Thread Vasiliy Tolstov
2015-09-23 16:18 GMT+03:00 Daniel P. Berrange : > nstead pass flags to the virStorageVolDownload/Upload functions, > eg VIR_STORAGE_VOL_STREAM_COMPRESS_ZLIB. This flag would get passed > across to the storage driver, which can then turn on compression in > the virFDStream impl. This would require >

Re: [libvirt] [PATCH] qemuDomainAttachDeviceLive: Check provided disk address

2015-09-25 Thread Martin Kletzander
On Thu, Sep 24, 2015 at 05:43:08PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1257844 Imagine an user who is trying to attach a disk to a domain with the following XML: The XML is obviously wrong. It's trying to attach a virtio disk onto non-

[libvirt] [PATCH] docs: event impl. registration before hypervisor connection

2015-09-25 Thread Dominik Perpeet
Event implementations need to be registered before a connection to the Hypervisor is opened, otherwise event handling can be impaired (e.g. delayed messages). This fact is referenced in an e-mail [1], but should also be noted in the documentation of the registration functions. [1] https://www.redh

Re: [libvirt] [PATCH] maint: Remove control characters from LGPL license file

2015-09-25 Thread Andrea Bolognani
On Thu, 2015-09-24 at 19:03 +0200, Pavel Hrdina wrote: > On Thu, Jun 11, 2015 at 03:15:19PM +0200, Andrea Bolognani wrote: > > --- > > COPYING.LESSER | 18 +- > > 1 file changed, 9 insertions(+), 9 deletions(-) > > > > ACK :) Oh, I had completely forgotten about this one! :) Tu