File 0002-Make-save-initramfs-show-command-output-more-useful.patch of Package virtme

From 8a914171ac633ad4b88ac704b6a5693c2e2e6164 Mon Sep 17 00:00:00 2001
From: Andy Lutomirski <luto@kernel.org>
Date: Wed, 16 Oct 2019 12:25:36 -0700
Subject: [PATCH 2/9] Make --save-initramfs --show-command output more useful

Now --save-initramfs uses the actual filesystem path for QEMU's -initrd.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 virtme/commands/run.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index 7526dea..4c354a1 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -529,8 +529,11 @@ def do_it() -> int:
             initramfsfile = os.fdopen(initramfsfd, 'r+b')
         mkinitramfs.mkinitramfs(initramfsfile, config)
         initramfsfile.flush()
-        fcntl.fcntl(initramfsfd, fcntl.F_SETFD, 0)
-        initrdpath = '/proc/self/fd/%d' % initramfsfd
+        if args.save_initramfs is not None:
+            initrdpath = args.save_initramfs
+        else:
+            fcntl.fcntl(initramfsfd, fcntl.F_SETFD, 0)
+            initrdpath = '/proc/self/fd/%d' % initramfsfd
     else:
         if args.save_initramfs is not None:
             print('--save_initramfs specified but initramfs is not used',
-- 
2.26.2

openSUSE Build Service is sponsored by