All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kashyap Chamarthy <kchamart@redhat.com>
To: Alexandre DERUMIER <aderumier@odiso.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:58:01 +0200	[thread overview]
Message-ID: <20170419125801.ort44uiuepmklm5j@eukaryote> (raw)
In-Reply-To: <111400435.11010636.1492604926409.JavaMail.zimbra@oxygem.tv>

On Wed, Apr 19, 2017 at 02:28:46PM +0200, Alexandre DERUMIER wrote:
> Thanks I'll try. (I'm on 2.9.0-rc4)
> 
> can you send your initial qemu command line ?

    $ ~/build/qemu-upstream/x86_64-softmmu/qemu-system-x86_64 \
		-display none -nodefconfig -nodefaults -m 512 \
		-device virtio-scsi-pci,id=scsi -device virtio-serial-pci \
		-blockdev node-name=foo,driver=qcow2,file.driver=file,file.filename=./base.qcow2 \
		-monitor stdio -qmp unix:./qmp-sock,server,nowait

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

Oops, it should be 'node2'.  Copy / paste mistake, sorry.

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

With the above copy / paste error I noted in the `blockdev-add` command,
the commands I noted in my previous email should work as expected.

Regards,
Kashyap

> ----- 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:58 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
2017-04-19 12:58     ` Kashyap Chamarthy [this message]
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=20170419125801.ort44uiuepmklm5j@eukaryote \
    --to=kchamart@redhat.com \
    --cc=aderumier@odiso.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.