MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / clone

Method clone

vmm/src/config.rs:3586–3623  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

3584
3585impl Clone for VmConfig {
3586 fn clone(&self) -> Self {
3587 VmConfig {
3588 cpus: self.cpus.clone(),
3589 memory: self.memory.clone(),
3590 payload: self.payload.clone(),
3591 rate_limit_groups: self.rate_limit_groups.clone(),
3592 disks: self.disks.clone(),
3593 net: self.net.clone(),
3594 rng: self.rng.clone(),
3595 balloon: self.balloon.clone(),
3596 #[cfg(feature = "pvmemcontrol")]
3597 pvmemcontrol: self.pvmemcontrol.clone(),
3598 fs: self.fs.clone(),
3599 generic_vhost_user: self.generic_vhost_user.clone(),
3600 pmem: self.pmem.clone(),
3601 serial: self.serial.clone(),
3602 console: self.console.clone(),
3603 #[cfg(target_arch = "x86_64")]
3604 debug_console: self.debug_console.clone(),
3605 devices: self.devices.clone(),
3606 user_devices: self.user_devices.clone(),
3607 vdpa: self.vdpa.clone(),
3608 vsock: self.vsock.clone(),
3609 numa: self.numa.clone(),
3610 pci_segments: self.pci_segments.clone(),
3611 platform: self.platform.clone(),
3612 tpm: self.tpm.clone(),
3613 preserved_fds: self
3614 .preserved_fds
3615 .as_ref()
3616 // SAFETY: FFI call with valid FDs
3617 .map(|fds| fds.iter().map(|fd| unsafe { libc::dup(*fd) }).collect()),
3618 landlock_rules: self.landlock_rules.clone(),
3619 #[cfg(feature = "ivshmem")]
3620 ivshmem: self.ivshmem.clone(),
3621 ..*self
3622 }
3623 }
3624}
3625
3626impl Drop for VmConfig {

Callers 15

getMethod · 0.45
newMethod · 0.45
queues_per_threadMethod · 0.45
start_block_backendFunction · 0.45
idMethod · 0.45
allocate_barsMethod · 0.45
move_barMethod · 0.45
idMethod · 0.45
idMethod · 0.45
restore_vgicMethod · 0.45
get_vgicMethod · 0.45
set_gicr_typersMethod · 0.45

Calls 2

iterMethod · 0.80
mapMethod · 0.45

Tested by 15

pl011_outputFunction · 0.36
test_dmaFunction · 0.36
serial_outputFunction · 0.36
logger_pid_tokenFunction · 0.36
logger_tid_tokenFunction · 0.36
test_virtio_block_vhdFunction · 0.36
test_virtio_block_vhdxFunction · 0.36