qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/6] replication: add shared-dis


From: Hailiang Zhang
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/6] replication: add shared-disk and shared-disk-id options
Date: Mon, 17 Apr 2017 14:31:53 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 2017/4/12 22:28, Eric Blake wrote:
On 04/12/2017 09:05 AM, zhanghailiang wrote:
We use these two options to identify which disk is
shared

Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Wen Congyang <address@hidden>
Signed-off-by: Zhang Chen <address@hidden>
---
v4:
- Add proper comment for primary_disk (Stefan)
v2:
- Move g_free(s->shared_disk_id) to the common fail process place (Stefan)
- Fix comments for these two options
---
+++ b/qapi/block-core.json
@@ -2661,12 +2661,20 @@
  #          node who owns the replication node chain. Must not be given in
  #          primary mode.
  #
+# @shared-disk-id: Id of shared disk while is replication mode, if @shared-disk
+#                  is true, this option is required (Since: 2.10)
+#
+# @shared-disk: To indicate whether or not a disk is shared by primary VM
+#               and secondary VM. (The default is false) (Since: 2.10)
+#
  # Since: 2.9
  ##
  { 'struct': 'BlockdevOptionsReplication',
    'base': 'BlockdevOptionsGenericFormat',
    'data': { 'mode': 'ReplicationMode',
-            '*top-id': 'str' } }
+            '*top-id': 'str',
+            '*shared-disk-id': 'str',
+            '*shared-disk': 'bool' } }
Do we need a separate bool and string? Or is it sufficient to say that
if shared-disk is omitted, we are not sharing, and that if a shared-disk
string is present, then we are sharing and it names the id of the shared
disk.

Er,  Yes, We need both of them, the command line of secondary sides is like:

 -drive if=virtio,id=active-disk0,driver=replication,mode=secondary,\
        file.driver=qcow2,top-id=active-disk0,\
        file.file.filename=/mnt/ramfs/active_disk.img,\
        file.backing=hidden_disk0,shared-disk=on
We only need the bool shared-disk to indicate whether disk is sharing or not, 
but
for primary side, we need to the blockdev-add command to tell primary which 
disk is shared.
  { 'execute': 'blockdev-add',
    'arguments': {
        'driver': 'replication',
        'node-name': 'rep',
        'mode': 'primary',
        'shared-disk-id': 'primary_disk0',
        'shared-disk': true,
        'file': {
            'driver': 'nbd',
            'export': 'hidden_disk0',
            'server': {
                'type': 'inet',
                'data': {
                    'host': 'xxx.xxx.xxx.xxx',
                    'port': 'yyy'
                }
            }
        }
     }
  }






reply via email to

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