X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/9a81b792cc498321671a93973a9d57e28438038c..042938f46e1c477419d1931381fdadffaa49d45e:/block/bochs.c diff --git a/block/bochs.c b/block/bochs.c index 516da56c3b..50c630047b 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -28,6 +28,7 @@ #include "block/block_int.h" #include "qemu/module.h" #include "qemu/bswap.h" +#include "qemu/error-report.h" /**************************************************************/ @@ -110,7 +111,16 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, return -EINVAL; } - bs->read_only = true; /* no write support yet */ + if (!bdrv_is_read_only(bs)) { + error_report("Opening bochs images without an explicit read-only=on " + "option is deprecated. Future versions will refuse to " + "open the image instead of automatically marking the " + "image read-only."); + ret = bdrv_set_read_only(bs, true, errp); /* no write support yet */ + if (ret < 0) { + return ret; + } + } ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)); if (ret < 0) {