All of lore.kernel.org
 help / color / mirror / Atom feed
From: LKML <xiaojun.zhao141@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: zhao xiaojun <xiaojun.zhao141@gmail.com>,
	John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, Qemu-block <qemu-block@nongnu.org>
Subject: Re: Can not use hmp block_resize command with -blockdev option
Date: Fri, 19 Mar 2021 00:55:51 +0800	[thread overview]
Message-ID: <20210319004905.788b2ba3@slime> (raw)
In-Reply-To: <YFN9LtEBpVsykSwV@merkur.fritz.box>

On Thu, 18 Mar 2021 17:17:50 +0100
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 18.03.2021 um 16:15 hat zhao xiaojun geschrieben:
> > Thanks you, that's really good idea. And I also have the following
> > question:
> > 
> > There are some hmp and qmp commands in my scripts, they need the
> > device as an argument. Recently. i used the -blockdev replace the
> > -drive to specify the disk drive, then use  qmp's query_block to
> > query the device, but the device is NULL string. For the hmp's
> > block_resize, I can use qmp's block_resize do. But the other
> > commands(qpm's block-job-cancel etc.), they only support the device
> > argument. So I can only continue to use -drive to specify disk
> > drive.
> > 
> > I was trying to see the source(qemu v5.1.0):
> > qmp_query_device()  
> >   -> bdrv_query_info()  
> >       info->device = g_strdup(blk_name(blk))
> > the device is set to blk_name(blk), and the blk->name is set in
> > the monitor_add_blk()
> > 
> > the -blockdev:
> > qmp_blockdev_add()  
> >    -> bds_tree_init()
> >      -> bdrv_open()  
> >    ...
> > the qmp_blockdev_add() doesn't call the monitor_add_blk().
> > 
> > Questions:
> > Why can not qmp_blockdev_add() call the monitor_add_blk()?
> > Will the hmp and qmp commands that only support device as an
> > argument be compat with the -blockdev option?  
> 
> QMP doesn't have such commands. For commands that operate on the
> frontend (the guest device), they accept the id of the -device. For
> commands that relate to the backend, you can specify node-name.
> 
> It's only HMP that may not support these alternatives in some places.
> We can just extend it.
> 
> Kevin
> 

Ok, thank you very much.

Regards.


      reply	other threads:[~2021-03-18 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  3:43 Can not use hmp block_resize command with -blockdev option zhao xiaojun
2021-03-17 22:49 ` John Snow
2021-03-18 10:50   ` Kevin Wolf
2021-03-18 15:15     ` zhao xiaojun
2021-03-18 16:17       ` Kevin Wolf
2021-03-18 16:55         ` LKML [this message]

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=20210319004905.788b2ba3@slime \
    --to=xiaojun.zhao141@gmail.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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.