aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-02-04 12:48:26 +0000
committerDr. David Alan Gilbert <dgilbert@redhat.com>2021-02-08 11:19:51 +0000
commitcf3a74c94f3da92fdf8d45047756f0e43657be1a (patch)
tree4bd20f44846b8a99eb0b4d23504d410e7f14f922 /migration
parentf61fe11aa6f7f8f0ffe4ddaa56a8108f3ab57854 (diff)
block: add ability to specify list of blockdevs during snapshot
When running snapshot operations, there are various rules for which blockdevs are included/excluded. While this provides reasonable default behaviour, there are scenarios that are not well handled by the default logic. Some of the conditions do not have a single correct answer. Thus there needs to be a way for the mgmt app to provide an explicit list of blockdevs to perform snapshots across. This can be achieved by passing a list of node names that should be used. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210204124834.774401-5-berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/savevm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index b85eefd682..0dbe8c1607 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2786,18 +2786,18 @@ bool save_snapshot(const char *name, Error **errp)
return false;
}
- if (!bdrv_all_can_snapshot(errp)) {
+ if (!bdrv_all_can_snapshot(false, NULL, errp)) {
return false;
}
/* Delete old snapshots of the same name */
if (name) {
- if (bdrv_all_delete_snapshot(name, errp) < 0) {
+ if (bdrv_all_delete_snapshot(name, false, NULL, errp) < 0) {
return false;
}
}
- bs = bdrv_all_find_vmstate_bs(errp);
+ bs = bdrv_all_find_vmstate_bs(false, NULL, errp);
if (bs == NULL) {
return false;
}
@@ -2862,9 +2862,9 @@ bool save_snapshot(const char *name, Error **errp)
aio_context_release(aio_context);
aio_context = NULL;
- ret = bdrv_all_create_snapshot(sn, bs, vm_state_size, errp);
+ ret = bdrv_all_create_snapshot(sn, bs, vm_state_size, false, NULL, errp);
if (ret < 0) {
- bdrv_all_delete_snapshot(sn->name, NULL);
+ bdrv_all_delete_snapshot(sn->name, false, NULL, NULL);
goto the_end;
}
@@ -2974,15 +2974,15 @@ bool load_snapshot(const char *name, Error **errp)
AioContext *aio_context;
MigrationIncomingState *mis = migration_incoming_get_current();
- if (!bdrv_all_can_snapshot(errp)) {
+ if (!bdrv_all_can_snapshot(false, NULL, errp)) {
return false;
}
- ret = bdrv_all_find_snapshot(name, errp);
+ ret = bdrv_all_find_snapshot(name, false, NULL, errp);
if (ret < 0) {
return false;
}
- bs_vm_state = bdrv_all_find_vmstate_bs(errp);
+ bs_vm_state = bdrv_all_find_vmstate_bs(false, NULL, errp);
if (!bs_vm_state) {
return false;
}
@@ -3009,7 +3009,7 @@ bool load_snapshot(const char *name, Error **errp)
/* Flush all IO requests so they don't interfere with the new state. */
bdrv_drain_all_begin();
- ret = bdrv_all_goto_snapshot(name, errp);
+ ret = bdrv_all_goto_snapshot(name, false, NULL, errp);
if (ret < 0) {
goto err_drain;
}