mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
M #-: Cleanup files if unknown format for qemu cp (#2199)
This commit is contained in:
parent
5784a2fcf2
commit
f01b28e763
@ -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