pub fn cgroups_from_numa_node(
        &mut self,
        numa_node: u32,
        microvm_id: &str,
        exec_file_name: &OsStr,
    ) -> Result<Vec<Box<dyn Cgroup>>> {
        // Retrieve the CPUs which belongs to the specific node.
        // Similar to how numactl library does, we are copying the contents of
        // /sys/devices/system/node/nodeX/cpulist to the cpuset.cpus file for ensuring
        // correct numa cpu assignment.
        let cpus = readln_special(&PathBuf::from(format!(
            "{}{}/cpulist",
            NODE_TO_CPULIST, numa_node
        )))?;

        // Isolate the process in the specified numa_node CPUs.
        let cpuset_cpus =
            self.new_cgroup("cpuset.cpus".to_string(), cpus, microvm_id, exec_file_name)?;

        // Isolate the process in the specified numa_node memory.
        let cpuset_mems = self.new_cgroup(
            "cpuset.mems".to_string(),
            numa_node.to_string(),
            microvm_id,
            exec_file_name,
        )?;

        Ok(vec![cpuset_cpus, cpuset_mems])
    }
// This function should be removed once the `--node` argument is removed.
// This function generates the corresponding cgroups for isolating the process in the specified
// NUMA node.
This function should be removed once the `--node` argument is removed.
This function generates the corresponding cgroups for isolating the process in the specified
NUMA node.
This function should be removed once the ` -- node ` argument is removed . This function generates the corresponding cgroups for isolating the process in the specified NUMA node .
pub fn cgroups_from_numa_node(
        &mut self,
        numa_node: u32,
        microvm_id: &str,
        exec_file_name: &OsStr,
    ) -> Result<Vec<Box<dyn Cgroup>>> {
        // Retrieve the CPUs which belongs to the specific node.
        // Similar to how numactl library does, we are copying the contents of
        // /sys/devices/system/node/nodeX/cpulist to the cpuset.cpus file for ensuring
        // correct numa cpu assignment.
        let cpus = readln_special(&PathBuf::from(format!(
            "{}{}/cpulist",
            NODE_TO_CPULIST, numa_node
        )))?;
        // Isolate the process in the specified numa_node CPUs.
        let cpuset_cpus =
            self.new_cgroup("cpuset.cpus".to_string(), cpus, microvm_id, exec_file_name)?;
        // Isolate the process in the specified numa_node memory.
        let cpuset_mems = self.new_cgroup(
            "cpuset.mems".to_string(),
            numa_node.to_string(),
            microvm_id,
            exec_file_name,
        )?;
        Ok(vec![cpuset_cpus, cpuset_mems])
    }
pub fn cgroups_from_numa_node ( & mut self , numa_node : u32 , microvm_id : & str , exec_file_name : & OsStr , ) -> Result < Vec < Box < dyn Cgroup > > > { // Retrieve the CPUs which belongs to the specific node. // Similar to how numactl library does, we are copying the contents of // /sys/devices/system/node/nodeX/cpulist to the cpuset.cpus file for ensuring // correct numa cpu assignment. let cpus = readln_special ( & PathBuf :: from ( format ! ( " " NODE_TO_CPULIST numa_node ) ) ) ? ; // Isolate the process in the specified numa_node CPUs. let cpuset_cpus = self . new_cgroup ( " " . to_string ( ) , cpus , microvm_id , exec_file_name ) ? ; // Isolate the process in the specified numa_node memory. let cpuset_mems = self . new_cgroup ( " " . to_string ( ) , numa_node . to_string ( ) , microvm_id , exec_file_name , ) ? ; Ok ( vec ! [ cpuset_cpus cpuset_mems ] ) }
This function should be removed once the `--node` argument is removed.
This function should be removed once the ` -- node ` argument is removed .
&mut self
numa_node
u32
microvm_id
&str
exec_file_name
&OsStr
&mut self
numa_node
u32
microvm_id
&str
exec_file_name
&OsStr