Commit 6ceef36a authored by Kevin Wolf's avatar Kevin Wolf
Browse files

curl: Support auto-read-only option



If read-only=off, but auto-read-only=on is given, just degrade to
read-only.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent 64107dc0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -684,10 +684,10 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
    const char *protocol_delimiter;
    int ret;


    if (flags & BDRV_O_RDWR) {
        error_setg(errp, "curl block device does not support writes");
        return -EROFS;
    ret = bdrv_apply_auto_read_only(bs, "curl driver does not support writes",
                                    errp);
    if (ret < 0) {
        return ret;
    }

    if (!libcurl_initialized) {