Skip to content

Commit c630f37

Browse files
avnikastro
authored andcommitted
Moving pci/usb ids out of shell escaping
Signed-off-by: Alexander V. Nikolaev <[email protected]>
1 parent 1d261ce commit c630f37

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lib/runners/qemu.nix

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,25 +295,25 @@ lib.warnIf (mem == 2048) ''
295295
"-device" "qemu-xhci"
296296
]
297297
++
298-
builtins.concatMap ({ bus, path, qemu,... }: {
299-
pci = [
300-
"-device" "vfio-pci,host=${path},multifunction=on${
301-
# Allow to pass additional arguments to pci device
302-
lib.optionalString (qemu.deviceExtraArgs != null) ",${qemu.deviceExtraArgs}"
303-
}"
304-
];
305-
usb = [
306-
"-device" "usb-host,${path}"
307-
];
308-
}.${bus}) devices
309-
++
310298
lib.optionals (vsock.cid != null) [
311299
"-device"
312300
"vhost-vsock-${devType},guest-cid=${toString vsock.cid}"
313301
]
314302
++
315303
extraArgs
316-
);
304+
)
305+
+ " " + # Move vfio-pci outside of
306+
(lib.concatMapStringsSep " " ({ bus, path, qemu,... }: {
307+
pci = [
308+
"-device" "vfio-pci,host=${path},multifunction=on${
309+
# Allow to pass additional arguments to pci device
310+
lib.optionalString (qemu.deviceExtraArgs != null) ",${qemu.deviceExtraArgs}"
311+
}"
312+
];
313+
usb = [
314+
"-device" "usb-host,${path}"
315+
];
316+
}.${bus}) devices);
317317

318318
canShutdown = socket != null;
319319

0 commit comments

Comments
 (0)