[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH RFC 05/51] qemu: blockjob: Rename public APIs



All the public APIs of the qemu_blockjob module operate on a 'disk'.
Since I'll be adding APIs which operate on a job later let's rename the
existing ones.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
 src/qemu/qemu_blockjob.c  | 28 ++++++++++++++--------------
 src/qemu/qemu_blockjob.h  | 16 ++++++++--------
 src/qemu/qemu_driver.c    | 10 +++++-----
 src/qemu/qemu_migration.c | 20 ++++++++++----------
 4 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 32fa9876b5..8b51235795 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -197,7 +197,7 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,


 /**
- * qemuBlockJobUpdate:
+ * qemuBlockJobUpdateDisk:
  * @vm: domain
  * @disk: domain disk
  * @error: error (output parameter)
@@ -208,10 +208,10 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
  * Returns the block job event processed or -1 if there was no pending event.
  */
 int
-qemuBlockJobUpdate(virDomainObjPtr vm,
-                   qemuDomainAsyncJob asyncJob,
-                   virDomainDiskDefPtr disk,
-                   char **error)
+qemuBlockJobUpdateDisk(virDomainObjPtr vm,
+                       qemuDomainAsyncJob asyncJob,
+                       virDomainDiskDefPtr disk,
+                       char **error)
 {
     qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -236,20 +236,20 @@ qemuBlockJobUpdate(virDomainObjPtr vm,


 /**
- * qemuBlockJobSyncBegin:
+ * qemuBlockJobSyncBeginDisk:
  * @disk: domain disk
  *
  * Begin a new synchronous block job for @disk. The synchronous
- * block job is ended by a call to qemuBlockJobSyncEnd, or by
+ * block job is ended by a call to qemuBlockJobSyncEndDisk, or by
  * the guest quitting.
  *
  * During a synchronous block job, a block job event for @disk
  * will not be processed asynchronously. Instead, it will be
- * processed only when qemuBlockJobUpdate or qemuBlockJobSyncEnd
+ * processed only when qemuBlockJobUpdateDisk or qemuBlockJobSyncEndDisk
  * is called.
  */
 void
-qemuBlockJobSyncBegin(virDomainDiskDefPtr disk)
+qemuBlockJobSyncBeginDisk(virDomainDiskDefPtr disk)
 {
     qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);

@@ -260,7 +260,7 @@ qemuBlockJobSyncBegin(virDomainDiskDefPtr disk)


 /**
- * qemuBlockJobSyncEnd:
+ * qemuBlockJobSyncEndDisk:
  * @vm: domain
  * @disk: domain disk
  *
@@ -268,11 +268,11 @@ qemuBlockJobSyncBegin(virDomainDiskDefPtr disk)
  * for the disk is processed.
  */
 void
-qemuBlockJobSyncEnd(virDomainObjPtr vm,
-                    qemuDomainAsyncJob asyncJob,
-                    virDomainDiskDefPtr disk)
+qemuBlockJobSyncEndDisk(virDomainObjPtr vm,
+                        qemuDomainAsyncJob asyncJob,
+                        virDomainDiskDefPtr disk)
 {
     VIR_DEBUG("disk=%s", disk->dst);
-    qemuBlockJobUpdate(vm, asyncJob, disk, NULL);
+    qemuBlockJobUpdateDisk(vm, asyncJob, disk, NULL);
     QEMU_DOMAIN_DISK_PRIVATE(disk)->blockJobSync = false;
 }
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index c14d26a6a1..9f7677dc1e 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -26,14 +26,14 @@
 # include "qemu_conf.h"
 # include "qemu_domain.h"

-int qemuBlockJobUpdate(virDomainObjPtr vm,
-                       qemuDomainAsyncJob asyncJob,
-                       virDomainDiskDefPtr disk,
-                       char **error);
+int qemuBlockJobUpdateDisk(virDomainObjPtr vm,
+                           qemuDomainAsyncJob asyncJob,
+                           virDomainDiskDefPtr disk,
+                           char **error);

-void qemuBlockJobSyncBegin(virDomainDiskDefPtr disk);
-void qemuBlockJobSyncEnd(virDomainObjPtr vm,
-                         qemuDomainAsyncJob asyncJob,
-                         virDomainDiskDefPtr disk);
+void qemuBlockJobSyncBeginDisk(virDomainDiskDefPtr disk);
+void qemuBlockJobSyncEndDisk(virDomainObjPtr vm,
+                             qemuDomainAsyncJob asyncJob,
+                             virDomainDiskDefPtr disk);

 #endif /* __QEMU_BLOCKJOB_H__ */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c582e255a2..1b2a2d70ec 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4736,7 +4736,7 @@ processBlockJobEvent(virQEMUDriverPtr driver,
     diskPriv->blockJobType = type;
     diskPriv->blockJobStatus = status;

-    qemuBlockJobUpdate(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
+    qemuBlockJobUpdateDisk(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);

  endjob:
     qemuDomainObjEndJob(driver, vm);
@@ -17361,7 +17361,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
     }

     if (!async)
-        qemuBlockJobSyncBegin(disk);
+        qemuBlockJobSyncBeginDisk(disk);

     if (pivot) {
         if ((ret = qemuDomainBlockPivot(driver, vm, device, disk)) < 0)
@@ -17400,19 +17400,19 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
      * scheduled block jobs from confusing us. */
     if (!async) {
         qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
-        qemuBlockJobUpdate(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
+        qemuBlockJobUpdateDisk(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
         while (diskPriv->blockjob) {
             if (virDomainObjWait(vm) < 0) {
                 ret = -1;
                 goto endjob;
             }
-            qemuBlockJobUpdate(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
+            qemuBlockJobUpdateDisk(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
         }
     }

  endjob:
     if (disk)
-        qemuBlockJobSyncEnd(vm, QEMU_ASYNC_JOB_NONE, disk);
+        qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_NONE, disk);
     qemuDomainObjEndJob(driver, vm);

  cleanup:
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a0b622d2ea..8720b34311 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -490,7 +490,7 @@ qemuMigrationSrcNBDStorageCopyReady(virDomainObjPtr vm,
         if (!diskPriv->migrating)
             continue;

-        status = qemuBlockJobUpdate(vm, asyncJob, disk, &error);
+        status = qemuBlockJobUpdateDisk(vm, asyncJob, disk, &error);
         if (status == VIR_DOMAIN_BLOCK_JOB_FAILED) {
             if (error) {
                 virReportError(VIR_ERR_OPERATION_FAILED,
@@ -549,7 +549,7 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm,
         if (!diskPriv->migrating)
             continue;

-        status = qemuBlockJobUpdate(vm, asyncJob, disk, &error);
+        status = qemuBlockJobUpdateDisk(vm, asyncJob, disk, &error);
         switch (status) {
         case VIR_DOMAIN_BLOCK_JOB_FAILED:
             if (check) {
@@ -566,7 +566,7 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm,
             ATTRIBUTE_FALLTHROUGH;
         case VIR_DOMAIN_BLOCK_JOB_CANCELED:
         case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
-            qemuBlockJobSyncEnd(vm, asyncJob, disk);
+            qemuBlockJobSyncEndDisk(vm, asyncJob, disk);
             diskPriv->migrating = false;
             break;

@@ -630,7 +630,7 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
     int status;
     int rv;

-    status = qemuBlockJobUpdate(vm, asyncJob, disk, &error);
+    status = qemuBlockJobUpdateDisk(vm, asyncJob, disk, &error);
     switch (status) {
     case VIR_DOMAIN_BLOCK_JOB_FAILED:
     case VIR_DOMAIN_BLOCK_JOB_CANCELED:
@@ -712,7 +712,7 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver,
                     err = virSaveLastError();
                 failed = true;
             }
-            qemuBlockJobSyncEnd(vm, asyncJob, disk);
+            qemuBlockJobSyncEndDisk(vm, asyncJob, disk);
             diskPriv->migrating = false;
         }
     }
@@ -954,7 +954,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver,
         if (!(diskAlias = qemuAliasDiskDriveFromDisk(disk)))
             goto cleanup;

-        qemuBlockJobSyncBegin(disk);
+        qemuBlockJobSyncBeginDisk(disk);

         if (flags & VIR_MIGRATE_TLS) {
             rc = qemuMigrationSrcNBDStorageCopyBlockdev(driver, vm,
@@ -971,7 +971,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver,
         }

         if (rc < 0) {
-            qemuBlockJobSyncEnd(vm, QEMU_ASYNC_JOB_MIGRATION_OUT, disk);
+            qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_MIGRATION_OUT, disk);
             goto cleanup;
         }

@@ -5355,7 +5355,7 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver,
     for (i = 0; i < vm->def->ndisks; i++) {
         virDomainDiskDefPtr disk = vm->def->disks[i];
         if (QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating) {
-            qemuBlockJobSyncBegin(disk);
+            qemuBlockJobSyncBeginDisk(disk);
             storage = true;
         }
     }
@@ -5385,7 +5385,7 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver,
             VIR_DEBUG("Drive mirror on disk %s is still running", disk->dst);
         } else {
             VIR_DEBUG("Drive mirror on disk %s is gone", disk->dst);
-            qemuBlockJobSyncEnd(vm, QEMU_ASYNC_JOB_NONE, disk);
+            qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_NONE, disk);
             diskPriv->migrating = false;
         }
     }
@@ -5407,7 +5407,7 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver,
             qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);

             if (diskPriv->migrating) {
-                qemuBlockJobSyncEnd(vm, QEMU_ASYNC_JOB_NONE, disk);
+                qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_NONE, disk);
                 diskPriv->migrating = false;
             }
         }
-- 
2.19.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]