@@ -34,24 +34,21 @@ struct RunCommand: ParsableCommand {
3434
3535 mutating func run( ) throws {
3636 do {
37- LoggingSystem . bootstrap ( App . standardError)
38- let log = Logger ( label: " vmexec " )
39-
4037 let spec : ContainerizationOCI . Spec
4138 do {
4239 let bundle = try ContainerizationOCI . Bundle. load ( path: URL ( filePath: bundlePath) )
4340 spec = try bundle. loadConfig ( )
4441 } catch {
4542 throw App . Failure ( message: " failed to load OCI bundle at \( bundlePath) : \( error) " )
4643 }
47- try execInNamespace ( spec: spec, log : log )
44+ try execInNamespace ( spec: spec)
4845 } catch {
4946 App . writeError ( error)
5047 throw error
5148 }
5249 }
5350
54- private func childRootSetup( rootfs: ContainerizationOCI . Root , mounts: [ ContainerizationOCI . Mount ] , log : Logger ) throws {
51+ private func childRootSetup( rootfs: ContainerizationOCI . Root , mounts: [ ContainerizationOCI . Mount ] ) throws {
5552 // setup rootfs
5653 try prepareRoot ( rootfs: rootfs. path)
5754 try mountRootfs ( rootfs: rootfs. path, mounts: mounts)
@@ -90,7 +87,6 @@ struct RunCommand: ParsableCommand {
9087 spec: ContainerizationOCI . Spec ,
9188 ackPipe: FileHandle ,
9289 syncPipe: FileHandle ,
93- log: Logger
9490 ) throws {
9591 guard let process = spec. process else {
9692 throw App . Failure ( message: " no process configuration found in runtime spec " )
@@ -119,7 +115,7 @@ struct RunCommand: ParsableCommand {
119115 throw App . Errno ( stage: " setsid() " )
120116 }
121117
122- try childRootSetup ( rootfs: root, mounts: spec. mounts, log : log )
118+ try childRootSetup ( rootfs: root, mounts: spec. mounts)
123119
124120 if process. terminal {
125121 let pty = try Console ( )
@@ -223,7 +219,7 @@ struct RunCommand: ParsableCommand {
223219 return unshareFlags
224220 }
225221
226- private func execInNamespace( spec: ContainerizationOCI . Spec , log : Logger ) throws {
222+ private func execInNamespace( spec: ContainerizationOCI . Spec ) throws {
227223 let syncPipe = FileHandle ( fileDescriptor: 3 )
228224 let ackPipe = FileHandle ( fileDescriptor: 4 )
229225
@@ -241,7 +237,7 @@ struct RunCommand: ParsableCommand {
241237 }
242238
243239 if processID == 0 { // child
244- try childSetup ( spec: spec, ackPipe: ackPipe, syncPipe: syncPipe, log : log )
240+ try childSetup ( spec: spec, ackPipe: ackPipe, syncPipe: syncPipe)
245241 } else { // parent process
246242 // Setup cgroup before child enters cgroup namespace
247243 if let linux = spec. linux {
0 commit comments