blockdev: read-only-mode for blockdev-change-medium
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may find it useful to be able to therefore change the read-only status of a block device when changing the medium. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
1 parent
1068674927
commit
39ff43d9e1
6 files changed
+72
-4
No files matched your search
@@ -1355,7 +1355,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
|
||||
}
|
||||
qmp_change("vnc", target, !!arg, arg, &err);
|
||||
} else {
|
||||
qmp_blockdev_change_medium(device, target, !!arg, arg, &err);
|
||||
qmp_blockdev_change_medium(device, target, !!arg, arg, false, 0, &err);
|
||||
if (err &&
|
||||
error_get_class(err) == ERROR_CLASS_DEVICE_ENCRYPTED) {
|
||||
error_free(err);
|
||||
|
||||
Reference in new issue
Block a user