qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v2 5/6] replication: Implement block replica


From: Hailiang Zhang
Subject: Re: [Qemu-devel] [PATCH RFC v2 5/6] replication: Implement block replication for shared disk case
Date: Wed, 18 Jan 2017 14:53:08 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Hi Stefan,

On 2017/1/17 21:19, Stefan Hajnoczi wrote:
On Mon, Dec 05, 2016 at 04:35:03PM +0800, zhanghailiang wrote:
@@ -663,8 +695,12 @@ static void replication_stop(ReplicationState *rs, bool 
failover, Error **errp)

      switch (s->mode) {
      case REPLICATION_MODE_PRIMARY:
-        s->replication_state = BLOCK_REPLICATION_DONE;
-        s->error = 0;
+        if (s->is_shared_disk && s->primary_disk->bs->job) {
+            block_job_cancel(s->primary_disk->bs->job);

Should this be block_job_cancel_sync()?


No, here it is different from the secondary side which needs to wait
until backup job been canceled before resumes to run (Or there will be
an error, https://patchwork.kernel.org/patch/9128841/).

For primary VM, Just as you can see the design scenario in patch 1,
It accesses the shared disk directly, the backup job whose source side
is just the shared disk does not influence primary VM's running,
So IMHO, it is safe to call block_job_cancel here.

Thanks,
Hailiang


+        } else {
+            s->replication_state = BLOCK_REPLICATION_DONE;
+            s->error = 0;
+        }
          break;
      case REPLICATION_MODE_SECONDARY:
          /*
--
1.8.3.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]