[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v13 28/31] block/curl: Implement bdrv_refresh_filena
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v13 28/31] block/curl: Implement bdrv_refresh_filename() |
Date: |
Fri, 1 Feb 2019 20:29:32 +0100 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/curl.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/block/curl.c b/block/curl.c
index 2c07a694d8..606709fea4 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -950,6 +950,23 @@ static int64_t curl_getlength(BlockDriverState *bs)
return s->len;
}
+static void curl_refresh_filename(BlockDriverState *bs)
+{
+ BDRVCURLState *s = bs->opaque;
+
+ /* "readahead" and "timeout" do not change the guest-visible data,
+ * so ignore them */
+ if (s->sslverify != CURL_BLOCK_OPT_SSLVERIFY_DEFAULT ||
+ 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_strong_runtime_opts[] = {
CURL_BLOCK_OPT_URL,
CURL_BLOCK_OPT_SSLVERIFY,
@@ -978,6 +995,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,
.strong_runtime_opts = curl_strong_runtime_opts,
};
@@ -996,6 +1014,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,
.strong_runtime_opts = curl_strong_runtime_opts,
};
@@ -1014,6 +1033,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,
.strong_runtime_opts = curl_strong_runtime_opts,
};
@@ -1032,6 +1052,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,
.strong_runtime_opts = curl_strong_runtime_opts,
};
--
2.20.1
- [Qemu-block] [PATCH v13 13/31] block: Fix bdrv_find_backing_image(), (continued)
- [Qemu-block] [PATCH v13 13/31] block: Fix bdrv_find_backing_image(), Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 14/31] block: Add bdrv_dirname(), Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 16/31] quorum: Make bdrv_dirname() return NULL, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 15/31] blkverify: Make bdrv_dirname() return NULL, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 18/31] block/nfs: Implement bdrv_dirname(), Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 17/31] block/nbd: Make bdrv_dirname() return NULL, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 20/31] iotests: Add quorum case to test 110, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 19/31] block: Use bdrv_dirname() for relative filenames, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 22/31] block: Add BlockDriver.bdrv_gather_child_options, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 21/31] block: Add strong_runtime_opts to BlockDriver, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 28/31] block/curl: Implement bdrv_refresh_filename(),
Max Reitz <=
- [Qemu-block] [PATCH v13 29/31] block/null: Generate filename even with latency-ns, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 26/31] block/nvme: Fix bdrv_refresh_filename(), Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 25/31] block: Do not copy exact_filename from format file, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 31/31] iotests: Test json:{} filenames of internal BDSs, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 23/31] block: Generically refresh runtime options, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 30/31] block: BDS options may lack the "driver" option, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 27/31] block/curl: Harmonize option defaults, Max Reitz, 2019/02/01
- [Qemu-block] [PATCH v13 24/31] block: Purify .bdrv_refresh_filename(), Max Reitz, 2019/02/01
- Re: [Qemu-block] [Qemu-devel] [PATCH v13 00/31] Fix some filename generation issues, no-reply, 2019/02/03
- Re: [Qemu-block] [PATCH v13 00/31] Fix some filename generation issues, Max Reitz, 2019/02/10