-
Notifications
You must be signed in to change notification settings - Fork 520
B #6772: Fix for NUMA and CPU Pinning Discrepancies During VM Save and Live Migration #6773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2298,5 +2298,7 @@ int LibVirtDriver::deployment_description_kvm( | |
|
|
||
| file << "</domain>" << endl; | ||
|
|
||
| file.close(); | ||
|
|
||
| return 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,7 +221,9 @@ string VirtualMachineManager::format_message( | |
| const string& tmpl, | ||
| int ds_id, | ||
| int sgid, | ||
| int nicid) | ||
| int nicid, | ||
| const string& lmfile, | ||
| const string& rmfile) | ||
| { | ||
| ostringstream oss; | ||
|
|
||
|
|
@@ -266,6 +268,17 @@ string VirtualMachineManager::format_message( | |
| oss << "<REMOTE_DEPLOYMENT_FILE/>"; | ||
| } | ||
|
|
||
| if (!lmfile.empty()) | ||
| { | ||
| oss << "<LOCAL_MIGRATE_FILE>" << lmfile << "</LOCAL_MIGRATE_FILE>"; | ||
| oss << "<REMOTE_MIGRATE_FILE>" << rmfile << "</REMOTE_MIGRATE_FILE>"; | ||
| } | ||
| else | ||
| { | ||
| oss << "<LOCAL_MIGRATE_FILE/>"; | ||
| oss << "<REMOTE_MIGRATE_FILE/>"; | ||
| } | ||
|
|
||
| if (!cfile.empty()) | ||
| { | ||
| oss << "<CHECKPOINT_FILE>" << cfile << "</CHECKPOINT_FILE>"; | ||
|
|
@@ -495,8 +508,9 @@ void VirtualMachineManager::trigger_save(int vid) | |
| trigger([this, vid] | ||
| { | ||
| const VirtualMachineManagerDriver * vmd; | ||
| int rc; | ||
|
|
||
| string hostname, checkpoint_file; | ||
| string hostname, checkpoint_file, migrate_file, rmigrate_file; | ||
| string vm_tmpl; | ||
| string drv_msg; | ||
| int ds_id; | ||
|
|
@@ -535,12 +549,31 @@ void VirtualMachineManager::trigger_save(int vid) | |
| hostname = vm->get_previous_hostname(); | ||
| checkpoint_file = vm->get_previous_checkpoint_file(); | ||
| ds_id = vm->get_previous_ds_id(); | ||
|
|
||
| //Generate VM description file | ||
| os << "Generating migrate file: " << vm->get_migrate_file(); | ||
|
|
||
| vm->log("VMM", Log::INFO, os); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html |
||
|
|
||
| os.str(""); | ||
|
|
||
| rc = vmd->deployment_description(vm.get(), vm->get_migrate_file()); | ||
|
|
||
| if (rc != 0) | ||
| { | ||
| goto error_file; | ||
| } | ||
|
|
||
| migrate_file = vm->get_migrate_file(); | ||
| rmigrate_file = vm->get_rmigrate_file(); | ||
| } | ||
| else | ||
| { | ||
| hostname = vm->get_hostname(); | ||
| checkpoint_file = vm->get_checkpoint_file(); | ||
| ds_id = vm->get_ds_id(); | ||
| migrate_file = ""; | ||
| rmigrate_file = ""; | ||
| } | ||
|
|
||
| // Invoke driver method | ||
|
|
@@ -556,7 +589,10 @@ void VirtualMachineManager::trigger_save(int vid) | |
| "", | ||
| vm->to_xml(vm_tmpl), | ||
| ds_id, | ||
| -1); | ||
| -1, | ||
| -1, | ||
| migrate_file, | ||
| rmigrate_file); | ||
|
|
||
| vmd->save(vid, drv_msg); | ||
|
|
||
|
|
@@ -570,6 +606,11 @@ void VirtualMachineManager::trigger_save(int vid) | |
| os << "save_action, error getting driver " << vm->get_vmm_mad(); | ||
| goto error_common; | ||
|
|
||
| error_file: | ||
| os << "save_action, error generating migrate file: " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html |
||
| << vm->get_migrate_file(); | ||
| goto error_common; | ||
|
|
||
| error_previous_history: | ||
| os << "save_action, VM has no previous history"; | ||
|
|
||
|
|
@@ -1154,10 +1195,12 @@ void VirtualMachineManager::trigger_migrate(int vid) | |
| trigger([this, vid] | ||
| { | ||
| const VirtualMachineManagerDriver * vmd; | ||
| int rc; | ||
|
|
||
| ostringstream os; | ||
| string vm_tmpl; | ||
| string drv_msg; | ||
| string tm_command = ""; | ||
|
|
||
| // Get the VM from the pool | ||
| auto vm = vmpool->get(vid); | ||
|
|
@@ -1187,6 +1230,24 @@ void VirtualMachineManager::trigger_migrate(int vid) | |
|
|
||
| Nebula::instance().get_tm()->migrate_transfer_command(vm.get(), os); | ||
|
|
||
| tm_command = os.str(); | ||
|
|
||
| os.str(""); | ||
|
|
||
| //Generate VM description file | ||
| os << "Generating migrate file: " << vm->get_migrate_file(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html |
||
|
|
||
| vm->log("VMM", Log::INFO, os); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html |
||
|
|
||
| os.str(""); | ||
|
|
||
| rc = vmd->deployment_description(vm.get(), vm->get_migrate_file()); | ||
|
|
||
| if (rc != 0) | ||
| { | ||
| goto error_file; | ||
| } | ||
|
|
||
| // Invoke driver method | ||
| drv_msg = format_message( | ||
| vm->get_previous_hostname(), | ||
|
|
@@ -1195,12 +1256,15 @@ void VirtualMachineManager::trigger_migrate(int vid) | |
| "", | ||
| "", | ||
| "", | ||
| os.str(), | ||
| tm_command, | ||
| "", | ||
| vm->get_system_dir(), | ||
| vm->to_xml(vm_tmpl), | ||
| vm->get_previous_ds_id(), | ||
| -1); | ||
| -1, | ||
| -1, | ||
| vm->get_migrate_file(), | ||
| vm->get_rmigrate_file()); | ||
|
|
||
| vmd->migrate(vid, drv_msg); | ||
|
|
||
|
|
@@ -1214,6 +1278,11 @@ void VirtualMachineManager::trigger_migrate(int vid) | |
| os << "migrate_action, error getting driver " << vm->get_vmm_mad(); | ||
| goto error_common; | ||
|
|
||
| error_file: | ||
| os << "migrate_action, error generating migrate file: " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html |
||
| << vm->get_migrate_file(); | ||
| goto error_common; | ||
|
|
||
| error_previous_history: | ||
| os << "migrate_action, error VM has no previous history"; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
Potential log injection detected. Ensure all untrusted input is properly sanitized before logging. Use parameterized logging or validate input against an allow list to prevent log injection vulnerabilities. Consider using a dedicated logging library's built-in sanitization features when available. Learn more - https://cwe.mitre.org/data/definitions/117.html