From e0e9815a430d79b069fb2e311952cd4d8dac45c0 Mon Sep 17 00:00:00 2001 From: yihuaf Date: Fri, 30 Jul 2021 19:32:26 +0200 Subject: [PATCH] Move ContainerInitArgs closer to where it is used --- src/container/builder_impl.rs | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/container/builder_impl.rs b/src/container/builder_impl.rs index 45a2616b4..2e68ba65a 100644 --- a/src/container/builder_impl.rs +++ b/src/container/builder_impl.rs @@ -21,24 +21,6 @@ use crate::{ use super::{Container, ContainerStatus}; -struct ContainerInitArgs { - /// Flag indicating if an init or a tenant container should be created - pub init: bool, - /// Interface to operating system primitives - pub syscall: LinuxSyscall, - /// OCI complient runtime spec - pub spec: Spec, - /// Root filesystem of the container - pub rootfs: PathBuf, - /// Socket to communicate the file descriptor of the ptty - pub console_socket: Option, - /// Options for rootless containers - pub rootless: Option, - /// Path to the Unix Domain Socket to communicate container start - pub notify_path: PathBuf, - /// Pipe used to communicate with the child process - pub child: child::ChildProcess, -} pub(super) struct ContainerBuilderImpl { /// Flag indicating if an init or a tenant container should be created pub init: bool, @@ -137,6 +119,25 @@ impl ContainerBuilderImpl { } } +struct ContainerInitArgs { + /// Flag indicating if an init or a tenant container should be created + pub init: bool, + /// Interface to operating system primitives + pub syscall: LinuxSyscall, + /// OCI complient runtime spec + pub spec: Spec, + /// Root filesystem of the container + pub rootfs: PathBuf, + /// Socket to communicate the file descriptor of the ptty + pub console_socket: Option, + /// Options for rootless containers + pub rootless: Option, + /// Path to the Unix Domain Socket to communicate container start + pub notify_path: PathBuf, + /// Pipe used to communicate with the child process + pub child: child::ChildProcess, +} + fn container_init(args: ContainerInitArgs) -> Result<()> { let command = &args.syscall; let spec = &args.spec;