qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 8/9] blockdev: add x-blockdev-set-iothread testi


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 8/9] blockdev: add x-blockdev-set-iothread testing command
Date: Wed, 6 Dec 2017 11:29:26 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Tue, Dec 05, 2017 at 08:40:42AM -0600, Eric Blake wrote:
> On 12/05/2017 04:41 AM, Stefan Hajnoczi wrote:
> > +##
> > +# @x-blockdev-set-iothread:
> > +#
> > +# Move @node and its children into the @iothread.  If @iothread is empty 
> > then
> > +# move @node and its children into the main loop.
> > +#
> > +# The node must not be attached to a BlockBackend.
> > +#
> > +# @node-name: the name of the block driver node
> > +#
> > +# @iothread: the name of the IOThread object
> > +#
> 
> > +# 2. Move a node into the main loop
> > +# -> { "execute": "x-blockdev-set-iothread",
> > +#      "arguments": { "node-name": "disk1",
> > +#                     "iothread": "" } }
> 
> Eww. Special casing of the empty string.  Would it be better design to
> have iothread be optional, and to omit it to move a node into the main
> loop?  Or use the StrOrNull type to allow JSON null instead of "" to
> mean the main loop?

I deliberated about this and chose the empty string because it has
special meaning in other QMP commands too.  But I agree that it's ugly.

StrOrNull is cleaner than using the empty string.  Making it optional
feels strange to me so I'll switch to StrOrNull.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]