Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions fi-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function get_snapshot_chain() {
get_backing_file "$_backing_file" _parent_backing_file
#print_v d "Next file in backing file chain: '$_parent_backing_file'"
_ret=0
done
done

return $_ret
}
Expand Down Expand Up @@ -426,8 +426,17 @@ function consolidate_domain() {
if [ -n "$backing_file" ]; then
print_v d "Parent block device: '$backing_file'"

snapshot_chain=()
#get an array of the snapshot chain starting from last child and iterating backwards
# e.g. [0] [1] [2] [3]
# snap3 <- snap2 <- snap1 <- orig
#
# blockcommit: orig -> snap1 -> snap2 -> snap3 [becomes] orig
# blockpull: orig -> snap1 -> snap2 -> snap3 [becomes] snap3
get_snapshot_chain "$block_device" snapshot_chain

# Consolidate the block device
#echo "ABOUT TO RUN:"
#echo "ABOUT TO RUN:"
#echo "$VIRSH -q $CONSOLIDATION_METHOD $domain_name $block_device ${CONSOLIDATION_FLAGS[*]}"
command_output=$($VIRSH -q "$CONSOLIDATION_METHOD" "$domain_name" \
"$block_device" "${CONSOLIDATION_FLAGS[@]}" 2>&1)
Expand All @@ -438,15 +447,6 @@ function consolidate_domain() {
return 1
fi

snapshot_chain=()
#get an array of the snapshot chain starting from last child and iterating backwards
# e.g. [0] [1] [2] [3]
# snap3 <- snap2 <- snap1 <- orig
#
# blockcommit: orig -> snap1 -> snap2 -> snap3 [becomes] orig
# blockpull: orig -> snap1 -> snap2 -> snap3 [becomes] snap3
get_snapshot_chain "$block_device" snapshot_chain

if [ "$CONSOLIDATION_METHOD" == "blockcommit" ]; then
# --delete option for blockcommit doesn't work (tested on
# LibVirt 1.2.16, QEMU 2.3.0), so we need to manually delete old
Expand Down