提交 ccc1d910 编写于 作者: P Peter Krempa

qemu: command: Move disk 'serial' into frontend parameter formatter

Disk serial is not a property of the image but of the disk frontend.
Account for this appropriately.
上级 20acab76
......@@ -1625,6 +1625,7 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
static void
qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps,
virBufferPtr buf)
{
/* generate geometry command string */
......@@ -1640,6 +1641,12 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virBufferAsprintf(buf, ",trans=%s",
virDomainDiskGeometryTransTypeToString(disk->geometry.trans));
}
if (disk->serial &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) {
virBufferAddLit(buf, ",serial=");
virBufferEscape(buf, '\\', " ", "%s", disk->serial);
}
}
......@@ -1703,13 +1710,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
if (disk->src->readonly)
virBufferAddLit(&opt, ",readonly=on");
qemuBuildDiskFrontendAttributes(disk, &opt);
if (disk->serial &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) {
virBufferAddLit(&opt, ",serial=");
virBufferEscape(&opt, '\\', " ", "%s", disk->serial);
}
qemuBuildDiskFrontendAttributes(disk, qemuCaps, &opt);
if (disk->cachemode) {
virBufferAsprintf(&opt, ",cache=%s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册