From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bptIl-000091-BY for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bptIg-00081z-Cu for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:36:15 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bptIg-00081n-5Y for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:36:10 -0400 Received: by mail-wm0-x244.google.com with SMTP id p138so2355257wmb.0 for ; Fri, 30 Sep 2016 01:36:09 -0700 (PDT) Date: Fri, 30 Sep 2016 09:36:06 +0100 From: Stefan Hajnoczi Message-ID: <20160930083606.GA5411@stefanha-x1.localdomain> References: <1475035789-685-1-git-send-email-ashish.mittal@veritas.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <1475035789-685-1-git-send-email-ashish.mittal@veritas.com> Subject: Re: [Qemu-devel] [PATCH v7 RFC] block/vxhs: Initial commit to add Veritas HyperScale VxHS block device support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashish Mittal Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, kwolf@redhat.com, armbru@redhat.com, berrange@redhat.com, jcody@redhat.com, famz@redhat.com, ashish.mittal@veritas.com, Ketan.Nilangekar@veritas.com, Abhijit.Dey@veritas.com --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 27, 2016 at 09:09:49PM -0700, Ashish Mittal wrote: > This patch adds support for a new block device type called "vxhs". > Source code for the library that this code loads can be downloaded from: > https://github.com/MittalAshish/libqnio.git The QEMU block driver should deal with BlockDriver<->libqnio integration and libqnio should deal with vxhs logic (network protocol, failover, etc). Right now the vxhs logic is spread between both components. If responsibilities aren't cleanly separated between QEMU and libqnio then I see no point in having libqnio. Failover code should move into libqnio so that programs using libqnio avoid duplicating the failover code. Similarly IIO_IO_BUF_SIZE/segments should be handled internally by libqnio so programs using libqnio do not duplicate this code. libqnio itself can be simplified significantly: The multi-threading is not necessary and adds complexity. Right now there seem to be two reasons for multi-threading: shared contexts and the epoll thread. Both can be eliminated as follows. Shared contexts do not make sense in a multi-disk, multi-core environment. Why is it advantages to tie disks to a single context? It's simpler and more multi-core friendly to let every disk have its own connection. The epoll thread forces library users to use thread synchronization when processing callbacks. Look at libiscsi for an example of how to eliminate it. Two APIs are defined: int iscsi_get_fd(iscsi) and int iscsi_which_events(iscsi) (e.g. POLLIN, POLLOUT). The program using the library can integrate the fd into its own event loop. The advantage of doing this is that no library threads are necessary and all callbacks are invoked from the program's event loop. Therefore no thread synchronization is needed. If you make these changes then all multi-threading in libqnio and the QEMU block driver can be dropped. There will be less code and it will be simpler. --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJX7iP2AAoJEJykq7OBq3PIzR0IAKK8idzOTpFZMQKUp16UHv8e 8/Gekkq9wHmnlP4uODPdUQ5XdG3cTjv4iWuRqCfTUAwD3Uiy5qr6dK5hJ/SLS1/o li1XYEictF5+RS8eUDwccx6eIGu7Q1mxmfpFqyAoYwz9Gpvh7mWhy5OjfPHcWZHi ik1CUFohkMfwl5LG+fuij58qxnnsbzSZCDnrDxmim8Bt15wZvFcbws+Lxg6zUVYb VnXfUm83BPo5+tZWi5Q1khDtoFWx1DDvbUzkL0ra0GVt9CTWYs/I88Lww7rXipbN k+FnJLvndKAhs5/qBCGB/dO7njQWAshjstOx6KwM2Tj052lqLjGsVZFUCqcV1qA= =xdXR -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8--