qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 5/6] qmp: Add blockdev-mirror command


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v2 5/6] qmp: Add blockdev-mirror command
Date: Mon, 20 Jul 2015 17:33:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 25.06.2015 05:22, Fam Zheng wrote:
This will start a mirror job from a named device to another named
device, its relation with drive-mirror is similar with blockdev-backup
to drive-backup.

In blockdev-mirror, the target node should be prepared by blockdev-add,
which will be responsible for assigning a name to the new node, so
'node-name' in drive-mirror is dropped.

Signed-off-by: Fam Zheng <address@hidden>
---
  blockdev.c           | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
  qapi/block-core.json | 47 ++++++++++++++++++++++++++++++++++++++++
  qmp-commands.hx      | 48 +++++++++++++++++++++++++++++++++++++++++
  3 files changed, 156 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index de6383f..e0dba07 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2932,6 +2932,10 @@ static void blockdev_mirror_common(BlockDriverState *bs,
      if (bdrv_op_is_blocked(target, BLOCK_OP_TYPE_MIRROR_TARGET, errp)) {
          return;
      }
+    if (target->blk) {
+        error_setg(errp, "Cannot mirror to an attached block device");
+        return;
+    }

1) Why?

2) I think this should be noted in the QMP interface documentation. "the name of the device to mirror to" sounds like it is actually meant to be an attached block device.

Max



reply via email to

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