|
|
26ba25 |
From 94b5efa066c1d0a05e62d9435e203afa431f8909 Mon Sep 17 00:00:00 2001
|
|
|
26ba25 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
26ba25 |
Date: Thu, 10 Jan 2019 12:44:37 +0000
|
|
|
26ba25 |
Subject: [PATCH 07/14] curl: Support auto-read-only option
|
|
|
26ba25 |
|
|
|
26ba25 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
26ba25 |
Message-id: <20190110124442.30132-8-kwolf@redhat.com>
|
|
|
26ba25 |
Patchwork-id: 83956
|
|
|
26ba25 |
O-Subject: [RHEL-8.0 qemu-kvm PATCH 07/12] curl: Support auto-read-only option
|
|
|
26ba25 |
Bugzilla: 1644996
|
|
|
26ba25 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
26ba25 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
26ba25 |
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
|
|
26ba25 |
|
|
|
26ba25 |
If read-only=off, but auto-read-only=on is given, just degrade to
|
|
|
26ba25 |
read-only.
|
|
|
26ba25 |
|
|
|
26ba25 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
26ba25 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
26ba25 |
(cherry picked from commit 6ceef36acb11819b255732b1de0ca62885da04bd)
|
|
|
26ba25 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
26ba25 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
26ba25 |
---
|
|
|
26ba25 |
block/curl.c | 8 ++++----
|
|
|
26ba25 |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
26ba25 |
|
|
|
26ba25 |
diff --git a/block/curl.c b/block/curl.c
|
|
|
26ba25 |
index 4d28f77..f0df33a 100644
|
|
|
26ba25 |
--- a/block/curl.c
|
|
|
26ba25 |
+++ b/block/curl.c
|
|
|
26ba25 |
@@ -684,10 +684,10 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
|
|
|
26ba25 |
const char *protocol_delimiter;
|
|
|
26ba25 |
int ret;
|
|
|
26ba25 |
|
|
|
26ba25 |
-
|
|
|
26ba25 |
- if (flags & BDRV_O_RDWR) {
|
|
|
26ba25 |
- error_setg(errp, "curl block device does not support writes");
|
|
|
26ba25 |
- return -EROFS;
|
|
|
26ba25 |
+ ret = bdrv_apply_auto_read_only(bs, "curl driver does not support writes",
|
|
|
26ba25 |
+ errp);
|
|
|
26ba25 |
+ if (ret < 0) {
|
|
|
26ba25 |
+ return ret;
|
|
|
26ba25 |
}
|
|
|
26ba25 |
|
|
|
26ba25 |
if (!libcurl_initialized) {
|
|
|
26ba25 |
--
|
|
|
26ba25 |
1.8.3.1
|
|
|
26ba25 |
|