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 15:36:48 +0200 (CEST) [thread overview]
Message-ID: <708656279.11020244.1492609008406.JavaMail.zimbra@oxygem.tv> (raw)
In-Reply-To: <20170419125801.ort44uiuepmklm5j@eukaryote>
Ok, I have same result than my test:
{"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 1073741824, "filename": "base.raw", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "node1", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "base.qcow2, "encryption_key_missing": false}, {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 1073741824, "filename": "base.qcow2", "format": "file", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block194", "backing_file_depth": 0, "drv": "file", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "base.qcow2", "encryption_key_missing": false},
{"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 1073741824, "filename": "target.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": 352256, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "foo", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "target.qcow2", "encryption_key_missing": false}, {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 1074135040, "filename": "target.qcow2", "format": "file", "actual-size": 352256, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block008", "backing_file_depth": 0, "drv": "file", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "target.qcow2", "encryption_key_missing": false}]}
What I don't understand is how do you map device to the blockdev ?
qemu doc said something like
-device virtio-blk,drive=blk0 where blk0 is the nodename.
but when I blockdev-mirror, the target blockdev has a new nodename.
So how does it work ?
----- Mail original -----
De: "Kashyap Chamarthy" <kchamart@redhat.com>
À: "aderumier" <aderumier@odiso.com>
Cc: "qemu-devel" <qemu-devel@nongnu.org>
Envoyé: Mercredi 19 Avril 2017 14:58:01
Objet: Re: [Qemu-devel] blockdev-mirror , how to replace old nodename by new nodename ?
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
>
next prev parent reply other threads:[~2017-04-19 13:37 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
2017-04-19 13:36 ` Alexandre DERUMIER [this message]
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=708656279.11020244.1492609008406.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).