qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Benoît Canet" <benoit.canet@irqsave.net>,
	"Fam Zheng" <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] block: Introduce "null" driver
Date: Thu, 28 Aug 2014 16:21:54 -0600	[thread overview]
Message-ID: <53FFAB82.7060801@redhat.com> (raw)
In-Reply-To: <53FFAA1D.8020505@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2191 bytes --]

On 08/28/2014 04:15 PM, Eric Blake wrote:
> On 08/28/2014 01:42 PM, Paolo Bonzini wrote:
>> Il 28/08/2014 17:52, Eric Blake ha scritto:
>>> have a '*coroutine':'bool' flag here that chooses between the null: and
>>> the null-co: protocol.  (I suspect we would do the same when finaly
>>> adding gluster to BlockdevOptions: rather than having 'gluster+tcp' and
>>> 'gluster+udp', it would be a single 'gluster' element that can then
>>> select transport of tcp vs. udp as an option).
>>
>> I'm not sure it's possible in the case of null, since the two
>> BlockDriver structs have different function pointers.  Instead, gluster
>> has the same function pointers and just multiple names to trigger the
>> parsing of all the URI schemes.

Answering myself:

I read this paragraph without reading the code, and thought you were
talking about "null" having '.func = null_plain' vs. "null_co" having
'.func = null_co' (ie. each driver having different functions
registered, but in the same slots).

> 
> But why can't you write a single driver, where each function in the
> driver then bases a decision between one of the two original functions
> based on the configuration?  Is it a case where the set of callback
> functions differs with one driver having a NULL callback where the other
> does not, and where the presence or absence of the NULL callback
> actually matters to the point of requiring two drivers?

But now that I read the patch, I see my answer is yes, it DOES matter
where the NULL pointers are.

"null" has
+    .bdrv_aio_readv         = null_aio_readv,
+    .bdrv_aio_writev        = null_aio_writev,
+    .bdrv_aio_flush         = null_aio_flush,

while "null_co" has
+    .bdrv_read              = null_co_read,
+    .bdrv_write             = null_co_write,
+    .bdrv_co_flush_to_disk  = null_co_flush,

and the block driver code under test behaves differently depending on
which of those callbacks is NULL, where we want to test both behaviors.
 So it sounds like we really do want two separate QMP driver additions.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-08-28 22:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28  5:53 [Qemu-devel] [PATCH v3] block: Introduce "null" driver Fam Zheng
2014-08-28 15:22 ` Benoît Canet
2014-08-28 15:52   ` Eric Blake
2014-08-28 19:42     ` Paolo Bonzini
2014-08-28 22:15       ` Eric Blake
2014-08-28 22:21         ` Eric Blake [this message]
2014-08-29  0:45   ` Fam Zheng
2014-08-28 22:23 ` Eric Blake
2014-08-29  0:55   ` Fam Zheng
2014-08-29  6:48     ` Markus Armbruster
2014-09-03 11:10     ` Kevin Wolf
2014-09-03 12:34       ` Eric Blake
2014-09-03 12:48         ` Markus Armbruster

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=53FFAB82.7060801@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).