mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 03:13:44 +08:00
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: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
64107dc044
commit
6ceef36acb
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user