@@ -71,7 +71,6 @@ fn create_hd(
7171 image_file : impl AsRef < Path > ,
7272 backing_file : Option < impl AsRef < Path > > ,
7373 size : & str ,
74- work_dir : Option < impl AsRef < Path > > ,
7574) -> Result < ( ) > {
7675 let mut command = Command :: new ( "qemu-img" ) ;
7776 command. arg ( "create" ) . arg ( "-f" ) . arg ( "qcow2" ) ;
@@ -83,11 +82,6 @@ fn create_hd(
8382 }
8483 command. arg ( image_file. as_ref ( ) ) ;
8584 command. arg ( size) ;
86-
87- // Set working directory if provided
88- if let Some ( work_dir) = work_dir {
89- command. current_dir ( work_dir. as_ref ( ) ) ;
90- }
9185 let output = command. output ( ) ?;
9286 if !output. status . success ( ) {
9387 bail ! (
@@ -347,12 +341,7 @@ impl VmConfig {
347341 let disk_size = format ! ( "{}G" , self . manifest. disk_size) ;
348342 let hda_path = workdir. hda_path ( ) ;
349343 if !hda_path. exists ( ) {
350- create_hd (
351- & hda_path,
352- self . image . hda . as_ref ( ) ,
353- & disk_size,
354- Some ( & workdir) ,
355- ) ?;
344+ create_hd ( & hda_path, self . image . hda . as_ref ( ) , & disk_size) ?;
356345 }
357346 if !cfg. user . is_empty ( ) {
358347 fs_err:: set_permissions ( & hda_path, Permissions :: from_mode ( 0o660 ) ) ?;
0 commit comments