mirror of https://github.com/xemu-project/xemu.git
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;
|
const char *protocol_delimiter;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
ret = bdrv_apply_auto_read_only(bs, "curl driver does not support writes",
|
||||||
if (flags & BDRV_O_RDWR) {
|
errp);
|
||||||
error_setg(errp, "curl block device does not support writes");
|
if (ret < 0) {
|
||||||
return -EROFS;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!libcurl_initialized) {
|
if (!libcurl_initialized) {
|
||||||
|
|
Loading…
Reference in New Issue