[PATCH v2 4/6] qemu: Allow active disk snapshots for RBD disks

Peter Krempa pkrempa at redhat.com
Mon Feb 20 14:09:45 UTC 2023


On Wed, Feb 15, 2023 at 05:28:20 -0600, Or Ozeri wrote:
> This commit removes the check disallowing users to take
> active disk-only snapshots of RBD disks.
> The actual support for this functionality was added in a previous commit.
> 
> Signed-off-by: Or Ozeri <oro at il.ibm.com>
> ---
>  src/qemu/qemu_snapshot.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
> index e82352ba7d..a10bdf7bf2 100644
> --- a/src/qemu/qemu_snapshot.c
> +++ b/src/qemu/qemu_snapshot.c
> @@ -630,6 +630,8 @@ qemuSnapshotPrepare(virDomainObj *vm,
>      for (i = 0; i < def->ndisks; i++) {
>          virDomainSnapshotDiskDef *disk = &def->disks[i];
>          virDomainDiskDef *dom_disk = vm->def->disks[i];
> +        bool is_raw_rbd = (dom_disk->src->format == VIR_STORAGE_FILE_RAW &&
> +                           dom_disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD);

You must not access 'src->protocol' unless you first check that
src->type is VIR_STORAGE_TYPE_NETWORK.


More information about the libvir-list mailing list