[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 24/25] block/curl: Implement bdrv_refresh_filenam
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 24/25] block/curl: Implement bdrv_refresh_filename() |
Date: |
Wed, 30 Nov 2016 02:18:50 +0100 |
Signed-off-by: Max Reitz <address@hidden>
---
block/curl.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/block/curl.c b/block/curl.c
index 0777d5b..4725caf 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -872,6 +872,20 @@ static int64_t curl_getlength(BlockDriverState *bs)
return s->len;
}
+static void curl_refresh_filename(BlockDriverState *bs)
+{
+ BDRVCURLState *s = bs->opaque;
+
+ if (!s->sslverify || s->cookie ||
+ s->username || s->password || s->proxyusername || s->proxypassword)
+ {
+ return;
+ }
+
+ pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), s->url);
+}
+
+
static const char *const curl_sgfnt_runtime_opts[] = {
CURL_BLOCK_OPT_URL,
CURL_BLOCK_OPT_SSLVERIFY,
@@ -899,6 +913,7 @@ static BlockDriver bdrv_http = {
.bdrv_detach_aio_context = curl_detach_aio_context,
.bdrv_attach_aio_context = curl_attach_aio_context,
+ .bdrv_refresh_filename = curl_refresh_filename,
.sgfnt_runtime_opts = curl_sgfnt_runtime_opts,
};
@@ -917,6 +932,7 @@ static BlockDriver bdrv_https = {
.bdrv_detach_aio_context = curl_detach_aio_context,
.bdrv_attach_aio_context = curl_attach_aio_context,
+ .bdrv_refresh_filename = curl_refresh_filename,
.sgfnt_runtime_opts = curl_sgfnt_runtime_opts,
};
@@ -935,6 +951,7 @@ static BlockDriver bdrv_ftp = {
.bdrv_detach_aio_context = curl_detach_aio_context,
.bdrv_attach_aio_context = curl_attach_aio_context,
+ .bdrv_refresh_filename = curl_refresh_filename,
.sgfnt_runtime_opts = curl_sgfnt_runtime_opts,
};
@@ -953,6 +970,7 @@ static BlockDriver bdrv_ftps = {
.bdrv_detach_aio_context = curl_detach_aio_context,
.bdrv_attach_aio_context = curl_attach_aio_context,
+ .bdrv_refresh_filename = curl_refresh_filename,
.sgfnt_runtime_opts = curl_sgfnt_runtime_opts,
};
--
2.10.2
- [Qemu-devel] [PATCH v3 14/25] block/nfs: Implement bdrv_dirname(), (continued)
- [Qemu-devel] [PATCH v3 14/25] block/nfs: Implement bdrv_dirname(), Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 16/25] block: Add 'base-directory' BDS option, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 17/25] iotests: Add quorum case to test 110, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 15/25] block: Use bdrv_dirname() for relative filenames, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 18/25] block: Add sgfnt_runtime_opts to BlockDriver, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 20/25] block: Generically refresh runtime options, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 19/25] block: Add BlockDriver.bdrv_gather_child_options, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 22/25] block: Do not copy exact_filename from format file, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 21/25] block: Purify .bdrv_refresh_filename(), Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 23/25] block: Fix FIXME from "Add BDS.backing_overridden", Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 24/25] block/curl: Implement bdrv_refresh_filename(),
Max Reitz <=
- [Qemu-devel] [PATCH v3 25/25] block/null: Generate filename even with latency-ns, Max Reitz, 2016/11/29