| 3584 | |
| 3585 | impl 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 | |
| 3626 | impl Drop for VmConfig { |