File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
scripts/vm/hypervisor/kvm
server/src/main/java/com/cloud/vm Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 288288sanity_checks
289289
290290if [ " $OP " = " backup" ]; then
291- STATE=$( virsh -c qemu:///system list | grep $VM | awk ' {print $3}' )
292- if [ " $STATE " = " running" ]; then
291+ STATE=$( virsh -c qemu:///system list | awk -v vm= " $VM " ' $2 == vm {print $3}' )
292+ if [ -n " $STATE " ] && [ " $STATE " = " running" ]; then
293293 backup_running_vm
294294 else
295295 backup_stopped_vm
Original file line number Diff line number Diff line change @@ -9549,7 +9549,9 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
95499549 Type type = new TypeToken<Map<String, String>>(){}.getType();
95509550 Map<String, String> vmDetailsFromBackup = new Gson().fromJson(vmSettingsFromBackup, type);
95519551 for (Map.Entry<String, String> entry : vmDetailsFromBackup.entrySet()) {
9552- vmVO.setDetail(entry.getKey(), entry.getValue());
9552+ if (!details.containsKey(entry.getKey())) {
9553+ vmVO.setDetail(entry.getKey(), entry.getValue());
9554+ }
95539555 }
95549556 _vmDao.saveDetails(vmVO);
95559557 }
You can’t perform that action at this time.
0 commit comments