Skip to content

Commit

Permalink
Coding standards fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Feldsam <[email protected]>
  • Loading branch information
feldsam committed Dec 20, 2024
1 parent 24b109d commit 41d119e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
154 changes: 77 additions & 77 deletions src/vmm_mad/exec/one_vmm_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/vmm_mad/remotes/kvm/migrate
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41d119e

Please sign in to comment.