From 7f50a41525c3a1e87842866608fdd34973e30265 Mon Sep 17 00:00:00 2001 From: Mark Ryan Date: Fri, 26 Aug 2016 16:29:35 +0100 Subject: [PATCH] qemu: Fix a silly bug in LaunchQemu There's no point in setting cmd.ExtraFiles if the fds array is an empty slice. This won't do any harm but is essentially a no-op. Signed-off-by: Mark Ryan --- qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu.go b/qemu.go index 4984ec63d6..88af0217b8 100644 --- a/qemu.go +++ b/qemu.go @@ -51,7 +51,7 @@ import ( func LaunchQemu(ctx context.Context, params []string, fds []*os.File, logger QMPLog) (string, error) { errStr := "" cmd := exec.Command("qemu-system-x86_64", params...) - if fds != nil { + if len(fds) > 0 { logger.Infof("Adding extra file %v", fds) cmd.ExtraFiles = fds }