mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: guest_debug: Mark coredump functionality x86_64 only
The coredump functionality is only implemented for x86_64 so it should only be compiled in there. Fixes: #4964 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -238,7 +238,7 @@ pub static HTTP_ROUTES: Lazy<HttpRoutes> = Lazy::new(|| {
|
||||
endpoint!("/vm.snapshot"),
|
||||
Box::new(VmActionHandler::new(VmAction::Snapshot(Arc::default()))),
|
||||
);
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
r.routes.insert(
|
||||
endpoint!("/vm.coredump"),
|
||||
Box::new(VmActionHandler::new(VmAction::Coredump(Arc::default()))),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
use crate::api::http::{error_response, EndpointHandler, HttpError};
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
use crate::api::vm_coredump;
|
||||
use crate::api::{
|
||||
vm_add_device, vm_add_disk, vm_add_fs, vm_add_net, vm_add_pmem, vm_add_user_device,
|
||||
@@ -153,7 +153,7 @@ impl EndpointHandler for VmActionHandler {
|
||||
api_sender,
|
||||
Arc::new(serde_json::from_slice(body.raw())?),
|
||||
),
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
Coredump(_) => vm_coredump(
|
||||
api_notifier,
|
||||
api_sender,
|
||||
|
||||
@@ -320,7 +320,7 @@ pub enum ApiRequest {
|
||||
VmRestore(Arc<RestoreConfig>, Sender<ApiResponse>),
|
||||
|
||||
/// Take a VM coredump
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
VmCoredump(Arc<VmCoredumpData>, Sender<ApiResponse>),
|
||||
|
||||
/// Incoming migration
|
||||
@@ -416,7 +416,7 @@ pub enum VmAction {
|
||||
Snapshot(Arc<VmSnapshotConfig>),
|
||||
|
||||
/// Coredump VM
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
Coredump(Arc<VmCoredumpData>),
|
||||
|
||||
/// Incoming migration
|
||||
@@ -458,7 +458,7 @@ fn vm_action(
|
||||
ResizeZone(v) => ApiRequest::VmResizeZone(v, response_sender),
|
||||
Restore(v) => ApiRequest::VmRestore(v, response_sender),
|
||||
Snapshot(v) => ApiRequest::VmSnapshot(v, response_sender),
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
Coredump(v) => ApiRequest::VmCoredump(v, response_sender),
|
||||
ReceiveMigration(v) => ApiRequest::VmReceiveMigration(v, response_sender),
|
||||
SendMigration(v) => ApiRequest::VmSendMigration(v, response_sender),
|
||||
@@ -545,7 +545,7 @@ pub fn vm_restore(
|
||||
vm_action(api_evt, api_sender, VmAction::Restore(data))
|
||||
}
|
||||
|
||||
#[cfg(feature = "guest_debug")]
|
||||
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
|
||||
pub fn vm_coredump(
|
||||
api_evt: EventFd,
|
||||
api_sender: Sender<ApiRequest>,
|
||||
|
||||
Reference in New Issue
Block a user