mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
M #-: Cleanup files if unknown format for qemu cp (#2199)
(cherry picked from commit f01b28e763ea94e7b3fb4cc44e350b340c996842)
This commit is contained in:
parent
3d19709d94
commit
f59f1b4cf1
@ -175,6 +175,12 @@ else
|
||||
fi
|
||||
|
||||
FORMAT=$($QEMU_IMG info $DST | grep "^file format:" | awk '{print $3}' || :)
|
||||
|
||||
if [ -z $FORMAT ]; then
|
||||
rm -rf $DST
|
||||
log_error "Unknown image format src=$SRC"
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ "$FORMAT" = "luks" ]] && FORMAT="raw"
|
||||
|
@ -63,7 +63,7 @@ if [ -n "$BRIDGE_LIST" ]; then
|
||||
"Error deleting $SRC in $DST_HOST"
|
||||
else
|
||||
BASENAME_SRC=`basename "${SRC##$REMOTE_RM_CMD}"`
|
||||
if [ -f "$SRC" -a `dirname "$SRC"` = "$BASE_PATH" -a -n "$BASENAME_SRC" ]
|
||||
if [ -e "$SRC" -a `dirname "$SRC"` = "$BASE_PATH" -a -n "$BASENAME_SRC" ]
|
||||
then
|
||||
log "Removing $SRC from the image repository"
|
||||
|
||||
|
@ -103,6 +103,8 @@ void ImageManager::_cp(unique_ptr<image_msg_t> msg)
|
||||
goto error;
|
||||
}
|
||||
|
||||
image->set_source(source);
|
||||
|
||||
is >> format;
|
||||
|
||||
if (is.fail() || format.empty())
|
||||
@ -111,8 +113,6 @@ void ImageManager::_cp(unique_ptr<image_msg_t> msg)
|
||||
goto error_common;
|
||||
}
|
||||
|
||||
image->set_source(source);
|
||||
|
||||
image->set_format(format);
|
||||
|
||||
image->set_state_unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user