Re: [libvirt] [PATCH] test driver: don't unlock pool after freeing it

2015-09-16 Thread Peter Krempa
On Wed, Sep 16, 2015 at 17:14:28 -0400, David Mansfield wrote: > The attached patch (taken from my modified Fedora 22 source rpm, > 1.2.13.1-2.fc22, sorry), fixes a case where, in the test driver, memory > is accessed after it's freed. > > Patch applies to latest git with: > > Hunk #1 succeede

[libvirt] [PATCH] libxl: fix AttachDeviceConfig on hostdev type

2015-09-16 Thread Chunyan Liu
After attach-device a with --config, new device doesn't show up in dumpxml and in guest. To fix that, set dev->data.hostdev = NULL after work so that the pointer is not freed, since vmdef has the pointer and still need it. Signed-off-by: Chunyan Liu --- src/libxl/libxl_driver.c | 1 + 1 file c

[libvirt] [PATCH] libxl: fix AttachDeviceConfig on hostdev type

2015-09-16 Thread Chunyan Liu
After attach-device a with --config, new device doesn't show up in dumpxml and in guest. To fix that, set dev->data.hostdev = NULL after work so that the pointer is not freed, since vmdef has the pointer and still need it. Signed-off-by: Chunyan Liu --- src/libxl/libxl_driver.c | 1 + 1 file c

Re: [libvirt] [PATCH v3] qemu: Validate address type when attaching a disk device.

2015-09-16 Thread Ruifeng Bian
- Original Message - > From: "Michal Privoznik" > To: "Ruifeng Bian" , libvir-list@redhat.com > Sent: Wednesday, September 16, 2015 11:32:27 PM > Subject: Re: [libvirt] [PATCH v3] qemu: Validate address type when attaching > a disk device. > > On 09.09.2015 13:17, Ruifeng Bian wrote: >

Re: [libvirt] [PATCH RFC 1/7] libxl: implement virDomainGetCPUStats

2015-09-16 Thread Jim Fehlig
On 09/08/2015 02:27 AM, Joao Martins wrote: Introduce support for domainGetCPUStats API call and consequently allow us to use `virsh cpu-stats`. The latter returns a more brief output than the one provided by`virsh vcpuinfo`. Signed-off-by: Joao Martins --- src/libxl/libxl_driver.c | 111

Re: [libvirt] [PATCH v2 05/12] migration: refactor: merge direct and p2p into unmanaged

2015-09-16 Thread John Ferlan
Of course I sent it too quick - one extra note... [ ... snip... ] > /** > * virDomainMigrate: > * @domain: a domain object > @@ -3594,8 +3532,8 @@ virDomainMigrate(virDomainPtr domain, > } > > VIR_DEBUG("Using peer2peer migration"); > -if (virDomainM

Re: [libvirt] [PATCH v2 05/12] migration: refactor: merge direct and p2p into unmanaged

2015-09-16 Thread John Ferlan
On 09/10/2015 09:20 AM, 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 other common > fun

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

2015-09-16 Thread John Ferlan
On 09/10/2015 09:20 AM, 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 > be forced to

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

2015-09-16 Thread John Ferlan
On 09/10/2015 09:20 AM, 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 > perform funct

Re: [libvirt] [PATCH v2 02/12] migration: refactor: reuse p2p url check

2015-09-16 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > As promised in previous patch. Update commit message to say what's being done from patch 1: "Common uri check we factor out in different patch for clarity." Or for me ;-) "Refactor dconnuri local server URI check to common API" > > Sign

Re: [libvirt] [PATCH v2 01/12] migration: refactor: get rid of use_params p2p_full

2015-09-16 Thread John Ferlan
FWIW: I figured I'd at least take a look - it's not my area of expertise though. I also ran the changes through my Coverity checker. The first pass found an issue in patch 10, which seems to be a result of some changes in patch 2 and perhaps patch 3... On 09/10/2015 09:20 AM, Nikolay Shirokovski

[libvirt] [PATCH] test driver: don't unlock pool after freeing it

2015-09-16 Thread David Mansfield
The attached patch (taken from my modified Fedora 22 source rpm, 1.2.13.1-2.fc22, sorry), fixes a case where, in the test driver, memory is accessed after it's freed. Patch applies to latest git with: Hunk #1 succeeded at 4395 (offset -469 lines). The illegal access was found using valgrind.

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

2015-09-16 Thread Serge Hallyn
Quoting Daniel P. Berrange (berra...@redhat.com): > On Wed, Sep 16, 2015 at 03:15:52PM +, Serge Hallyn wrote: > > Quoting Fabio Kung (fabio.k...@gmail.com): > > > On Mon, Sep 7, 2015 at 8:55 AM, Serge Hallyn > > > wrote: > > > > > > > > Ah, my memory was failing me, so took a bit of searching

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

2015-09-16 Thread Daniel P. Berrange
On Wed, Sep 16, 2015 at 03:15:52PM +, Serge Hallyn wrote: > Quoting Fabio Kung (fabio.k...@gmail.com): > > On Mon, Sep 7, 2015 at 8:55 AM, Serge Hallyn > > wrote: > > > > > > Ah, my memory was failing me, so took a bit of searching, but > > > > > > http://fabiokung.com/2014/03/13/memory-insid

Re: [libvirt] [PATCH v3] qemu: Validate address type when attaching a disk device.

2015-09-16 Thread Michal Privoznik
On 09.09.2015 13:17, Ruifeng Bian wrote: > Bug fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1257844 > > Attach-device can hotplug a virtio disk device with any address type now, > it need to validate the address type before the attachment. > > Attaching a disk device with --config option

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

2015-09-16 Thread Serge Hallyn
Quoting Fabio Kung (fabio.k...@gmail.com): > On Mon, Sep 7, 2015 at 8:55 AM, Serge Hallyn wrote: > > > > Ah, my memory was failing me, so took a bit of searching, but > > > > http://fabiokung.com/2014/03/13/memory-inside-linux-containers/ > > > > I can't find anything called 'libmymem', and in 201

Re: [libvirt] [PATCH v2] virfile: Check for existence of dir in virFileDeleteTree

2015-09-16 Thread Martin Kletzander
On Wed, Sep 16, 2015 at 10:01:46AM -0400, John Ferlan wrote: Commit id 'f1f68ca33' added code to remove the directory paths for auto-generated sockets, but that code could be called before the paths were created resulting in generating error messages from virFileDeleteTree indicating that the fil

[libvirt] [PATCH v2] virfile: Check for existence of dir in virFileDeleteTree

2015-09-16 Thread John Ferlan
Commit id 'f1f68ca33' added code to remove the directory paths for auto-generated sockets, but that code could be called before the paths were created resulting in generating error messages from virFileDeleteTree indicating that the file doesn't exist. Rather than "enforce" all callers to make the

Re: [libvirt] [PATCH] qemu: Check for existence of auto-generated socket path before removing

2015-09-16 Thread John Ferlan
On 09/16/2015 09:05 AM, Michal Privoznik wrote: > On 15.09.2015 23:03, John Ferlan wrote: >> Commit id 'f1f68ca33' added code to remove the directory paths for >> auto-generated sockets, but that code could be called before the >> paths were created resulting in generating error messages from >>

Re: [libvirt] [PATCH v2] virsh: Teach attach-interface to --print-xml

2015-09-16 Thread John Ferlan
On 09/10/2015 04:31 AM, Michal Privoznik wrote: > We have the same argument to many other commands that produce an > XML based on what user typed. But unfortunately attach-interface > was missing it. Maybe nobody had needed it yet. Well, I did > just now. > > Signed-off-by: Michal Privoznik > -

Re: [libvirt] [PATCH] qemu: Check for existence of auto-generated socket path before removing

2015-09-16 Thread Michal Privoznik
On 15.09.2015 23:03, John Ferlan wrote: > Commit id 'f1f68ca33' added code to remove the directory paths for > auto-generated sockets, but that code could be called before the > paths were created resulting in generating error messages from > virFileDeleteTree indicating that the file doesn't exist

Re: [libvirt] [PATCH] qemu: Check for existence of auto-generated socket path before removing

2015-09-16 Thread Martin Kletzander
On Tue, Sep 15, 2015 at 05:03:45PM -0400, John Ferlan wrote: Commit id 'f1f68ca33' added code to remove the directory paths for auto-generated sockets, but that code could be called before the paths were created resulting in generating error messages from virFileDeleteTree indicating that the fil

Re: [libvirt] VMware: Map vpx:// to dcPath

2015-09-16 Thread Richard W.M. Jones
On Fri, Sep 11, 2015 at 03:55:03PM +0200, Matthias Bolte wrote: > 2015-09-07 22:04 GMT+02:00 Richard W.M. Jones : > > On Mon, Sep 07, 2015 at 02:29:22PM +0200, Matthias Bolte wrote: > >> I think the datacenter path could be exposed > >> as part of the domain XML as > >> /path/to/dc similar to > >>

[libvirt] [PATCH v2 0/7] Allow startupPolicy change on update-device

2015-09-16 Thread Michal Privoznik
So, as Peter pointed out, we may want to updated startupPolicy for live domains too. That's what patches 2/7-7/7 do. Michal Privoznik (7): qemuDomainUpdateDeviceConfig: Allow startupPolicy update, yet again qemu: s/qemuDomainChangeDiskMediaLive/qemuDomainChangeDiskLive/ qemu_domain: Introduc

[libvirt] [PATCH v2 2/7] qemu: s/qemuDomainChangeDiskMediaLive/qemuDomainChangeDiskLive/

2015-09-16 Thread Michal Privoznik
While we currently only allow changing a media in a disk, this is going to change in a while, so the function name would be invalid. Moreover, the old name does not match the pattern laid out by other update functions. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 12 ++--

[libvirt] [PATCH v2 7/7] qemuDomainChangeDiskLive: Allow startupPolicy change

2015-09-16 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 1 - src/qemu/qemu_driver.c | 29 - 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed92d8a..fb8ab30 100644 --- a/src/qemu/qemu_domain.c

[libvirt] [PATCH v2 5/7] qemu: s/virDomainDiskDiffersSourceOnly/qemuDomainDiskChangeSupported/

2015-09-16 Thread Michal Privoznik
I always felt like this function is qemu specific rather than libvirt-wide. Other drivers may act differently on virDomainDef change and in fact may require talking to underlying hypervisor even if something else's than disk->src has changed. I know that the function is still incomplete, but lets

[libvirt] [PATCH v2 6/7] qemuDomainDiskChangeSupported: Fill in missing checks

2015-09-16 Thread Michal Privoznik
So far this function was not kept in sync with changing virDomainDiskDef. Fill in all the missing checks and reorganize their order so it's easier to track which items are not being checked for. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 45 +++--

[libvirt] [PATCH v2 1/7] qemuDomainUpdateDeviceConfig: Allow startupPolicy update, yet again

2015-09-16 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1159219 So, in 11e058ca589808bd I've tried to make UpdateDevice update startupPolicy too. And it worked well until somebody came around and pushed d0dc6c036914da which accidentally removed my contribution. Redo my commit. Signed-off-by: Michal Privoznik

[libvirt] [PATCH v2 4/7] qemuDomainChangeDiskLive: rework slightly

2015-09-16 Thread Michal Privoznik
Firstly, our coding guidelines suggest using 'cleanup' label instead of 'end'. Then, @ret should be set to value representing success as the last statement before the 'cleanup' label. And while I am at this function, lets enumerate all the possible enum items (virDomainDiskDevice) and avoid using '

[libvirt] [PATCH v2 3/7] qemu_domain: Introduce qemuDomainDiskSourceDiffers

2015-09-16 Thread Michal Privoznik
This new private API should return true iff sources of two disks differs in sense that qemu should be instructed to change the disk backend. For instance, ejecting a CDROM is such case, or pointing disk into a different ISO location, and so on. Signed-off-by: Michal Privoznik --- src/qemu/qemu_d

Re: [libvirt] [PATCH v3] qemu: Fix using guest architecture as lookup key

2015-09-16 Thread Andrea Bolognani
On Wed, 2015-09-16 at 09:22 +0100, Daniel P. Berrange wrote: > On Wed, Sep 16, 2015 at 09:13:09AM +0200, Andrea Bolognani wrote: > > When looking for a QEMU binary suitable for running ppc64le guests > > we have to take into account the fact that we use the QEMU target > > as key for the hash, so d

Re: [libvirt] [PATCH v3] qemu: Fix using guest architecture as lookup key

2015-09-16 Thread Daniel P. Berrange
On Wed, Sep 16, 2015 at 09:13:09AM +0200, Andrea Bolognani wrote: > When looking for a QEMU binary suitable for running ppc64le guests > we have to take into account the fact that we use the QEMU target > as key for the hash, so direct comparison is not good enough. > > Factor out the logic from v

Re: [libvirt] [PATCH v2] qemu: Fix using guest architecture as lookup key

2015-09-16 Thread Andrea Bolognani
On Tue, 2015-09-15 at 17:34 +0100, Daniel P. Berrange wrote: > > +/* Second attempt: use some arch-specific rules */ > > +archstr = > > virQEMUCapsArchToString(virQEMUCapsFindTarget(hostarch, > > + > > guestarch)); > > Nitpick, we

[libvirt] [PATCH v3] qemu: Fix using guest architecture as lookup key

2015-09-16 Thread Andrea Bolognani
When looking for a QEMU binary suitable for running ppc64le guests we have to take into account the fact that we use the QEMU target as key for the hash, so direct comparison is not good enough. Factor out the logic from virQEMUCapsFindBinaryForArch() to a new virQEMUCapsFindTarget() function and