Trait HasCallbacks

Source
pub trait HasCallbacks:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn on_vcpu_init(
        &mut self,
        id: PluginId,
        vcpu_id: VCPUIndex,
    ) -> Result<(), Error> { ... }
    fn on_vcpu_exit(
        &mut self,
        id: PluginId,
        vcpu_id: VCPUIndex,
    ) -> Result<(), Error> { ... }
    fn on_vcpu_idle(
        &mut self,
        id: PluginId,
        vcpu_id: VCPUIndex,
    ) -> Result<(), Error> { ... }
    fn on_vcpu_resume(
        &mut self,
        id: PluginId,
        vcpu_id: VCPUIndex,
    ) -> Result<(), Error> { ... }
    fn on_translation_block_translate(
        &mut self,
        id: PluginId,
        tb: TranslationBlock<'_>,
    ) -> Result<(), Error> { ... }
    fn on_flush(&mut self, id: PluginId) -> Result<(), Error> { ... }
    fn on_syscall(
        &mut self,
        id: PluginId,
        vcpu_index: VCPUIndex,
        num: i64,
        a1: u64,
        a2: u64,
        a3: u64,
        a4: u64,
        a5: u64,
        a6: u64,
        a7: u64,
        a8: u64,
    ) -> Result<(), Error> { ... }
    fn on_syscall_return(
        &mut self,
        id: PluginId,
        vcpu_index: VCPUIndex,
        num: i64,
        ret: i64,
    ) -> Result<(), Error> { ... }
}
Expand description

Trait implemented by structs which have callbacks which should be registered with QEMU

Provided Methods§

Source

fn on_vcpu_init( &mut self, id: PluginId, vcpu_id: VCPUIndex, ) -> Result<(), Error>

Callback triggered on vCPU init

§Arguments
  • id - The ID of the plugin
  • vcpu_id - The ID of the vCPU
Source

fn on_vcpu_exit( &mut self, id: PluginId, vcpu_id: VCPUIndex, ) -> Result<(), Error>

Callback triggered on vCPU exit

§Arguments
  • id - The ID of the plugin
  • vcpu_id - The ID of the vCPU
Source

fn on_vcpu_idle( &mut self, id: PluginId, vcpu_id: VCPUIndex, ) -> Result<(), Error>

Callback triggered on vCPU idle

§Arguments
  • id - The ID of the plugin
  • vcpu_id - The ID of the vCPU
Source

fn on_vcpu_resume( &mut self, id: PluginId, vcpu_id: VCPUIndex, ) -> Result<(), Error>

Callback triggered on vCPU resume

§Arguments
  • id - The ID of the plugin
  • vcpu_id - The ID of the vCPU
Source

fn on_translation_block_translate( &mut self, id: PluginId, tb: TranslationBlock<'_>, ) -> Result<(), Error>

Callback triggered on translation block translation

§Arguments
  • id - The ID of the plugin
  • tb - The translation block
Source

fn on_flush(&mut self, id: PluginId) -> Result<(), Error>

Callback triggered on flush

§Arguments
  • id - The ID of the plugin
Source

fn on_syscall( &mut self, id: PluginId, vcpu_index: VCPUIndex, num: i64, a1: u64, a2: u64, a3: u64, a4: u64, a5: u64, a6: u64, a7: u64, a8: u64, ) -> Result<(), Error>

Callback triggered on syscall

§Arguments
  • id - The ID of the plugin
  • vcpu_index - The ID of the vCPU
  • num - The syscall number
  • a1 - The first syscall argument
  • a2 - The second syscall argument
  • a3 - The third syscall argument
  • a4 - The fourth syscall argument
  • a5 - The fifth syscall argument
  • a6 - The sixth syscall argument
  • a7 - The seventh syscall argument
  • a8 - The eighth syscall argument
Source

fn on_syscall_return( &mut self, id: PluginId, vcpu_index: VCPUIndex, num: i64, ret: i64, ) -> Result<(), Error>

Callback triggered on syscall return

§Arguments
  • id - The ID of the plugin
  • vcpu_index - The ID of the vCPU
  • num - The syscall number
  • ret - The return value of the syscall

Implementors§