提交 35582d11 编写于 作者: P Peter Krempa

qemu: command: Split out formatting of disk source commandline

Further split qemuBuildDiskCommandLine to separate formatting of the
source part.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 48c643f4
...@@ -2231,27 +2231,42 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd, ...@@ -2231,27 +2231,42 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd,
static int static int
qemuBuildDiskCommandLine(virCommandPtr cmd, qemuBuildDiskSourceCommandLine(virCommandPtr cmd,
const virDomainDef *def, virDomainDiskDefPtr disk,
virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps,
virQEMUCapsPtr qemuCaps, bool driveBoot)
unsigned int bootindex,
bool driveBoot)
{ {
qemuBlockStorageSourceAttachDataPtr data = NULL; qemuBlockStorageSourceAttachDataPtr data = NULL;
char *optstr; int ret = -1;
if (!(data = qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps, if (!(data = qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps,
driveBoot))) driveBoot)))
return -1; return -1;
if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, data, qemuCaps) < 0 || if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, data, qemuCaps) < 0 ||
qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0) { qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0)
qemuBlockStorageSourceAttachDataFree(data); goto cleanup;
return -1;
}
ret = 0;
cleanup:
qemuBlockStorageSourceAttachDataFree(data); qemuBlockStorageSourceAttachDataFree(data);
return ret;
}
static int
qemuBuildDiskCommandLine(virCommandPtr cmd,
const virDomainDef *def,
virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps,
unsigned int bootindex,
bool driveBoot)
{
char *optstr;
if (qemuBuildDiskSourceCommandLine(cmd, disk, qemuCaps, driveBoot) < 0)
return -1;
if (!qemuDiskBusNeedsDriveArg(disk->bus)) { if (!qemuDiskBusNeedsDriveArg(disk->bus)) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) { if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册