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

2015-09-17 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

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

2015-09-17 Thread Cedric Bosdonnat
On Wed, 2015-09-16 at 19:29 +, Serge Hallyn wrote: > 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

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

2015-09-17 Thread Ruifeng Bian
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 need to check address type. Otherwise, the domain

[libvirt] [PATCH 1/3] conf: Add new VIR_DOMAIN_VIRT_NONE enum

2015-09-17 Thread Shivangi Dhir
Introduce VIR_DOMAIN_VIRT_NONE to give domaintype the default value of zero. This is specially helpful in constructing better error messages when we don't want to look up the default emulator by virtType. The test data in vircapstest.c is also modified to reflect this change. ---

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

2015-09-17 Thread Richard W.M. Jones
On Thu, Sep 17, 2015 at 10:28:02AM +0200, Matthias Bolte wrote: > 2015-09-16 10:47 GMT+02:00 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,

Re: [libvirt] [PATCH v2 0/12] migration: support all toURI and proto combos

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:12PM +0300, Nikolay Shirokovskiy wrote: > Current implementation of 'toURI' migration interfaces does not support all > combinations of interface versions and protocol versions. For example 'toURI2' > with p2p flag will not migrate if driver supports only v3params

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

2015-09-17 Thread Daniel P. Berrange
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 > >>

[libvirt] [PATCH 3/3] conf: Change the description of virCapabilitiesDomainDataLookup()

2015-09-17 Thread Shivangi Dhir
@domaintype: takes domain type to search for (of enum virDomainVirtType) since we no longer pass out-of-enum values. --- src/conf/capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 533c925..b420f9f 100644 ---

[libvirt] [PATCH 2/3] qemu: Make virtType of type virDomainVirtType

2015-09-17 Thread Shivangi Dhir
Earlier virtType was of type int. After, introducing the enum VIR_DOMAIN_VIRT_NONE, the type of virtType is modified to virDomainVirtType. --- src/conf/domain_conf.h | 2 +- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +-

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

2015-09-17 Thread Matthias Bolte
2015-09-16 10:47 GMT+02:00 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

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

2015-09-17 Thread Shivangi Dhir
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 virtType of type virDomainVirtType conf: Change the description

[libvirt] [PATCH 1/3] client rpc: Report proper error for keepalive disconnections

2015-09-17 Thread Jiri Denemark
Whenever a connection was closed due to keepalive timeout, we would log a warning but the interrupted API would return rather useless generic error: internal error: received hangup / error event on socket Let's report a proper keepalive timeout error and make sure it is propagated to all

[libvirt] [PATCH 0/3] Improve keepalive timeout handling in clients

2015-09-17 Thread Jiri Denemark
Jiri Denemark (3): client rpc: Report proper error for keepalive disconnections client rpc: Process pending data on error virsh: Notify users about disconnects src/rpc/virkeepalive.c | 10 +- src/rpc/virnetclient.c | 30 +- tools/virsh.c | 35

[libvirt] [PATCH 3/3] virsh: Notify users about disconnects

2015-09-17 Thread Jiri Denemark
After my "client rpc: Report proper error for keepalive disconnections" patch, virsh would no long print a warning when it closes a connection to a daemon after a keepalive timeout. Although the warning virsh # 2015-09-15 10:59:26.729+: 642080: info : libvirt version: 1.2.19

[libvirt] [PATCH 2/3] client rpc: Process pending data on error

2015-09-17 Thread Jiri Denemark
Even though we hit an error in client's IO loop, we still want to process any pending data. So instead of reporting the error right away, we can finish the current iteration and report the error once we're done with it. Note that the error is stored in client->error by virNetClientMarkClose so we

Re: [libvirt] [PATCH v2 06/12] migration: refactor: introduce params version of unmanaged

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, 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 arguments. > >

Re: [libvirt] [PATCH v2 12/12] migration: refactor: one return in forURI family functions

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > May be a matter of a taste but this version with one return point in every > function looks simplier to understand and to exetend too. Anyway after such s/exetend/extend > a heavy refactoring a little cleanup will not hurt. > >

[libvirt] [PATCH] virDomainDiskDef: Turn @device into enum

2015-09-17 Thread Michal Privoznik
It's used as enum everywhere, so why store its value in an int? Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 9 +++-- src/conf/domain_conf.h | 2 +- src/qemu/qemu_command.c | 2 ++ src/vmx/vmx.c| 6 +++--- src/vmx/vmx.h| 2 +-

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

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:14PM +0300, Nikolay Shirokovskiy wrote: > As promised in previous patch. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/libvirt-domain.c | 43 +++ > 1 files changed, 23 insertions(+), 20

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

2015-09-17 Thread Jim Fehlig
On 09/16/2015 11:17 PM, Chunyan Liu wrote: 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

[libvirt] [PATCH 0/3] Rework our enum parsing

2015-09-17 Thread Michal Privoznik
Only the first two patches are intended for review. The 3rd one is just an example to show how the code base will shrink in size. Michal Privoznik (3): virutil: Rename virEnum{From,To}String to virType{From,To}String virutil: Introduce virEnumFromString conf: Example for the new pattern

[libvirt] [PATCH 1/3] virutil: Rename virEnum{From, To}String to virType{From, To}String

2015-09-17 Thread Michal Privoznik
While the function names are more or less correct, I will need them in the next commit. So rename these into virType{From,To}String respectively. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 4 ++-- src/util/virutil.c | 22 +++---

[libvirt] [PATCH 2/3] virutil: Introduce virEnumFromString

2015-09-17 Thread Michal Privoznik
So, now we have VIR_ENUM_DECL() and VIR_ENUM_IMPL() macros. They will define a pair of functions for you to convert from and to certain enum. Unfortunately, their usage is slightly cumbersome: int tmp; virMyAwesome ma; if ((tmp = virMyAwesomeTypeFromString(str)) < 0) {

[libvirt] [PATCH 3/3] conf: Example for the new pattern

2015-09-17 Thread Michal Privoznik
NOT TO BE MERGED UPSTREAM This is just an example of usage of new EnumFromString() API. It's intentionally incomplete. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 34 +++--- 1 file changed, 11 insertions(+), 23 deletions(-)

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

2015-09-17 Thread Joao Martins
On 09/17/2015 04:09 AM, Jim Fehlig wrote: > 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`. >> >>

Re: [libvirt] [PATCH v2 0/12] migration: support all toURI and proto combos

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 17, 2015 at 01:11:59PM +0100, Daniel P. Berrange wrote: > On Thu, Sep 10, 2015 at 04:20:12PM +0300, Nikolay Shirokovskiy wrote: > > Current implementation of 'toURI' migration interfaces does not support all > > combinations of interface versions and protocol versions. For example > >

Re: [libvirt] [PATCH v2 07/12] migration: refactor: extract parameter adaption functions

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:19PM +0300, Nikolay Shirokovskiy wrote: > Extract parametes adapdation and checking which is protocol dependent into > designated functions. Leave only branching and common checks in > virDomainMigrateUnmanagedParams. > > Signed-off-by: Nikolay Shirokovskiy

Re: [libvirt] [PATCH v2 10/12] migration: refactor: prepare to reuse flag vs feature checks

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:22PM +0300, Nikolay Shirokovskiy wrote: > All toURI functions have same checks for flags and features compatibility for > direct and p2p case. Let's factor this checks out before we reuse common code > in toURI functions family. As a side affect we have a more clear

Re: [libvirt] [PATCH v2 10/12] migration: refactor: prepare to reuse flag vs feature checks

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > All toURI functions have same checks for flags and features compatibility for > direct and p2p case. Let's factor this checks out before we reuse common code s/this/the > in toURI functions family. As a side affect we have a more clear code

Re: [libvirt] [PATCH v2 08/12] migration: refactor: gather parameters compatibility checks

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:20PM +0300, Nikolay Shirokovskiy wrote: > Checks for migration's parameter set and support by protocol are slightly > scattered in code. Let's put it in one place, namely every protocol function > should check it's parameter set. > > Signed-off-by: Nikolay

Re: [libvirt] [PATCH v2 08/12] migration: refactor: gather parameters compatibility checks

2015-09-17 Thread John Ferlan
$subj: "migration: refactor parameter compatibility checks On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > Checks for migration's parameter set and support by protocol are slightly s/migration's parameter set/migration parameter sets > scattered in code. Let's put it in one place, namely

Re: [libvirt] [PATCH v2 09/12] migration: merge all proto branches into single function

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:21PM +0300, Nikolay Shirokovskiy wrote: > Finally on this step we get what we were aimed for - toURI{1, 2} (and > migration{*} APIs too) now can work thru V3_PARAMS protocol. Execution path > goes thru unchanged virDomainMigrateUnmanaged adapter function which is

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

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:17PM +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

Re: [libvirt] [PATCH v2 06/12] migration: refactor: introduce params version of unmanaged

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:18PM +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

Re: [libvirt] [PATCH v2 09/12] migration: merge all proto branches into single function

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > Finally on this step we get what we were aimed for - toURI{1, 2} (and > migration{*} APIs too) now can work thru V3_PARAMS protocol. Execution path > goes thru unchanged virDomainMigrateUnmanaged adapter function which is called > by all

Re: [libvirt] [PATCH v2 12/12] migration: refactor: one return in forURI family functions

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:24PM +0300, Nikolay Shirokovskiy wrote: > May be a matter of a taste but this version with one return point in every > function looks simplier to understand and to exetend too. Anyway after such > a heavy refactoring a little cleanup will not hurt. > > Signed-off-by:

Re: [libvirt] [PATCH v2 11/12] migration: reuse flags vs features checks in toURI family

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:23PM +0300, Nikolay Shirokovskiy wrote: > Introduce a new function for the check. virDomainMigrateUnmanagedParams is not > a good candidate for this functionality as it is used by migrate family > functions too and its have its own checks that are superset of

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

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:16PM +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

Re: [libvirt] [PATCH v2 11/12] migration: reuse flags vs features checks in toURI family

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > Introduce a new function for the check. virDomainMigrateUnmanagedParams is not > a good candidate for this functionality as it is used by migrate family > functions too and its have its own checks that are superset of extracted and > we >

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

2015-09-17 Thread Daniel P. Berrange
On Thu, Sep 10, 2015 at 04:20:15PM +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

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

2015-09-17 Thread David Mansfield
On 09/17/2015 01:58 AM, Peter Krempa wrote: 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

Re: [libvirt] [PATCH v2 07/12] migration: refactor: extract parameter adaption functions

2015-09-17 Thread John Ferlan
On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote: > Extract parametes adapdation and checking which is protocol dependent into s/parametes adapdation/parameter adaptation > designated functions. Leave only branching and common checks in > virDomainMigrateUnmanagedParams. > > Signed-off-by:

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

2015-09-17 Thread Daniel P. Berrange
On Wed, Sep 16, 2015 at 05:54:30PM -0400, John Ferlan wrote: > > 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

Re: [libvirt] [PATCH v2 5/8] qemu: Don't report false errors in migration protocol v2

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > Finish is the final state in v2 of our migration protocol. If something > fails, we have no option to abort the migration and resume the original > domain. Non fatal errors (such as failure to start guest CPUs or make > the domain persistent) has to

Re: [libvirt] [PATCH v2 6/8] qemuDomainEventQueue: Check if event is non-NULL

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > Every single call to qemuDomainEventQueue() uses the following pattern: > > if (event) > qemuDomainEventQueue(driver, event); > > Let's move the check for valid event to qemuDomainEventQueue and > simplify all callers. > >

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

2015-09-17 Thread Fabio Kung
On Wed, Sep 16, 2015 at 12:29 PM, Serge Hallyn wrote: > > Ok, so I could create a project on github, but that doesn't come with > a m-l. Last I used it, sf was problematic. Any other suggestions for > where to host a mailing list? Might the github issue tracker

Re: [libvirt] [PATCH v2 2/8] qemu: Simplify qemuMigrationFinish

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > Offline migration migration is quite special because we don't really > need to do anything but make the domain persistent. Let's do it > separately from normal migration to avoid cluttering the code with > !(flags & VIR_MIGRATE_OFFLINE). > >

Re: [libvirt] [PATCH v2 1/8] qemu: Split qemuMigrationFinish

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > Separate code which makes incoming domain persistent into > qemuMigrationPersist. > > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2: > - reset vm->persistent if copying persistent def fails > >

Re: [libvirt] [PATCH v2 3/8] qemu: Don't fail migration on save status failure

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > When we save status XML at the point during migration where we have > already started the domain on destination, we can't really go back and > abort migration. Thus the only thing we can do is to log a warning and > report success. > >

Re: [libvirt] [PATCH RFC 2/7] libxl: implement virDomainMemorystats

2015-09-17 Thread Jim Fehlig
On 09/08/2015 02:27 AM, Joao Martins wrote: Introduce support for domainMemoryStats API call, which consequently enables the use of `virsh dommemstat` command to query for memory statistics of a domain. We support the following statistics: balloon info, available and currently in use. swap-in,

Re: [libvirt] [PATCH v2 4/8] qemu: Kill domain when migration finish fails

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > Whenever something fails during incoming migration in Finish phase > before we started guest CPUs, we need to kill the domain in addition to > reporting the failure. > > Signed-off-by: Jiri Denemark > --- > > Notes: >

Re: [libvirt] [PATCH v2 7/8] qemu: Queue events in migration Finish phase ASAP

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > For quite a long time we don't need to postpone queueing events until > the end of the function since we no longer have the big driver lock. > Let's make the code of qemuMigrationFinish simpler by queuing events at > the time we generate them. > >

Re: [libvirt] [PATCH v2 8/8] qemu: Fix some corner cases in persistent migration

2015-09-17 Thread John Ferlan
On 09/11/2015 09:26 AM, Jiri Denemark wrote: > When persistently migrating a domain to a destination host where the > same domain already exists (i.e., it is persistent and shutdown at the > destination), we would happily through away the original persistent s/through/throw > definition