1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

qemu: capabilities: Lock out incremental backup capability without blockdev

Blockdev is required to do incremental backups properly. Add a helper
function for locking out capabilities and export it to allow re-doing
the processing if a different code path modifies capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-25 12:59:51 +01:00
parent a64265f440
commit be1a201533
2 changed files with 19 additions and 0 deletions

View File

@ -4577,6 +4577,21 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps)
}
/**
* virQEMUCapsInitProcessCapsInterlock:
* @qemuCaps: QEMU capabilities
*
* A capability which requires a different capability being present in order
* for libvirt to be able to drive it properly should be processed here.
*/
void
virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps)
{
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV))
virQEMUCapsClear(qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP);
}
/**
* virQEMUCapsInitProcessCaps:
* @qemuCaps: QEMU capabilities
@ -4627,6 +4642,8 @@ virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps)
virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_DEVICE_ID) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_SAVEVM_MONITOR_NODES))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV);
virQEMUCapsInitProcessCapsInterlock(qemuCaps);
}

View File

@ -555,6 +555,8 @@ void virQEMUCapsClear(virQEMUCapsPtr qemuCaps,
bool virQEMUCapsGet(virQEMUCapsPtr qemuCaps,
virQEMUCapsFlags flag);
void virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps);
bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
const virDomainDef *def);