From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M25Ok-00041b-U1 for qemu-devel@nongnu.org; Thu, 07 May 2009 11:20:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M25Of-00040z-4q for qemu-devel@nongnu.org; Thu, 07 May 2009 11:20:33 -0400 Received: from [199.232.76.173] (port=39519 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M25Of-00040v-2I for qemu-devel@nongnu.org; Thu, 07 May 2009 11:20:29 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52099) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M25Oe-0001Xt-HB for qemu-devel@nongnu.org; Thu, 07 May 2009 11:20:28 -0400 Message-ID: <4A02FBFD.30904@redhat.com> Date: Thu, 07 May 2009 17:19:25 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v5 References: <1241707700-29109-1-git-send-email-alex@csgraf.de> In-Reply-To: <1241707700-29109-1-git-send-email-alex@csgraf.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex@csgraf.de Cc: nolan@sigbus.net, qemu-devel@nongnu.org, Alexander Graf I haven't really read the patch, so just two small things: alex@csgraf.de schrieb: > +BlockDriver bdrv_http = { > + .format_name = "http", > + .protocol_name = "http", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; This looks like tabs, should be spaces instead. > +BlockDriver bdrv_https = { > + .format_name = "https", > + .protocol_name = "https", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > + > +BlockDriver bdrv_ftp = { > + .format_name = "ftp", > + .protocol_name = "ftp", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > + > +BlockDriver bdrv_ftps = { > + .format_name = "ftps", > + .protocol_name = "ftps", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > + > +BlockDriver bdrv_sftp = { > + .format_name = "sftp", > + .protocol_name = "sftp", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > + > +BlockDriver bdrv_scp = { > + .format_name = "scp", > + .protocol_name = "scp", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > + > +BlockDriver bdrv_tftp = { > + .format_name = "tftp", > + .protocol_name = "tftp", > + > + .instance_size = sizeof(BDRVHTTPState), > + .bdrv_open = http_open, > + .bdrv_close = http_close, > + .bdrv_getlength = http_getlength, > + > + .aiocb_size = sizeof(HTTPAIOCB), > + .bdrv_aio_readv = http_aio_readv, > + .bdrv_aio_cancel = http_aio_cancel, > +}; > diff --git a/block.c b/block.c > index 3d1223d..55af1eb 100644 > --- a/block.c > +++ b/block.c > @@ -1504,6 +1504,18 @@ void bdrv_init(void) > bdrv_register(&bdrv_qcow2); > bdrv_register(&bdrv_parallels); > bdrv_register(&bdrv_nbd); > +#ifdef CONFIG_CURL > + bdrv_register(&bdrv_http); > + bdrv_register(&bdrv_https); > + bdrv_register(&bdrv_ftp); > + bdrv_register(&bdrv_ftps); > + bdrv_register(&bdrv_tftp); > +#if 0 > + /* SSH over curl can't detect file sizes :-( */ > + bdrv_register(&bdrv_sftp); > + bdrv_register(&bdrv_scp); > +#endif > +#endif > } > > void aio_pool_init(AIOPool *pool, int aiocb_size, > diff --git a/block.h b/block.h > index 5aef076..5e554e8 100644 > --- a/block.h > +++ b/block.h > @@ -20,6 +20,13 @@ extern BlockDriver bdrv_vvfat; > extern BlockDriver bdrv_qcow2; > extern BlockDriver bdrv_parallels; > extern BlockDriver bdrv_nbd; > +extern BlockDriver bdrv_http; > +extern BlockDriver bdrv_https; > +extern BlockDriver bdrv_ftp; > +extern BlockDriver bdrv_ftps; > +extern BlockDriver bdrv_sftp; > +extern BlockDriver bdrv_scp; > +extern BlockDriver bdrv_tftp; No #ifdefs here? Kevin