qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Amar Tumballi <atumball@redhat.com>,
	Mike Christie <mchristi@redhat.com>,
	Prasanna Kalever <pkalever@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Xiubo Li <xiubli@redhat.com>,
	Fam Zheng <fam@euphon.net>, stefanha <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] tcmu: Introduce qemu-tcmu utility
Date: Fri, 8 Mar 2019 15:22:30 +0800	[thread overview]
Message-ID: <20190308072230.GA9529@byw> (raw)
In-Reply-To: <20190307112505.GB5786@linux.fritz.box>

> > > * The first priority should be adding an in-process iscsi target that
> > >   can be managed with QMP, similar to the built-in NBD server.
> > 
> > Well, people used to manage iscsi targets through targetcli, a command
> > line utility. Our intention is, with targetcli and qemu-tcmu, user can
> > create/remove targets and backstores totally in just one place, so you
> > don't need to create targets in targetcli and then turn to configure
> > backstores in qemu-tcmu with QMP or command line, it's convenient.  So
> > we decide to implement QMP in the future release but it's definitely
> > in our plan.
> 
> I think QMP needs to come first to result in a clean design, because the
> command line tool should only be a wrapper around the QMP code.

Yeah, i agree this makes more sense from this point. Ok, i'll try to
implement it in v2 as your suggestion. Thanks.

> But anyway, I still think the change I had in mind is necessary. Maybe
> you can see the difference best in an example. Your documentation says
> to use this:
> 
>     # qemu-tcmu
>     # targetcli /backstores/user:qemu create qemulun 1G @id=test@file=/root/test.file

Let's call this one case1.

> 
> I think it should work more like this:
> 
>     # qemu-tcmu -blockdev driver=file,filename=/root/test.file,node-name=my_file \
>                 -export my_export,node=my_file
>     # targetcli /backstores/user:qemu create qemulun 1G my_export

And this one case2.

> 
> In fact, something like this is probably required if we want to export
> existing block nodes (that may be in use by a guest) from a running QEMU
> instance. In this case, you don't want to open a new image file, but
> export the already opened image file.

I think the main difference between these two cases is just how the configuration
of exported image file is passed to qemu-tcmu. Case1 uses cfgstr while case2
uses command line. Case2 still needs one way to check whether the passed-in
image file was opened, right? If so, case1 should also be able to use the same
way to check that after extracting cfgstr. 

Actually we thought about qemu-tcmu working like case2, but felt is's quite less
flexible. With case2, e.g. when we want to export another new image file with
one qemu-tcmu already running, we have to run another qemu-tcmu with
the configuration of the new image file in commandline, or through QMP of the
running qemu-tcmu, and then configure it with targetcli. So anyway,
there's one more step for case2 to export a new image file. While for case1 
you just need to run qemu-tcmu once and all other operations will be done
within targetcli, which is more friendly to users i think.

So i think qemu-tcmu's quite different from qemu-nbd at this point. We can
export a image file by NBD protocol just with qemu-nbd itself. While for
qemu-tcmu we still need targetcli to complete other ISCSI target
configurations to export a image file. So moving the configuration of image
file from cmdline to targetcli should be reasonable in my opinion.

> 
> (Also, can we somehow get rid of the 1G in the command line? qemu-tcmu
> knows how big the image is and can provide this value.)

Currently this size option is mandatory in targetcli, not all tools are
so smart as QEMU. But maybe we could change it optional in the future.

  reply	other threads:[~2019-03-08  7:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 10:16 [Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility Yaowei Bai
2018-12-26  7:59 ` no-reply
2018-12-26  8:19 ` no-reply
2019-01-02  1:53   ` Yaowei Bai
2019-03-06 21:56 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2019-03-07  8:20   ` Yaowei Bai
2019-03-07  8:44   ` Yaowei Bai
2019-03-07 11:25     ` Kevin Wolf
2019-03-08  7:22       ` Yaowei Bai [this message]
2019-03-08 10:08         ` Kevin Wolf
2019-03-09  1:46           ` Yaowei Bai
2019-03-11 11:06             ` Kevin Wolf
2019-03-12  2:18               ` Fam Zheng
2019-03-07 10:22   ` Stefan Hajnoczi
2019-03-07 10:34     ` Kevin Wolf
2019-03-11  9:55       ` Stefan Hajnoczi

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=20190308072230.GA9529@byw \
    --to=baiyaowei@cmss.chinamobile.com \
    --cc=atumball@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mchristi@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pkalever@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiubli@redhat.com \
    /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).