From 19fd782f9134d9859be091d3b99a596168e8d664 Mon Sep 17 00:00:00 2001 From: Zheng Li Date: Wed, 16 Feb 2011 10:43:07 +0000 Subject: [PATCH] CA-49368: Avoid copying certain fields when reverting a VM Due to some recent changes in the database backend, some fields which used to get computed dynamically on the fly are not cached. Hence when reverting a VM to a snapshot/checkpoint, we should avoid copying some extra fields from the snapshot metadata. Signed-off-by: Zheng Li --- ocaml/xapi/xapi_vm_snapshot.ml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ocaml/xapi/xapi_vm_snapshot.ml b/ocaml/xapi/xapi_vm_snapshot.ml index db66e0f4f09..35c9e789865 100644 --- a/ocaml/xapi/xapi_vm_snapshot.ml +++ b/ocaml/xapi/xapi_vm_snapshot.ml @@ -359,7 +359,14 @@ let do_not_copy = [ Db_names.resident_on; Db_names.domid; Db_names.protection_policy; - Db_names.scheduled_to_be_resident_on ] + Db_names.scheduled_to_be_resident_on; + (* Global persistent fields should keep *) + "snapshots"; "tags"; "affinity"; + (* Current fields should remain to get destoied during revert process *) + "consoles"; "VBDs"; "VIFs"; + (* Stateful fields that will be reset anyway *) + "power_state"; +] let default_values = [ Db_names.ha_always_run, "false"; @@ -371,7 +378,8 @@ let extended_do_not_copy = [ Db_names.is_a_template; Db_names.snapshot_of; Db_names.snapshot_time; - Db_names.transportable_snapshot_id + Db_names.transportable_snapshot_id; + "children"; ] @ do_not_copy (* This function has to be done on the master *)