@@ -111,7 +111,7 @@ impl Qemu {
111111 . args ( self . machine_args ( arch) )
112112 . args ( self . cpu_args ( arch) )
113113 . args ( & [ "-smp" , & effective_smp. to_string ( ) ] )
114- . args ( & [ "-m" . to_string ( ) , format ! ( "{memory}M" ) ] )
114+ . args ( & [ "-m" . to_owned ( ) , format ! ( "{memory}M" ) ] )
115115 . args ( & [ "-global" , "virtio-mmio.force-legacy=off" ] )
116116 . args ( self . device_args ( memory) )
117117 . args ( self . cmdline_args ( image_name) ) ;
@@ -199,22 +199,22 @@ impl Qemu {
199199 let vars = prebuilt. get_file ( Arch :: X64 , FileType :: Vars ) ;
200200
201201 vec ! [
202- "-drive" . to_string ( ) ,
202+ "-drive" . to_owned ( ) ,
203203 format!( "if=pflash,format=raw,readonly=on,file={}" , code. display( ) ) ,
204- "-drive" . to_string ( ) ,
204+ "-drive" . to_owned ( ) ,
205205 format!( "if=pflash,format=raw,readonly=on,file={}" , vars. display( ) ) ,
206- "-drive" . to_string ( ) ,
207- "format=raw,file=fat:rw:target/esp" . to_string ( ) ,
206+ "-drive" . to_owned ( ) ,
207+ "format=raw,file=fat:rw:target/esp" . to_owned ( ) ,
208208 ]
209209 } else {
210- let mut image_args = vec ! [ "-kernel" . to_string ( ) , loader] ;
210+ let mut image_args = vec ! [ "-kernel" . to_owned ( ) , loader] ;
211211 match arch {
212212 Arch :: X86_64 | Arch :: Riscv64 => {
213- image_args. push ( "-initrd" . to_string ( ) ) ;
214- image_args. push ( image. to_str ( ) . unwrap ( ) . to_string ( ) ) ;
213+ image_args. push ( "-initrd" . to_owned ( ) ) ;
214+ image_args. push ( image. to_str ( ) . unwrap ( ) . to_owned ( ) ) ;
215215 }
216216 Arch :: Aarch64 | Arch :: Aarch64Be => {
217- image_args. push ( "-device" . to_string ( ) ) ;
217+ image_args. push ( "-device" . to_owned ( ) ) ;
218218 image_args. push ( format ! (
219219 "guest-loader,addr=0x48000000,initrd={}" ,
220220 image. display( )
@@ -230,18 +230,18 @@ impl Qemu {
230230 fn machine_args ( & self , arch : Arch ) -> Vec < String > {
231231 if self . microvm {
232232 vec ! [
233- "-M" . to_string ( ) ,
233+ "-M" . to_owned ( ) ,
234234 "microvm,x-option-roms=off,pit=off,pic=off,rtc=on,auto-kernel-cmdline=off,acpi=off"
235- . to_string ( ) ,
236- "-global" . to_string ( ) ,
237- "virtio-mmio.force-legacy=off" . to_string ( ) ,
238- "-nodefaults" . to_string ( ) ,
239- "-no-user-config" . to_string ( ) ,
235+ . to_owned ( ) ,
236+ "-global" . to_owned ( ) ,
237+ "virtio-mmio.force-legacy=off" . to_owned ( ) ,
238+ "-nodefaults" . to_owned ( ) ,
239+ "-no-user-config" . to_owned ( ) ,
240240 ]
241241 } else if self . pci_e {
242242 vec ! [ "-machine" . to_owned( ) , "q35" . to_owned( ) ]
243243 } else if arch == Arch :: Aarch64 || arch == Arch :: Aarch64Be {
244- vec ! [ "-machine" . to_string ( ) , "virt,gic-version=3" . to_string ( ) ]
244+ vec ! [ "-machine" . to_owned ( ) , "virt,gic-version=3" . to_owned ( ) ]
245245 } else if arch == Arch :: Riscv64 {
246246 // CadenceGem requires sifive_u
247247 let machine = if self . devices . contains ( & Device :: CadenceGem ) {
@@ -250,10 +250,10 @@ impl Qemu {
250250 "virt"
251251 } ;
252252 vec ! [
253- "-machine" . to_string ( ) ,
254- machine. to_string ( ) ,
255- "-bios" . to_string ( ) ,
256- "opensbi-1.7-rv-bin/share/opensbi/lp64/generic/firmware/fw_jump.bin" . to_string ( ) ,
253+ "-machine" . to_owned ( ) ,
254+ machine. to_owned ( ) ,
255+ "-bios" . to_owned ( ) ,
256+ "opensbi-1.7-rv-bin/share/opensbi/lp64/generic/firmware/fw_jump.bin" . to_owned ( ) ,
257257 ]
258258 } else {
259259 vec ! [ ]
@@ -266,27 +266,27 @@ impl Qemu {
266266 let mut cpu_args = if self . accel {
267267 if cfg ! ( target_os = "linux" ) {
268268 vec ! [
269- "-enable-kvm" . to_string ( ) ,
270- "-cpu" . to_string ( ) ,
271- "host" . to_string ( ) ,
269+ "-enable-kvm" . to_owned ( ) ,
270+ "-cpu" . to_owned ( ) ,
271+ "host" . to_owned ( ) ,
272272 ]
273273 } else {
274274 todo ! ( )
275275 }
276276 } else {
277- vec ! [ "-cpu" . to_string ( ) , "Skylake-Client" . to_string ( ) ]
277+ vec ! [ "-cpu" . to_owned ( ) , "Skylake-Client" . to_owned ( ) ]
278278 } ;
279- cpu_args. push ( "-device" . to_string ( ) ) ;
280- cpu_args. push ( "isa-debug-exit,iobase=0xf4,iosize=0x04" . to_string ( ) ) ;
279+ cpu_args. push ( "-device" . to_owned ( ) ) ;
280+ cpu_args. push ( "isa-debug-exit,iobase=0xf4,iosize=0x04" . to_owned ( ) ) ;
281281 cpu_args
282282 }
283283 Arch :: Aarch64 | Arch :: Aarch64Be => {
284284 let mut cpu_args = if self . accel {
285285 todo ! ( )
286286 } else {
287- vec ! [ "-cpu" . to_string ( ) , "cortex-a72" . to_string ( ) ]
287+ vec ! [ "-cpu" . to_owned ( ) , "cortex-a72" . to_owned ( ) ]
288288 } ;
289- cpu_args. push ( "-semihosting" . to_string ( ) ) ;
289+ cpu_args. push ( "-semihosting" . to_owned ( ) ) ;
290290 cpu_args
291291 }
292292 Arch :: Riscv64 => {
@@ -297,7 +297,7 @@ impl Qemu {
297297 // possibly because it requires sifive_u as the machine.
298298 vec ! [ ]
299299 } else {
300- vec ! [ "-cpu" . to_string ( ) , "rv64" . to_string ( ) ]
300+ vec ! [ "-cpu" . to_owned ( ) , "rv64" . to_owned ( ) ]
301301 }
302302 }
303303 }
@@ -346,15 +346,15 @@ impl Qemu {
346346 . flat_map ( |device| match device {
347347 Device :: CadenceGem => {
348348 vec ! [
349- "-nic" . to_string ( ) ,
349+ "-nic" . to_owned ( ) ,
350350 format!( "{netdev_options},model=cadence_gem" ) ,
351351 ]
352352 }
353353 device @ ( Device :: Rtl8139 | Device :: VirtioNetMmio | Device :: VirtioNetPci ) => {
354354 let mut netdev_args = vec ! [
355- "-netdev" . to_string ( ) ,
356- netdev_options. to_string ( ) ,
357- "-device" . to_string ( ) ,
355+ "-netdev" . to_owned ( ) ,
356+ netdev_options. to_owned ( ) ,
357+ "-device" . to_owned ( ) ,
358358 ] ;
359359
360360 let mut device_arg = match device {
@@ -363,7 +363,7 @@ impl Qemu {
363363 Device :: Rtl8139 => "rtl8139,netdev=net0" ,
364364 _ => unreachable ! ( ) ,
365365 }
366- . to_string ( ) ;
366+ . to_owned ( ) ;
367367
368368 if !self . no_default_virtio_features
369369 && ( device == Device :: VirtioNetPci || device == Device :: VirtioNetMmio )
@@ -382,18 +382,18 @@ impl Qemu {
382382 ""
383383 } ;
384384 vec ! [
385- "-chardev" . to_string ( ) ,
386- "socket,id=char0,path=./vhostqemu" . to_string ( ) ,
387- "-device" . to_string ( ) ,
385+ "-chardev" . to_owned ( ) ,
386+ "socket,id=char0,path=./vhostqemu" . to_owned ( ) ,
387+ "-device" . to_owned ( ) ,
388388 format!(
389389 "vhost-user-fs-pci,queue-size=1024{default_virtio_features},chardev=char0,tag=root"
390390 ) ,
391- "-object" . to_string ( ) ,
391+ "-object" . to_owned ( ) ,
392392 format!(
393393 "memory-backend-file,id=mem,size={memory}M,mem-path=/dev/shm,share=on"
394394 ) ,
395- "-numa" . to_string ( ) ,
396- "node,memdev=mem" . to_string ( ) ,
395+ "-numa" . to_owned ( ) ,
396+ "node,memdev=mem" . to_owned ( ) ,
397397 ]
398398 }
399399 device @ ( Device :: VirtioConsoleMmio | Device :: VirtioConsolePci ) => {
0 commit comments