提交 72f919f5 编写于 作者: G Giuseppe Scrivano 提交者: Martin Kletzander

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

The IDE bus doesn't support readonly disks, so inform the user with an
error message instead of let qemu fail with a more obscure "Device
'ide-hd' could not be initialized" error message.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1112939Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
上级 1ef65842
......@@ -3385,8 +3385,15 @@ qemuBuildDriveStr(virConnectPtr conn,
disk->bus != VIR_DOMAIN_DISK_BUS_IDE)
virBufferAddLit(&opt, ",boot=on");
if (disk->readonly &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_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;
}
virBufferAddLit(&opt, ",readonly=on");
}
if (disk->transient) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transient disks not supported yet"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册