Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-18 Thread Jiri Denemark
On Wed, Jun 17, 2015 at 17:31:03 +0200, Kashyap Chamarthy wrote:
 On Tue, Jun 16, 2015 at 01:42:02AM +0300, Pavel Boldin wrote:
...
 libvirtd debug log[1] from source (destination log is empty)):
 
 [. . .]
 2015-06-17 15:13:53.317+: 781: debug : 
 virDomainMigratePerform3Params:5202 : dom=0x7f2118f13c40, (VM: name=cvm1, 
 uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), 
 dconnuri=qemu+tcp://root@devstack3/system, params=0x7f2118f12a90, nparams=1, 
 cookiein=(nil), cookieinlen=0, cookieout=0x7f2106f38ba8, 
 cookieoutlen=0x7f2106f38ba4, flags=3
 2015-06-17 15:13:53.317+: 781: debug : 
 virDomainMigratePerform3Params:5203 : params[migrate_disks]=(string)vdb
 2015-06-17 15:13:53.317+: 781: debug : qemuMigrationPerform:5238 : 
 driver=0x7f20f416b840, conn=0x7f20dc005c30, vm=0x7f20f41e9640, xmlin=null, 
 dconnuri=qemu+tcp://root@devstack3/system, uri=null, graphicsuri=null, 
 listenAddress=null, nmigrate_disks=1, migrate_disks=0x7f2118f13930, 
 cookiein=null, cookieinlen=0, cookieout=0x7f2106f38ba8, 
 cookieoutlen=0x7f2106f38ba4, flags=3, dname=null, resource=0, v3proto=1
 2015-06-17 15:13:53.317+: 781: debug : qemuDomainObjBeginJobInternal:1397 
 : Starting async job: none (async=migration out vm=0x7f20f41e9640 name=cvm1)
 2015-06-17 15:13:53.317+: 781: debug : qemuDomainObjBeginJobInternal:1414 
 : Waiting for async job (vm=0x7f20f41e9640 name=cvm1)
 2015-06-17 15:13:53.821+: 782: debug : virThreadJobSet:96 : Thread 782 
 (virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
 2015-06-17 15:13:53.821+: 782: debug : virDomainGetJobInfo:8808 : 
 dom=0x7f20dc008c30, (VM: name=cvm1, 
 uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), info=0x7f2106737b50
 2015-06-17 15:13:53.821+: 782: debug : virThreadJobClear:121 : Thread 782 
 (virNetServerHandleJob) finished job remoteDispatchDomainGetJobInfo with ret=0
 2015-06-17 15:13:54.325+: 780: debug : virThreadJobSet:96 : Thread 780 
 (virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
 2015-06-17 15:13:54.325+: 780: debug : virDomainGetJobInfo:8808 : 
 dom=0x7f20dc008c30, (VM: name=cvm1, 
 uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), info=0x7f2107739b50
 2015-06-17 15:13:54.325+: 780: debug : virThreadJobClear:121 : Thread 780 
 (virNetServerHandleJob) finished job remoteDispatchDomainGetJobInfo with ret=0
 [. . .]
 remoteDispatchDomainMigratePerform3Params, 784 
 remoteDispatchDomainMigratePerform3Params) for (520s, 520s)
 2015-06-17 15:14:23.320+: 781: error : qemuDomainObjBeginJobInternal:1492 
 : Timed out during operation: cannot acquire state change lock (held by 
 remoteDispatchDomainMigratePerform3Params)
 2015-06-17 15:14:23.320+: 781: debug : virThreadJobClear:121 : Thread 781 
 (virNetServerHandleJob) finished job 
 remoteDispatchDomainMigratePerform3Params with ret=-1
 2015-06-17 15:14:23.320+: 783: debug : virThreadJobSet:96 : Thread 783 
 (virNetServerHandleJob) is now running job remoteDispatchConnectClose
 2015-06-17 15:14:23.320+: 783: debug : virThreadJobClear:121 : Thread 783 
 (virNetServerHandleJob) finished job remoteDispatchConnectClose with ret=0
 
 
 How can I mitigate this? (I realize this is not due to these patches,
 proably something with my test environment.)
 
 Since this is non-shared storage migration, I tried to supply
 '--copy-storage-inc' to no avail (same error as above).
 
 Probably I should test by building local RPMs.
 
 [1] 
 https://kashyapc.fedorapeople.org/virt/temp/libvirtd-log-selective-blockdev-failed.log

Could you upload a complete log somewhere? It seems a previously started
migration is waiting for a response from QEMU. Or alternatively, it
failed to release the jobs. I'd like to see the logs from the previous
migration attempt.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-18 Thread Kashyap Chamarthy
On Thu, Jun 18, 2015 at 02:25:08PM +0200, Jiri Denemark wrote:
 On Wed, Jun 17, 2015 at 17:31:03 +0200, Kashyap Chamarthy wrote:
  On Tue, Jun 16, 2015 at 01:42:02AM +0300, Pavel Boldin wrote:
 ...
  libvirtd debug log[1] from source (destination log is empty)):
  
  [. . .]
  2015-06-17 15:13:53.317+: 781: debug : 
  virDomainMigratePerform3Params:5202 : dom=0x7f2118f13c40, (VM: name=cvm1, 
  uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), 
  dconnuri=qemu+tcp://root@devstack3/system, params=0x7f2118f12a90, 
  nparams=1, cookiein=(nil), cookieinlen=0, cookieout=0x7f2106f38ba8, 
  cookieoutlen=0x7f2106f38ba4, flags=3
  2015-06-17 15:13:53.317+: 781: debug : 
  virDomainMigratePerform3Params:5203 : params[migrate_disks]=(string)vdb
  2015-06-17 15:13:53.317+: 781: debug : qemuMigrationPerform:5238 : 
  driver=0x7f20f416b840, conn=0x7f20dc005c30, vm=0x7f20f41e9640, 
  xmlin=null, dconnuri=qemu+tcp://root@devstack3/system, uri=null, 
  graphicsuri=null, listenAddress=null, nmigrate_disks=1, 
  migrate_disks=0x7f2118f13930, cookiein=null, cookieinlen=0, 
  cookieout=0x7f2106f38ba8, cookieoutlen=0x7f2106f38ba4, flags=3, 
  dname=null, resource=0, v3proto=1
  2015-06-17 15:13:53.317+: 781: debug : 
  qemuDomainObjBeginJobInternal:1397 : Starting async job: none 
  (async=migration out vm=0x7f20f41e9640 name=cvm1)
  2015-06-17 15:13:53.317+: 781: debug : 
  qemuDomainObjBeginJobInternal:1414 : Waiting for async job 
  (vm=0x7f20f41e9640 name=cvm1)
  2015-06-17 15:13:53.821+: 782: debug : virThreadJobSet:96 : Thread 782 
  (virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
  2015-06-17 15:13:53.821+: 782: debug : virDomainGetJobInfo:8808 : 
  dom=0x7f20dc008c30, (VM: name=cvm1, 
  uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), info=0x7f2106737b50
  2015-06-17 15:13:53.821+: 782: debug : virThreadJobClear:121 : Thread 
  782 (virNetServerHandleJob) finished job remoteDispatchDomainGetJobInfo 
  with ret=0
  2015-06-17 15:13:54.325+: 780: debug : virThreadJobSet:96 : Thread 780 
  (virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
  2015-06-17 15:13:54.325+: 780: debug : virDomainGetJobInfo:8808 : 
  dom=0x7f20dc008c30, (VM: name=cvm1, 
  uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), info=0x7f2107739b50
  2015-06-17 15:13:54.325+: 780: debug : virThreadJobClear:121 : Thread 
  780 (virNetServerHandleJob) finished job remoteDispatchDomainGetJobInfo 
  with ret=0
  [. . .]
  remoteDispatchDomainMigratePerform3Params, 784 
  remoteDispatchDomainMigratePerform3Params) for (520s, 520s)
  2015-06-17 15:14:23.320+: 781: error : 
  qemuDomainObjBeginJobInternal:1492 : Timed out during operation: cannot 
  acquire state change lock (held by 
  remoteDispatchDomainMigratePerform3Params)
  2015-06-17 15:14:23.320+: 781: debug : virThreadJobClear:121 : Thread 
  781 (virNetServerHandleJob) finished job 
  remoteDispatchDomainMigratePerform3Params with ret=-1
  2015-06-17 15:14:23.320+: 783: debug : virThreadJobSet:96 : Thread 783 
  (virNetServerHandleJob) is now running job remoteDispatchConnectClose
  2015-06-17 15:14:23.320+: 783: debug : virThreadJobClear:121 : Thread 
  783 (virNetServerHandleJob) finished job remoteDispatchConnectClose with 
  ret=0
  
  
  How can I mitigate this? (I realize this is not due to these patches,
  proably something with my test environment.)
  
  Since this is non-shared storage migration, I tried to supply
  '--copy-storage-inc' to no avail (same error as above).
  
  Probably I should test by building local RPMs.
  
  [1] 
  https://kashyapc.fedorapeople.org/virt/temp/libvirtd-log-selective-blockdev-failed.log
 
 Could you upload a complete log somewhere? It seems a previously started
 migration is waiting for a response from QEMU. Or alternatively, it
 failed to release the jobs. I'd like to see the logs from the previous
 migration attempt.

I'm afraid, too late -- I blew that environment away and re-created
libvirt RPMs. This time, with Michal's branch from here, which also has
the additional diff he posted in his review:

https://github.com/zippy2/libvirt/tree/storage_migration2

I did a preliminary test and it seems to have worked:

On source:

$ virsh domblklist cvm1 Target Source

vda/var/lib/libvirt/images/cirros-0.3.3-x86_64-disk.img
vdb/export/disk2.img

$ virsh migrate --verbose --p2p --copy-storage-inc \
--migratedisks vda  --live cvm1 qemu+tcp://root@devstack3/system
Migration: [100 %]


On Dest:
---

Where vdb was already present.

$ virsh list
 IdName   State

 2 cvm1   running


$ virsh domblklist cvm1
Target Source

vda/var/lib/libvirt/images/cirros-0.3.3-x86_64-disk.img
vdb

Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-18 Thread Michal Privoznik
On 16.06.2015 17:47, Michal Privoznik wrote:
 On 16.06.2015 00:42, Pavel Boldin wrote:
 Behold of the fourth re-roll of the selective block device migration patch.
 In this patch we don't only fix the issue with NBD migration format auto-
 detection but also introduce the patches that do enhance the NBD migration
 triggered by `drive-mirror` QEMU command with ability for the user to select
 what disks are to be migrated based on the target name.

 First two patches fix some nitpicks, third one fixes the issue with NBD 
 format
 auto-detection.

 Middle ones introduce a necessary API to keep a list of block devices to
 migrate in the virTypedParameter array and to work with this list.

 Of the two last patches first introduces the `migrate_disks' qemuMigration*
 parameter and pushes it down the call stack making the code to consult it 
 when
 there is a decision to be made whether the block device is to be migrated to
 the new host. When there is no `migrate_disks' parameter given then the old
 scheme is used: only non-shared non-readonly disks with a source are 
 migrated.

 The last patch promotes this ability up to the virsh utility and documents
 it as appropriate.

 Michal Privoznik (3):
   virDomainDiskGetSource: Mark passed disk as 'const'
   qemuMigrationBeginPhase: Fix function header indentation
   qemuMigrationDriveMirror: Force raw format for NBD

 Pavel Boldin (6):
   util: multi-value virTypedParameter
   util: multi-value parameters in virTypedParamsAdd*
   util: virTypedParams{Filter,GetAllStrings}
   util: add virTypedParamsAddStringList
   qemu: migration: selective block device migration
   virsh: selective block device migration

  include/libvirt/libvirt-domain.h |   9 ++
  include/libvirt/libvirt-host.h   |  11 ++
  src/conf/domain_conf.c   |   2 +-
  src/conf/domain_conf.h   |   2 +-
  src/libvirt_public.syms  |   6 +
  src/qemu/qemu_driver.c   |  78 ---
  src/qemu/qemu_migration.c| 264 +--
  src/qemu/qemu_migration.h|  24 ++--
  src/util/virtypedparam.c | 259 +++---
  src/util/virtypedparam.h |  19 +++
  tests/Makefile.am|   6 +
  tests/virtypedparamtest.c| 295 
 +++
  tools/virsh-domain.c |  23 +++
  tools/virsh.pod  |  21 +--
  14 files changed, 854 insertions(+), 165 deletions(-)
  create mode 100644 tests/virtypedparamtest.c

 


 I have it squashed into the corresponding commits. So with this - you
 have my ACK, although it feels a bit weird to ACK my own patches.
 Therefore, I'm giving others some time before merging this to express
 their feelings.
 

This is now pushed. Let me congratulate Pavel on his first libvirt
contribution. And what a contribution it was!

Michal


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-18 Thread Kashyap Chamarthy
On Wed, Jun 17, 2015 at 05:31:03PM +0200, Kashyap Chamarthy wrote:
 On Tue, Jun 16, 2015 at 01:42:02AM +0300, Pavel Boldin wrote:
 
 [. . .]
 
  Michal Privoznik (3):
virDomainDiskGetSource: Mark passed disk as 'const'
qemuMigrationBeginPhase: Fix function header indentation
qemuMigrationDriveMirror: Force raw format for NBD
  
  Pavel Boldin (6):
util: multi-value virTypedParameter
util: multi-value parameters in virTypedParamsAdd*
util: virTypedParams{Filter,GetAllStrings}
util: add virTypedParamsAddStringList
qemu: migration: selective block device migration
virsh: selective block device migration
  
   include/libvirt/libvirt-domain.h |   9 ++
   include/libvirt/libvirt-host.h   |  11 ++
   src/conf/domain_conf.c   |   2 +-
   src/conf/domain_conf.h   |   2 +-
   src/libvirt_public.syms  |   6 +
   src/qemu/qemu_driver.c   |  78 ---
   src/qemu/qemu_migration.c| 264 +--
   src/qemu/qemu_migration.h|  24 ++--
   src/util/virtypedparam.c | 259 +++---
   src/util/virtypedparam.h |  19 +++
   tests/Makefile.am|   6 +
   tests/virtypedparamtest.c| 295 
  +++
   tools/virsh-domain.c |  23 +++
   tools/virsh.pod  |  21 +--
   14 files changed, 854 insertions(+), 165 deletions(-)
   create mode 100644 tests/virtypedparamtest.c
  
 
 New test with this revision of patches applied.
 
 
[. . .]

 Probably I should test by building local RPMs.
 

I missed to apply the diff from Michal earlier. So, I tested again from
git, now that Michal pushed them already :-). With both
--copy-storage-all and --copy-storage-inc.

Simple test seems to work:

  - On source:
  
  $ virsh domblklist cvm1
  Target Source
  
  vda/var/lib/libvirt/images/cirros-0.3.3-x86_64-disk.img
  vdb/export/disk2.img
  
  - On destination, /export/disk2.img (vdb) already exists.
  
  - On source, just migrate the 'vda' device:
  
  $ virsh migrate --verbose --p2p --copy-storage-all \
  --migrate-disks vda \
  --live cvm1 qemu+tcp://root@devstack3/system
  Migration: [100 %]
  
  - On source, cvm1 is down (as expected).
  
  - On destination, cvm1 is running, and both the block devices (vda,
vdb) are enumerated.


As a test 2, I tried the opposite:

- Ensured the vda
  (/var/lib/libvirt/images/cirros-0.3.3-x86_64-disk.img) is in place
  on destination.

- Did a `virsh pool-refresh` on both existing pools on destination,
  for good measure.
 
- This time, tried to migrate only 'vdb', and the result is the
  migrate command just hung on source:

$ virsh migrate --verbose --p2p --copy-storage-all \
--migrate-disks vdb \
--live cvm1 qemu+tcp://root@devstack3/system
# Here the command is just hung

- On destination, the guest is in paused state:
   
$ virsh list
 IdName   State

 15cvm1   paused

Here's the libvirt debug log from *destination*, if anyone is
interested:


https://kashyapc.fedorapeople.org/virt/temp/libvirtd-log-dst-hung-blockdev-mig.log

-- 
/kashyap

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-17 Thread Kashyap Chamarthy
On Tue, Jun 16, 2015 at 01:42:02AM +0300, Pavel Boldin wrote:

[. . .]

 Michal Privoznik (3):
   virDomainDiskGetSource: Mark passed disk as 'const'
   qemuMigrationBeginPhase: Fix function header indentation
   qemuMigrationDriveMirror: Force raw format for NBD
 
 Pavel Boldin (6):
   util: multi-value virTypedParameter
   util: multi-value parameters in virTypedParamsAdd*
   util: virTypedParams{Filter,GetAllStrings}
   util: add virTypedParamsAddStringList
   qemu: migration: selective block device migration
   virsh: selective block device migration
 
  include/libvirt/libvirt-domain.h |   9 ++
  include/libvirt/libvirt-host.h   |  11 ++
  src/conf/domain_conf.c   |   2 +-
  src/conf/domain_conf.h   |   2 +-
  src/libvirt_public.syms  |   6 +
  src/qemu/qemu_driver.c   |  78 ---
  src/qemu/qemu_migration.c| 264 +--
  src/qemu/qemu_migration.h|  24 ++--
  src/util/virtypedparam.c | 259 +++---
  src/util/virtypedparam.h |  19 +++
  tests/Makefile.am|   6 +
  tests/virtypedparamtest.c| 295 
 +++
  tools/virsh-domain.c |  23 +++
  tools/virsh.pod  |  21 +--
  14 files changed, 854 insertions(+), 165 deletions(-)
  create mode 100644 tests/virtypedparamtest.c
 

New test with this revision of patches applied.

Test env


- On source and destination host, libvirt is compiled with the above
  patches:  

$ git describe
v1.2.16-204-g7aee251

- Create SSH keys and copy to dest host:

# Create the SSH keys with empty passphrase
$ ssh-keygen -t rsa
# Copy the key to the remote host
$ ssh-copy-id root@devstack3
# `ssh root@devstack3` succeeds w/o password prompt

- Since I'm on a trusted network, on dest host:

$ cat /etc/libvirt/libvirtd.conf | grep -v ^$ | grep -v ^#
listen_tls = 0
listen_tcp = 1
auth_tcp = none 

- Run the libvirtd daemon on destination (with --listen mode), as
  root:

$ ./run daemon/libvirtd --listen 


Test migration
~~

On source (from newly built libvirtd), as root:

$ ./run tools/virsh list
 
I have two disks:

$ ./run tools/virsh domblklist cvm1 
   
Target Source

vda/var/lib/libvirt/images/cirros-0.3.3-x86_64-disk.img
vdb/export/disk2.img

So, let's try to migrate the 'vdb' disk:

$ ./virsh migrate --verbose --p2p  --migratedisks vdb \
--live cvm1 qemu+ssh://root@devstack3/system
error: Timed out during operation: cannot acquire state change lock (held 
by remoteDispatchDomainMigratePerform3Params)


From libvirt debug logs
~~~

libvirtd debug log[1] from source (destination log is empty)):

[. . .]
2015-06-17 15:13:53.317+: 781: debug : virDomainMigratePerform3Params:5202 
: dom=0x7f2118f13c40, (VM: name=cvm1, 
uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), 
dconnuri=qemu+tcp://root@devstack3/system, params=0x7f2118f12a90, nparams=1, 
cookiein=(nil), cookieinlen=0, cookieout=0x7f2106f38ba8, 
cookieoutlen=0x7f2106f38ba4, flags=3
2015-06-17 15:13:53.317+: 781: debug : virDomainMigratePerform3Params:5203 
: params[migrate_disks]=(string)vdb
2015-06-17 15:13:53.317+: 781: debug : qemuMigrationPerform:5238 : 
driver=0x7f20f416b840, conn=0x7f20dc005c30, vm=0x7f20f41e9640, xmlin=null, 
dconnuri=qemu+tcp://root@devstack3/system, uri=null, graphicsuri=null, 
listenAddress=null, nmigrate_disks=1, migrate_disks=0x7f2118f13930, 
cookiein=null, cookieinlen=0, cookieout=0x7f2106f38ba8, 
cookieoutlen=0x7f2106f38ba4, flags=3, dname=null, resource=0, v3proto=1
2015-06-17 15:13:53.317+: 781: debug : qemuDomainObjBeginJobInternal:1397 : 
Starting async job: none (async=migration out vm=0x7f20f41e9640 name=cvm1)
2015-06-17 15:13:53.317+: 781: debug : qemuDomainObjBeginJobInternal:1414 : 
Waiting for async job (vm=0x7f20f41e9640 name=cvm1)
2015-06-17 15:13:53.821+: 782: debug : virThreadJobSet:96 : Thread 782 
(virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
2015-06-17 15:13:53.821+: 782: debug : virDomainGetJobInfo:8808 : 
dom=0x7f20dc008c30, (VM: name=cvm1, uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), 
info=0x7f2106737b50
2015-06-17 15:13:53.821+: 782: debug : virThreadJobClear:121 : Thread 782 
(virNetServerHandleJob) finished job remoteDispatchDomainGetJobInfo with ret=0
2015-06-17 15:13:54.325+: 780: debug : virThreadJobSet:96 : Thread 780 
(virNetServerHandleJob) is now running job remoteDispatchDomainGetJobInfo
2015-06-17 15:13:54.325+: 780: debug : virDomainGetJobInfo:8808 : 
dom=0x7f20dc008c30, (VM: name=cvm1, uuid=ab4c412b-6fdc-4fc4-b78c-f1d49db10d4e), 
info=0x7f2107739b50
2015-06-17 15:13:54.325+: 780: debug : virThreadJobClear:121 : Thread 780 

Re: [libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-16 Thread Michal Privoznik
On 16.06.2015 00:42, Pavel Boldin wrote:
 Behold of the fourth re-roll of the selective block device migration patch.
 In this patch we don't only fix the issue with NBD migration format auto-
 detection but also introduce the patches that do enhance the NBD migration
 triggered by `drive-mirror` QEMU command with ability for the user to select
 what disks are to be migrated based on the target name.
 
 First two patches fix some nitpicks, third one fixes the issue with NBD format
 auto-detection.
 
 Middle ones introduce a necessary API to keep a list of block devices to
 migrate in the virTypedParameter array and to work with this list.
 
 Of the two last patches first introduces the `migrate_disks' qemuMigration*
 parameter and pushes it down the call stack making the code to consult it when
 there is a decision to be made whether the block device is to be migrated to
 the new host. When there is no `migrate_disks' parameter given then the old
 scheme is used: only non-shared non-readonly disks with a source are migrated.
 
 The last patch promotes this ability up to the virsh utility and documents
 it as appropriate.
 
 Michal Privoznik (3):
   virDomainDiskGetSource: Mark passed disk as 'const'
   qemuMigrationBeginPhase: Fix function header indentation
   qemuMigrationDriveMirror: Force raw format for NBD
 
 Pavel Boldin (6):
   util: multi-value virTypedParameter
   util: multi-value parameters in virTypedParamsAdd*
   util: virTypedParams{Filter,GetAllStrings}
   util: add virTypedParamsAddStringList
   qemu: migration: selective block device migration
   virsh: selective block device migration
 
  include/libvirt/libvirt-domain.h |   9 ++
  include/libvirt/libvirt-host.h   |  11 ++
  src/conf/domain_conf.c   |   2 +-
  src/conf/domain_conf.h   |   2 +-
  src/libvirt_public.syms  |   6 +
  src/qemu/qemu_driver.c   |  78 ---
  src/qemu/qemu_migration.c| 264 +--
  src/qemu/qemu_migration.h|  24 ++--
  src/util/virtypedparam.c | 259 +++---
  src/util/virtypedparam.h |  19 +++
  tests/Makefile.am|   6 +
  tests/virtypedparamtest.c| 295 
 +++
  tools/virsh-domain.c |  23 +++
  tools/virsh.pod  |  21 +--
  14 files changed, 854 insertions(+), 165 deletions(-)
  create mode 100644 tests/virtypedparamtest.c
 

Basically, this is the diff of the all nits I've pointed out:

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index f7373af..6c41e89 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2272,6 +2272,8 @@ virTypedParameterTypeFromString;
 virTypedParameterTypeToString;
 virTypedParamsCheck;
 virTypedParamsCopy;
+virTypedParamsFilter;
+virTypedParamsGetAllStrings;
 virTypedParamsReplaceString;
 virTypedParamsValidate;
 
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index ccc7532..59d8c12 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -717,7 +717,6 @@ LIBVIRT_1.2.16 {
 
 LIBVIRT_1.3.0 {
 global:
-virTypedParamsGetAllStrings;
 virTypedParamsAddStringList;
 } LIBVIRT_1.2.16;
 
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d56579b..4c6b530 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12351,7 +12351,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
 }
 
 return qemuMigrationBegin(domain-conn, vm, xmlin, dname,
-  cookieout, cookieoutlen, flags, 0, NULL);
+  cookieout, cookieoutlen, 0, NULL, flags);
 }
 
 static char *
@@ -12381,9 +12381,9 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
 dname)  0)
 goto cleanup;
 
-nmigrate_disks = virTypedParamsGetAllStrings(
-params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
-migrate_disks);
+nmigrate_disks = virTypedParamsGetAllStrings(params, nparams,
+ 
VIR_MIGRATE_PARAM_MIGRATE_DISKS,
+ migrate_disks);
 
 if (nmigrate_disks  0)
 goto cleanup;
@@ -12397,8 +12397,8 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
 }
 
 ret = qemuMigrationBegin(domain-conn, vm, xmlin, dname,
- cookieout, cookieoutlen, flags,
- nmigrate_disks, migrate_disks);
+ cookieout, cookieoutlen,
+ nmigrate_disks, migrate_disks, flags);
 
  cleanup:
 VIR_FREE(migrate_disks);
@@ -12495,9 +12495,9 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
 listenAddress)  0)
 goto cleanup;
 
-nmigrate_disks = virTypedParamsGetAllStrings(
-params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
-

[libvirt] [PATCH v4 0/9] Selective block device migration implementation

2015-06-15 Thread Pavel Boldin
Behold of the fourth re-roll of the selective block device migration patch.
In this patch we don't only fix the issue with NBD migration format auto-
detection but also introduce the patches that do enhance the NBD migration
triggered by `drive-mirror` QEMU command with ability for the user to select
what disks are to be migrated based on the target name.

First two patches fix some nitpicks, third one fixes the issue with NBD format
auto-detection.

Middle ones introduce a necessary API to keep a list of block devices to
migrate in the virTypedParameter array and to work with this list.

Of the two last patches first introduces the `migrate_disks' qemuMigration*
parameter and pushes it down the call stack making the code to consult it when
there is a decision to be made whether the block device is to be migrated to
the new host. When there is no `migrate_disks' parameter given then the old
scheme is used: only non-shared non-readonly disks with a source are migrated.

The last patch promotes this ability up to the virsh utility and documents
it as appropriate.

Michal Privoznik (3):
  virDomainDiskGetSource: Mark passed disk as 'const'
  qemuMigrationBeginPhase: Fix function header indentation
  qemuMigrationDriveMirror: Force raw format for NBD

Pavel Boldin (6):
  util: multi-value virTypedParameter
  util: multi-value parameters in virTypedParamsAdd*
  util: virTypedParams{Filter,GetAllStrings}
  util: add virTypedParamsAddStringList
  qemu: migration: selective block device migration
  virsh: selective block device migration

 include/libvirt/libvirt-domain.h |   9 ++
 include/libvirt/libvirt-host.h   |  11 ++
 src/conf/domain_conf.c   |   2 +-
 src/conf/domain_conf.h   |   2 +-
 src/libvirt_public.syms  |   6 +
 src/qemu/qemu_driver.c   |  78 ---
 src/qemu/qemu_migration.c| 264 +--
 src/qemu/qemu_migration.h|  24 ++--
 src/util/virtypedparam.c | 259 +++---
 src/util/virtypedparam.h |  19 +++
 tests/Makefile.am|   6 +
 tests/virtypedparamtest.c| 295 +++
 tools/virsh-domain.c |  23 +++
 tools/virsh.pod  |  21 +--
 14 files changed, 854 insertions(+), 165 deletions(-)
 create mode 100644 tests/virtypedparamtest.c

-- 
1.9.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list