mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 20:15:45 +00:00
vmm, ch-remote: Add "local" option to send-migration API
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
6e78ac1837
commit
b9c260c0de
@ -263,9 +263,14 @@ fn receive_migration_api_command(socket: &mut UnixStream, url: &str) -> Result<(
|
|||||||
.map_err(Error::ApiClient)
|
.map_err(Error::ApiClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_migration_api_command(socket: &mut UnixStream, url: &str) -> Result<(), Error> {
|
fn send_migration_api_command(
|
||||||
|
socket: &mut UnixStream,
|
||||||
|
url: &str,
|
||||||
|
local: bool,
|
||||||
|
) -> Result<(), Error> {
|
||||||
let send_migration_data = vmm::api::VmSendMigrationData {
|
let send_migration_data = vmm::api::VmSendMigrationData {
|
||||||
destination_url: url.to_owned(),
|
destination_url: url.to_owned(),
|
||||||
|
local,
|
||||||
};
|
};
|
||||||
simple_api_command(
|
simple_api_command(
|
||||||
socket,
|
socket,
|
||||||
@ -402,6 +407,10 @@ fn do_command(matches: &ArgMatches) -> Result<(), Error> {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.value_of("send_migration_config")
|
.value_of("send_migration_config")
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
matches
|
||||||
|
.subcommand_matches("send-migration")
|
||||||
|
.unwrap()
|
||||||
|
.is_present("send_migration_local"),
|
||||||
),
|
),
|
||||||
Some("receive-migration") => receive_migration_api_command(
|
Some("receive-migration") => receive_migration_api_command(
|
||||||
&mut socket,
|
&mut socket,
|
||||||
@ -560,6 +569,11 @@ fn main() {
|
|||||||
Arg::new("send_migration_config")
|
Arg::new("send_migration_config")
|
||||||
.index(1)
|
.index(1)
|
||||||
.help("<destination_url>"),
|
.help("<destination_url>"),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::new("send_migration_local")
|
||||||
|
.long("local")
|
||||||
|
.takes_value(false),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
|
@ -195,6 +195,8 @@ pub struct VmReceiveMigrationData {
|
|||||||
pub struct VmSendMigrationData {
|
pub struct VmSendMigrationData {
|
||||||
/// URL to migrate the VM to
|
/// URL to migrate the VM to
|
||||||
pub destination_url: String,
|
pub destination_url: String,
|
||||||
|
/// Send memory across socket without copying
|
||||||
|
pub local: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum ApiResponsePayload {
|
pub enum ApiResponsePayload {
|
||||||
|
@ -1140,8 +1140,8 @@ impl Vmm {
|
|||||||
send_data_migration: VmSendMigrationData,
|
send_data_migration: VmSendMigrationData,
|
||||||
) -> result::Result<(), MigratableError> {
|
) -> result::Result<(), MigratableError> {
|
||||||
info!(
|
info!(
|
||||||
"Sending migration: destination_url = {}",
|
"Sending migration: destination_url = {}, local = {}",
|
||||||
send_data_migration.destination_url
|
send_data_migration.destination_url, send_data_migration.local
|
||||||
);
|
);
|
||||||
if let Some(vm) = self.vm.as_mut() {
|
if let Some(vm) = self.vm.as_mut() {
|
||||||
Self::send_migration(
|
Self::send_migration(
|
||||||
|
Loading…
Reference in New Issue
Block a user