[libvirt PATCH 08/11] test: snapshot revert: drop unused code
Peter Krempa
pkrempa at redhat.com
Tue Nov 16 15:16:36 UTC 2021
On Mon, Nov 15, 2021 at 17:22:51 +0100, Pavel Hrdina wrote:
> Now that we always emulate VM process stop we can drop the unused code
> and simply the logic.
>
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
> src/test/test_driver.c | 33 ++++++++-------------------------
> 1 file changed, 8 insertions(+), 25 deletions(-)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 0da8a2ea0f..4ae68571ef 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -9083,35 +9083,18 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
> VIR_DOMAIN_EVENT_STOPPED,
> VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
> virObjectEventStateQueue(privconn->eventState, event);
> - goto load;
> -
> - if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
> - /* Transitions 5, 6 */
> - was_running = true;
> - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
> - VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
> - /* Create an event now in case the restore fails, so
> - * that user will be alerted that they are now paused.
> - * If restore later succeeds, we might replace this. */
> - event = virDomainEventLifecycleNewFromObj(vm,
> - VIR_DOMAIN_EVENT_SUSPENDED,
> - VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
> - }
> - virDomainObjAssignDef(vm, config, false, NULL);
> -
> } else {
> - /* Transitions 2, 3 */
> - load:
> was_stopped = true;
Same issue as with the patch for the qemu driver.
Reviewed-by: Peter Krempa <pkrempa at redhat.com>
More information about the libvir-list
mailing list