From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK7Cs-0000jl-Kn for qemu-devel@nongnu.org; Mon, 25 Mar 2013 09:13:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK7Cq-00048m-T1 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 09:12:58 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:47477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK7Cq-00048h-Ow for qemu-devel@nongnu.org; Mon, 25 Mar 2013 09:12:56 -0400 Received: by mail-qa0-f46.google.com with SMTP id k4so1669115qaq.12 for ; Mon, 25 Mar 2013 06:12:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130325123234.GB26045@rhmail.home.annexia.org> References: <1363873138-30568-1-git-send-email-rjones@redhat.com> <1363873138-30568-2-git-send-email-rjones@redhat.com> <20130322130455.GI1504@rhmail.home.annexia.org> <20130325123234.GB26045@rhmail.home.annexia.org> Date: Mon, 25 Mar 2013 14:12:56 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH] block/curl: Add support for Secure Shell (ssh/sftp) block device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel On Mon, Mar 25, 2013 at 1:32 PM, Richard W.M. Jones wrote: > On Fri, Mar 22, 2013 at 01:04:55PM +0000, Richard W.M. Jones wrote: >> I got it working with Curl, patch attached. >> >> However there are multiple issues (these are mainly notes for myself): >> >> (1) libcurl cannot read the size of the file. I had to hard-code >> this. This is probably just a shortcoming of libcurl (libssh2/sftp >> itself can read the size of files). Will try to work on a patch for >> upstream. > > After my holiday and in the cold of day I've had a long look at the > SFTP implementation in libcurl. > > https://github.com/bagder/curl/blob/master/lib/ssh.c > > It's implemented as a huge state machine and simply implementing (1) > above is problematic (I believe we would have to reopen the connection > after our call to curl_easy_perform). > > The larger issue is that the qemu curl block driver doesn't support > writes. Now these could in theory be added. Indeed curl does support > "random access" writes, although AFAICT you have to open a new > connection each time you want to seek backwards, and you can't read > and write over the same connection (so you'd need >= 1 connections for > reading and another >= 1 connections for writing). > > I think I will continue with the pure libssh2-based block driver, > making it support all the missing features discussed earlier: > > http://www.mail-archive.com/qemu-devel@nongnu.org/msg161997.html > > plus of course non-blocking AIO. > > I think this way we'll end up with a much more robust, reliable and > easier to debug ssh implementation in qemu. Fair enough. Stefan