[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v5
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v5 |
Date: |
Thu, 07 May 2009 17:19:25 +0200 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090320) |
I haven't really read the patch, so just two small things:
address@hidden 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