From 41d119e20e915b319792dd2c7c2efce46f53d670 Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Fri, 20 Dec 2024 16:59:39 +0100 Subject: [PATCH] Coding standards fixes Signed-off-by: Kristian Feldsam --- src/vmm_mad/exec/one_vmm_exec.rb | 154 +++++++++++++++---------------- src/vmm_mad/remotes/kvm/migrate | 6 +- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 74eece239f..86e49731f8 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -549,28 +549,28 @@ def save(id, drv_message) # Save migration data to remote location steps << { - :driver => :vmm, - :action => "/bin/cat - >#{mfile}", - :is_local => false, - :stdin => mdata, - :no_extra_params => true + :driver => :vmm, + :action => "/bin/cat - >#{mfile}", + :is_local => false, + :stdin => mdata, + :no_extra_params => true } end steps.concat([ - # Save the Virtual Machine state - { - :driver => :vmm, - :action => :save, - :parameters => [:deploy_id, :checkpoint_file, :host] - }, - # Execute networking clean up operations - { - :driver => :vnm, - :action => :clean, - :parameters => [:host] - } - ]) + # Save the Virtual Machine state + { + :driver => :vmm, + :action => :save, + :parameters => [:deploy_id, :checkpoint_file, :host] + }, + # Execute networking clean up operations + { + :driver => :vnm, + :action => :clean, + :parameters => [:host] + } + ]) action.run(steps) end @@ -658,69 +658,69 @@ def migrate(id, drv_message) # Save migration data to remote location steps << { - :driver => :vmm, - :action => "/bin/cat - >#{mfile}", - :is_local => false, - :stdin => mdata, - :no_extra_params => true + :driver => :vmm, + :action => "/bin/cat - >#{mfile}", + :is_local => false, + :stdin => mdata, + :no_extra_params => true } end steps.concat([ - # Execute a pre-migrate TM setup - { - :driver => :tm, - :action => :tm_premigrate, - :parameters => pre.split, - :stdin => action.data[:vm] - }, - # Execute pre-boot networking setup on migrating host - { - :driver => :vnm, - :action => :pre, - :destination => true - }, - # Migrate the Virtual Machine - { - :driver => :vmm, - :action => :migrate, - :parameters => [:deploy_id, :dest_host, :host], - :fail_actions => [ - { - :driver => :tm, - :action => :tm_failmigrate, - :parameters => failed.split, - :stdin => action.data[:vm], - :no_fail => true - } - ] - }, - # Execute networking clean up operations - # NOTE: VM is now in the new host. If we fail from now on, oned will - # assume that the VM is in the previous host but it is in fact - # migrated. Log errors will be shown in vm.log - { - :driver => :vnm, - :action => :clean, - :parameters => [:host], - :no_fail => true - }, - # Execute post-boot networking setup on migrating host - { - :driver => :vnm, - :action => :post, - :parameters => [:deploy_id, :host], - :destination => true, - :no_fail => true - }, - { - :driver => :tm, - :action => :tm_postmigrate, - :parameters => post.split, - :stdin => action.data[:vm], - :no_fail => true - } - ]) + # Execute a pre-migrate TM setup + { + :driver => :tm, + :action => :tm_premigrate, + :parameters => pre.split, + :stdin => action.data[:vm] + }, + # Execute pre-boot networking setup on migrating host + { + :driver => :vnm, + :action => :pre, + :destination => true + }, + # Migrate the Virtual Machine + { + :driver => :vmm, + :action => :migrate, + :parameters => [:deploy_id, :dest_host, :host], + :fail_actions => [ + { + :driver => :tm, + :action => :tm_failmigrate, + :parameters => failed.split, + :stdin => action.data[:vm], + :no_fail => true + } + ] + }, + # Execute networking clean up operations + # NOTE: VM is now in the new host. If we fail from now on, oned will + # assume that the VM is in the previous host but it is in fact + # migrated. Log errors will be shown in vm.log + { + :driver => :vnm, + :action => :clean, + :parameters => [:host], + :no_fail => true + }, + # Execute post-boot networking setup on migrating host + { + :driver => :vnm, + :action => :post, + :parameters => [:deploy_id, :host], + :destination => true, + :no_fail => true + }, + { + :driver => :tm, + :action => :tm_postmigrate, + :parameters => post.split, + :stdin => action.data[:vm], + :no_fail => true + } + ]) action.run(steps) end diff --git a/src/vmm_mad/remotes/kvm/migrate b/src/vmm_mad/remotes/kvm/migrate index 55d0c8b54a..4554243134 100755 --- a/src/vmm_mad/remotes/kvm/migrate +++ b/src/vmm_mad/remotes/kvm/migrate @@ -213,16 +213,16 @@ begin @vm_dir = Pathname.new(action_xml['/VMM_DRIVER_ACTION_DATA/DISK_TARGET_PATH']).cleanpath @shared = action_xml['/VMM_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SHARED'].casecmp('YES') == 0 - @migrate_file = Pathname.new(action_xml['/VMM_DRIVER_ACTION_DATA/REMOTE_MIGRATE_FILE']).cleanpath + @mig_file = Pathname.new(action_xml['/VMM_DRIVER_ACTION_DATA/REMOTE_MIGRATE_FILE']).cleanpath - kvm_vm = KvmDomain.new(@deploy_id) + kvm_vm = KvmDomain.new(@deploy_id) # Migration can't be done with domain snapshots, drop them first kvm_vm.snapshots_delete # Migrate VMs using shared/local storage if @shared - rc, _out, err = kvm_vm.live_migrate(@dst_host, @migrate_file) + rc, _out, err = kvm_vm.live_migrate(@dst_host, @mig_file) cleanup_host(kvm_vm, err) if rc != 0 else