提交 75d6f42f 编写于 作者: G Giuseppe Scrivano

qemu: raise an error when trying to use readonly sata disks

commit 72f919f5 introduced an user
friendly error message when trying to use IDE disks as readonly.

Do the same thing for the SATA bus.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1112939Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
上级 4f3c2e39
......@@ -3508,11 +3508,17 @@ qemuBuildDriveStr(virConnectPtr conn,
virBufferAddLit(&opt, ",boot=on");
if (disk->src->readonly &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE &&
disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("readonly ide disks are not supported"));
goto error;
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("readonly ide disks are not supported"));
goto error;
}
if (disk->bus == VIR_DOMAIN_DISK_BUS_SATA) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("readonly sata disks are not supported"));
goto error;
}
}
virBufferAddLit(&opt, ",readonly=on");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册