mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: command: Inline qemuBuildDiskFrontendAttributeErrorPolicy
Commit dc481f11a61 which converted the function generating properties for disk '-device' argument to JSON removed the only other use of qemuBuildDiskFrontendAttributeErrorPolicy, so we can now inline it into qemuBuildDriveStr. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f923620031
commit
a572a285ab
@ -2002,22 +2002,6 @@ qemuBuildDiskGetErrorPolicy(virDomainDiskDef *disk,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qemuBuildDiskFrontendAttributeErrorPolicy(virDomainDiskDef *disk,
|
||||
virBuffer *buf)
|
||||
{
|
||||
const char *wpolicy = NULL;
|
||||
const char *rpolicy = NULL;
|
||||
|
||||
qemuBuildDiskGetErrorPolicy(disk, &wpolicy, &rpolicy);
|
||||
|
||||
if (wpolicy)
|
||||
virBufferAsprintf(buf, ",werror=%s", wpolicy);
|
||||
if (rpolicy)
|
||||
virBufferAsprintf(buf, ",rerror=%s", rpolicy);
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
qemuBuildDriveStr(virDomainDiskDef *disk,
|
||||
virQEMUCaps *qemuCaps)
|
||||
@ -2043,8 +2027,17 @@ qemuBuildDriveStr(virDomainDiskDef *disk,
|
||||
|
||||
/* werror/rerror are really frontend attributes, but older
|
||||
* qemu requires them on -drive instead of -device */
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_STORAGE_WERROR))
|
||||
qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt);
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_STORAGE_WERROR)) {
|
||||
const char *wpolicy = NULL;
|
||||
const char *rpolicy = NULL;
|
||||
|
||||
qemuBuildDiskGetErrorPolicy(disk, &wpolicy, &rpolicy);
|
||||
|
||||
if (wpolicy)
|
||||
virBufferAsprintf(&opt, ",werror=%s", wpolicy);
|
||||
if (rpolicy)
|
||||
virBufferAsprintf(&opt, ",rerror=%s", rpolicy);
|
||||
}
|
||||
|
||||
if (disk->src->readonly)
|
||||
virBufferAddLit(&opt, ",readonly=on");
|
||||
|
Loading…
x
Reference in New Issue
Block a user