From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN7zF-0008Vd-E6 for qemu-devel@nongnu.org; Thu, 28 Aug 2014 18:16:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XN7z9-0007WM-CG for qemu-devel@nongnu.org; Thu, 28 Aug 2014 18:16:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN7z9-0007WH-3Z for qemu-devel@nongnu.org; Thu, 28 Aug 2014 18:16:03 -0400 Message-ID: <53FFAA1D.8020505@redhat.com> Date: Thu, 28 Aug 2014 16:15:57 -0600 From: Eric Blake MIME-Version: 1.0 References: <1409205191-11406-1-git-send-email-famz@redhat.com> <20140828152224.GA4970@irqsave.net> <53FF5040.1020608@redhat.com> <53FF8621.3040201@redhat.com> In-Reply-To: <53FF8621.3040201@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a7DNFc2UJDWx7lnBBDrELW9gcQAQk4l0W" Subject: Re: [Qemu-devel] [PATCH v3] block: Introduce "null" driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , Fam Zheng Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --a7DNFc2UJDWx7lnBBDrELW9gcQAQk4l0W Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: an= d >> the null-co: protocol. (I suspect we would do the same when finaly >> adding gluster to BlockdevOptions: rather than having 'gluster+tcp' an= d >> 'gluster+udp', it would be a single 'gluster' element that can then >> select transport of tcp vs. udp as an option). >=20 > 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. 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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --a7DNFc2UJDWx7lnBBDrELW9gcQAQk4l0W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT/6odAAoJEKeha0olJ0NqrLEH/0Krdid5cRXIQicfMMzQDj2V DZ7WJ3WyEQDVrLQMSRykR9rh2PEZgibmuVSUL5Y8dOFJ4NRzZrdBLXpSDEVlwNt5 DopVpQciRty54miRVNCMdExDNOynS3eJAcCYhIerfVWj7F7y0qZFJvZbBqjGIdnN eDWKJ5s4qBKaTgxrz/fA8qw42HyC+SB4kCrk/qGtnsV8XH/fYBmZRmDFpNvRdaSf b6MG91/4yLBN/seu4JrWZ0eqxSuCsjVCrpPy3tokDSnjVvX+VwrlQtK3V+XWCuwN v9wVKrk5oo4bk5611PDEJyR+zHDviwFQsFK5NoLtTvnBVuhdKSr5DvIfzQ5v7j0= =e6R8 -----END PGP SIGNATURE----- --a7DNFc2UJDWx7lnBBDrELW9gcQAQk4l0W--