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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 02:11, John Ferlan wrote: > > > 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

Re: [libvirt] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Kevin Wolf
Am 18.09.2015 um 11:03 hat Vasiliy Tolstov geschrieben: > 2015-09-18 12:02 GMT+03:00 Kevin Wolf : > > Doesn't sheepdog already support storing snapshots in the same image? > > I thought it would just work; at least, there's some code there for it. > > Yes, qemu and sheepdog have

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 17:39, Daniel P. Berrange wrote: > 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

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 01:24, John Ferlan wrote: > > > 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

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 18:22, John Ferlan wrote: > > > 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

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 17:32, John Ferlan wrote: > > > 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

[libvirt] [PATCH 1/4] storage: Use virFileUnlink instead of rmdir

2015-09-18 Thread John Ferlan
Similar to commit id '35847860', it's possible to attempt to create a 'netfs' directory in an NFS root-squash environment which will cause the 'vol-delete' command to fail. It's also possible error paths from the 'vol-create' would result in an error to remove a created directory if the

[libvirt] [PATCH 0/4] Remove open coding virProcessWait for root-squash

2015-09-18 Thread John Ferlan
A followup of sorts to recently pushed patches regarding NFS root-squash. During libvirt-security list review it was pointed out that the new code was essentially open coding what virProcessWait does. However, since the model being used also was open coded and there was a time element, the change

[libvirt] [PATCH] Revert "qemu: Fix integer/boolean logic in qemuSetUnprivSGIO"

2015-09-18 Thread John Ferlan
This reverts commit 69b850fe2a19d0c32ae2f209e8d8463df6ead665. This change broke the ability to "clear" or reset unfiltered back to filtered. Signed-off-by: John Ferlan --- This is a event - have to wonder what I was thinking at the time. The patch pushed removes the

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

2015-09-18 Thread John Ferlan
On 09/16/2015 05:14 AM, Michal Privoznik wrote: > 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:

[libvirt] [PATCH 3/4] virfile: Use virProcessWait in virFileUnlink

2015-09-18 Thread John Ferlan
Rather than inlining the code, use the common API. Signed-off-by: John Ferlan --- src/util/virfile.c | 38 +- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index a0c8f0c..02d1a1f

[libvirt] [PATCH 2/4] virfile: Use virProcessWait in virFileOpenForked

2015-09-18 Thread John Ferlan
Rather than inlining the code, use the common API Signed-off-by: John Ferlan --- src/util/virfile.c | 47 +-- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index

[libvirt] [PATCH 4/4] virfile: Use virProcessWait in virDirCreate

2015-09-18 Thread John Ferlan
Rather than inlining the code, use the common API. Signed-off-by: John Ferlan --- src/util/virfile.c | 45 +++-- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index

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

2015-09-18 Thread John Ferlan
On 09/16/2015 05:15 AM, Michal Privoznik wrote: > 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

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

2015-09-18 Thread Jiri Denemark
On Thu, Sep 17, 2015 at 18:40:59 -0400, John Ferlan wrote: > > > 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

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

2015-09-18 Thread Jiri Denemark
On Thu, Sep 17, 2015 at 17:45:26 -0400, John Ferlan wrote: > > > 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

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

2015-09-18 Thread Jiri Denemark
On Thu, Sep 17, 2015 at 18:24:29 -0400, John Ferlan wrote: > > > 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

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

2015-09-18 Thread John Ferlan
On 09/18/2015 07:46 AM, Jiri Denemark wrote: > On Thu, Sep 17, 2015 at 18:24:29 -0400, John Ferlan wrote: >> >> >> On 09/11/2015 09:26 AM, Jiri Denemark wrote: >>> Every single call to qemuDomainEventQueue() uses the following pattern: >>> >>> if (event) >>>

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

2015-09-18 Thread Jiri Denemark
On Thu, Sep 17, 2015 at 17:48:21 -0400, John Ferlan wrote: > > > 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

Re: [libvirt] [sheepdog] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Hitoshi Mitake
On Fri, Sep 18, 2015 at 6:49 PM, Kevin Wolf wrote: > Am 18.09.2015 um 11:03 hat Vasiliy Tolstov geschrieben: >> 2015-09-18 12:02 GMT+03:00 Kevin Wolf : >> > Doesn't sheepdog already support storing snapshots in the same image? >> > I thought it would just work;

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 00:54, 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 patch 2 and perhaps

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

2015-09-18 Thread Nikolay Shirokovskiy
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(-) diff --git a/src/libvirt-domain.c

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

2015-09-18 Thread Nikolay Shirokovskiy
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 deletions(-) diff --git a/src/libvirt-domain.c

[libvirt] [PATCH v3 0/14] migration: support all toURI and proto combos

2015-09-18 Thread Nikolay Shirokovskiy
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 proto. This is not convinient as drivers that starts to support migration have

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

2015-09-18 Thread Nikolay Shirokovskiy
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. Signed-off-by: Nikolay Shirokovskiy

[libvirt] [PATCH v3 14/14] migration: check dconnuri in p2p mode

2015-09-18 Thread Nikolay Shirokovskiy
Check dconnuri is not null or we will catch nullpointer later. I hope this makes Coverity happy. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libvirt-domain.c

[libvirt] [PATCH v3 13/14] migration: refactor: one return in forURI family functions

2015-09-18 Thread Nikolay Shirokovskiy
May be a matter of a taste but this version with one return point in every function looks simplier to understand and to extend too. Anyway after such a heavy refactoring a little cleanup will not hurt. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c |

[libvirt] [PATCH v3 12/14] migration: reuse parameters check in toURI2 and toURI3

2015-09-18 Thread Nikolay Shirokovskiy
It is *not* a pure refactoring patch as it introduces offline check for older versions. Looks like it must be done that way and no one will be broken too. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c | 75

[libvirt] [PATCH v3 10/14] migration: merge all proto branches into single function

2015-09-18 Thread Nikolay Shirokovskiy
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 target places. Note that we keep the fact that direct migration

[libvirt] [PATCH v3 09/14] migration: refactor: refactor parameter compatibility checks

2015-09-18 Thread Nikolay Shirokovskiy
Move virDomainMigrateUnmanagedProto* expected params list check into function itself and use common virTypedParamsCheck for this purpose. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c | 56 - 1 files

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

2015-09-18 Thread Michal Privoznik
On 17.09.2015 07:15, 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:

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

2015-09-18 Thread Jim Fehlig
On 09/18/2015 08:25 AM, Michal Privoznik wrote: On 17.09.2015 07:15, 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

[libvirt] crash in virDomainNumaGetMemorySize

2015-09-18 Thread Olaf Hering
With current master (56945e1), while toying around with a WS2008R2 Hyper-V host: root@probook:~ # gdb --quiet -ex 'r -c hv dumpxml all-sles12-dev' -ex bt -ex detach -ex quit virsh Reading symbols from virsh...Reading symbols from /usr/lib/debug/usr/bin/virsh.debug...done. done. Starting

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

2015-09-18 Thread Nikolay Shirokovskiy
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 support old version too as its parameter

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

2015-09-18 Thread Nikolay Shirokovskiy
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 functionality in lesser aspects. So let's merge them. But as they

[libvirt] [PATCH v3 11/14] migration: refactor: introduce parameter checking function

2015-09-18 Thread Nikolay Shirokovskiy
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 don't need to check twice. Actually name of the function is slightly misleading as there is also a check

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

2015-09-18 Thread Nikolay Shirokovskiy
'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 one with hardcoded parameter set. Signed-off-by: Nikolay Shirokovskiy

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

2015-09-18 Thread Nikolay Shirokovskiy
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 function. So it is additionally a more solid code. Signed-off-by:

[libvirt] [PATCH v3 08/14] migration: refactor: extract parameter adaption functions

2015-09-18 Thread Nikolay Shirokovskiy
Extract parameter adaptation and checking which is protocol dependent into designated functions. Leave only branching and common checks in virDomainMigrateUnmanagedParams. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c | 118

Re: [libvirt] [PATCH v2 0/8] Simplify and fix qemuMigrationFinish

2015-09-18 Thread Jiri Denemark
On Fri, Sep 11, 2015 at 15:26:02 +0200, Jiri Denemark wrote: > While hacking qemuMigrationFinish I found it pretty hard to follow and > revealed few bugs (patches 3 to 5, and 8) in the code. > > Version 2: > - rebased and review comments addressed > - new patch "qemu: Fix some corner cases in

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 18:22, John Ferlan wrote: > > > 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

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

2015-09-18 Thread Nikolay Shirokovskiy
On 17.09.2015 18:07, John Ferlan wrote: > > > 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

[libvirt] [java] [PATCH] add missing virDomainSetMemoryStatsPeriod API

2015-09-18 Thread Wei Mingzhi
Hi, The attached patch adds the missing virDomainSetMemoryStatsPeriod API, which was introduced since around 2013. Cheers, Wei Mingzhi -- "The best way to predict the future is to invent it." -Alan Kay diff --git a/src/main/java/org/libvirt/Domain.java

Re: [libvirt] [PATCH v2] Close the source fd if the destination qemu exits during tunnelled migration

2015-09-18 Thread John Ferlan
On 09/14/2015 10:44 AM, Shivaprasad G Bhat wrote: > Tunnelled migration can hang if the destination qemu exits despite all the > ABI checks. This happens whenever the destination qemu exits before the > complete transfer is noticed by source qemu. The savevm state checks at > runtime can fail at