提交 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,
static int
qemuBuildDiskCommandLine(virCommandPtr cmd,
const virDomainDef *def,
virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps,
unsigned int bootindex,
bool driveBoot)
qemuBuildDiskSourceCommandLine(virCommandPtr cmd,
virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps,
bool driveBoot)
{
qemuBlockStorageSourceAttachDataPtr data = NULL;
char *optstr;
int ret = -1;
if (!(data = qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps,
driveBoot)))
return -1;
if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, data, qemuCaps) < 0 ||
qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0) {
qemuBlockStorageSourceAttachDataFree(data);
return -1;
}
qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0)
goto cleanup;
ret = 0;
cleanup:
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 (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册