qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre DERUMIER <aderumier@odiso.com>
To: Kashyap Chamarthy <kchamart@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ?
Date: Wed, 19 Apr 2017 14:28:46 +0200 (CEST)	[thread overview]
Message-ID: <111400435.11010636.1492604926409.JavaMail.zimbra@oxygem.tv> (raw)
In-Reply-To: <20170419104300.gousbztqfl5j4k7q@eukaryote>

Thanks I'll try. (I'm on 2.9.0-rc4)

can you send your initial qemu command line ?

also :

>>"execute":"blockdev-add", 
>>"arguments":{ 
>>"driver":"qcow2", 
>>"node-name":"node1",
...

then 


>>"execute":"blockdev-mirror", 
>>"arguments":{ 
>>"device":"foo", 
>>"job-id":"job-2", 
>>"target":"node2",    --> node2 ?  
>>"sync":"full" 


----- Mail original -----
De: "Kashyap Chamarthy" <kchamart@redhat.com>
À: "aderumier" <aderumier@odiso.com>
Cc: "qemu-devel" <qemu-devel@nongnu.org>
Envoyé: Mercredi 19 Avril 2017 12:43:00
Objet: Re: [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ?

On Wed, Apr 19, 2017 at 09:08:20AM +0200, Alexandre DERUMIER wrote: 
> Hi, 
> 
> I'm trying to implement blockdev-mirror, to replace drive-mirror as we 
> can pass more options with blockdev-mirror. 
> 
> 
> I would like to mirror an attached blockdev to a new blockdev, then 
> switch at the end of block-job-complete, like for drive-mirror. 

[...] 

> blockdev-mirror: 
> 
> {"arguments":{"job-id":"drive-virtio0","target":"tempmirror","sync":"full","replaces":"drive-virtio0","device":"drive-virtio0"},"execute":"blockdev-mirror"} 
> 
> (I have try with or without replaces option) 
> 
> then query-name-block-nodes, show vm-138-disk-2.raw file on tempmirror 
> "node-name", and vm-138-disk1.qcow2 on "drive-virtio0" node-name 
> 
> I expected that both was switched, like for drive-mirror. 

For me, 'blockdev-mirror' does do the switch when I issue 
'block-job-complete' (similar to 'drive-mirror') 

The below is my test from Git: 

I was here (on Git): 

$ git describe 
v2.9.0-rc5 

----------------------------------------------------------------------- 
$ qemu-img create -f qcow2 /export/target2.qcow2 1G 
Formatting '/export/target2.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 
----------------------------------------------------------------------- 
QMP> 
{ 
"execute":"blockdev-add", 
"arguments":{ 
"driver":"qcow2", 
"node-name":"node1", 
"file":{ 
"driver":"file", 
"filename":"/export/target2.qcow2" 
} 
} 
} 
{"return": {}} 
----------------------------------------------------------------------- 
QMP> 
{"execute":"query-named-block-nodes"} 
[...] 
----------------------------------------------------------------------- 
QMP> 
{ 
"execute":"blockdev-mirror", 
"arguments":{ 
"device":"foo", 
"job-id":"job-2", 
"target":"node2", 
"sync":"full" 
} 
} 
{"return": {}} 
{"timestamp": {"seconds": 1492598410, "microseconds": 35946}, "event": "BLOCK_JOB_READY", "data": {"device": "job-2", "len": 24182784, "offset": 24182784, "speed": 0, "type": "mirror"}} 
----------------------------------------------------------------------- 
QMP> 
{ 
"execute":"block-job-complete", 
"arguments":{ 
"device":"job-2" 
} 
} 
{"return": {}} 
{"timestamp": {"seconds": 1492598419, "microseconds": 115458}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "job-2", "len": 24182784, "offset": 24182784, "speed": 0, "type": "mirror"}} 
----------------------------------------------------------------------- 


[...] 


-- 
/kashyap 

  reply	other threads:[~2017-04-19 12:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  7:08 [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ? Alexandre DERUMIER
2017-04-19  9:02 ` Fam Zheng
2017-04-19  9:40   ` Alexandre DERUMIER
2017-04-19 10:43 ` Kashyap Chamarthy
2017-04-19 12:28   ` Alexandre DERUMIER [this message]
2017-04-19 12:58     ` Kashyap Chamarthy
2017-04-19 13:36       ` Alexandre DERUMIER
2017-04-19 13:48         ` Alexandre DERUMIER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=111400435.11010636.1492604926409.JavaMail.zimbra@oxygem.tv \
    --to=aderumier@odiso.com \
    --cc=kchamart@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).