Re: [libvirt] [PATCH 07/11] qemu: blockPivot: Don't pause the VM any more since we don't use drive-reopen

2015-04-09 Thread Peter Krempa
On Wed, Apr 08, 2015 at 11:31:18 -0400, John Ferlan wrote:
 
 
 On 04/01/2015 01:20 PM, Peter Krempa wrote:
  Support for drive-reopen was never present in the upstream code so we
  don't need to pause the VM when doing the block pivot. Kill all the
  code related to this semi-upstream artifact.
  ---
   src/qemu/qemu_driver.c | 48 
  +---
   1 file changed, 5 insertions(+), 43 deletions(-)
  
 
 ACK - although it seems to be outside the realm of .0 Refactor the
 block job code...  IOW - should this have been a separate patch.

Separate as in a separate series? .. well it fixes block job code so I
think it belongs in this series.

I've pushed patches 2,3,4,6 and 7 and will follow up with the rest in
V3.

Thanks for the review.

Peter


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 07/11] qemu: blockPivot: Don't pause the VM any more since we don't use drive-reopen

2015-04-08 Thread John Ferlan


On 04/01/2015 01:20 PM, Peter Krempa wrote:
 Support for drive-reopen was never present in the upstream code so we
 don't need to pause the VM when doing the block pivot. Kill all the
 code related to this semi-upstream artifact.
 ---
  src/qemu/qemu_driver.c | 48 +---
  1 file changed, 5 insertions(+), 43 deletions(-)
 

ACK - although it seems to be outside the realm of .0 Refactor the
block job code...  IOW - should this have been a separate patch.

John

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


[libvirt] [PATCH 07/11] qemu: blockPivot: Don't pause the VM any more since we don't use drive-reopen

2015-04-01 Thread Peter Krempa
Support for drive-reopen was never present in the upstream code so we
don't need to pause the VM when doing the block pivot. Kill all the
code related to this semi-upstream artifact.
---
 src/qemu/qemu_driver.c | 48 +---
 1 file changed, 5 insertions(+), 43 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7c33ca3..44ee04f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16043,14 +16043,14 @@ qemuDiskPathToAlias(virDomainObjPtr vm, const char 
*path, int *idxret)
  * abort with pivot; this updates the VM definition as appropriate, on
  * either success or failure.  */
 static int
-qemuDomainBlockPivot(virConnectPtr conn,
- virQEMUDriverPtr driver, virDomainObjPtr vm,
- const char *device, virDomainDiskDefPtr disk)
+qemuDomainBlockPivot(virQEMUDriverPtr driver,
+ virDomainObjPtr vm,
+ const char *device,
+ virDomainDiskDefPtr disk)
 {
 int ret = -1, rc;
 qemuDomainObjPrivatePtr priv = vm-privateData;
 virDomainBlockJobInfo info;
-bool resume = false;
 virStorageSourcePtr oldsrc = NULL;
 virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);

@@ -16081,29 +16081,6 @@ qemuDomainBlockPivot(virConnectPtr conn,
 goto cleanup;
 }

-/* If we are using the older 'drive-reopen', we want to make sure
- * that management apps can tell whether the command succeeded,
- * even if libvirtd is restarted at the wrong time.  To accomplish
- * that, we pause the guest before drive-reopen, and resume it
- * only when we know the outcome; if libvirtd restarts, then
- * management will see the guest still paused, and know that no
- * guest I/O has caused the source and mirror to diverge.  XXX
- * With the newer 'block-job-complete', we need to use a
- * persistent bitmap to make things safe; so for now, we just
- * blindly pause the guest.  */
-if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE,
-QEMU_ASYNC_JOB_NONE)  0)
-goto cleanup;
-
-resume = true;
-if (!virDomainObjIsActive(vm)) {
-virReportError(VIR_ERR_INTERNAL_ERROR, %s,
-   _(guest unexpectedly quit));
-goto cleanup;
-}
-}
-
 /* For active commit, the mirror is part of the already labeled
  * chain.  For blockcopy, we previously labeled only the top-level
  * image; but if the user is reusing an external image that
@@ -16177,21 +16154,6 @@ qemuDomainBlockPivot(virConnectPtr conn,
 if (oldsrc)
 disk-src = oldsrc;

-if (resume  virDomainObjIsActive(vm) 
-qemuProcessStartCPUs(driver, vm, conn,
- VIR_DOMAIN_RUNNING_UNPAUSED,
- QEMU_ASYNC_JOB_NONE)  0) {
-virObjectEventPtr event = NULL;
-event = virDomainEventLifecycleNewFromObj(vm,
- VIR_DOMAIN_EVENT_SUSPENDED,
- VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
-if (event)
-qemuDomainEventQueue(driver, event);
-if (virGetLastError() == NULL) {
-virReportError(VIR_ERR_OPERATION_FAILED, %s,
-   _(resuming after drive-reopen failed));
-}
-}
 virObjectUnref(cfg);
 return ret;
 }
@@ -16295,7 +16257,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
 }

 if (disk-mirror  (flags  VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)) {
-ret = qemuDomainBlockPivot(conn, driver, vm, device, disk);
+ret = qemuDomainBlockPivot(driver, vm, device, disk);
 if (ret  0  async)
 goto endjob;
 goto waitjob;
-- 
2.2.2

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