mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Implement HTTP API for obtaining counters
The counters are a hash of device name to hash of counter name to u64 value. Currently the API is only implemented with a stub that returns an empty set of counters. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
fd4aba8eae
commit
bca8a19244
@@ -44,8 +44,8 @@ use linux_loader::cmdline::Cmdline;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use linux_loader::loader::elf::Error::InvalidElfMagicNumber;
|
||||
use linux_loader::loader::KernelLoader;
|
||||
|
||||
use signal_hook::{iterator::Signals, SIGINT, SIGTERM, SIGWINCH};
|
||||
use std::collections::HashMap;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use std::convert::TryInto;
|
||||
use std::ffi::CString;
|
||||
@@ -53,6 +53,7 @@ use std::fs::{File, OpenOptions};
|
||||
use std::io::{self, Write};
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use std::io::{Seek, SeekFrom};
|
||||
use std::num::Wrapping;
|
||||
use std::ops::Deref;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
@@ -992,6 +993,10 @@ impl Vm {
|
||||
Ok(pci_device_info)
|
||||
}
|
||||
|
||||
pub fn counters(&self) -> Result<HashMap<String, HashMap<&'static str, Wrapping<u64>>>> {
|
||||
Ok(HashMap::new())
|
||||
}
|
||||
|
||||
fn os_signal_handler(signals: Signals, console_input_clone: Arc<Console>, on_tty: bool) {
|
||||
for signal in signals.forever() {
|
||||
match signal {
|
||||
|
||||
Reference in New Issue
Block a user