[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH 1/4] qemu-io: Don't die on second open

From: Eric Blake
Subject: [Qemu-block] [PATCH 1/4] qemu-io: Don't die on second open
Date: Thu, 18 May 2017 21:32:30 -0500

Failure to open a file in qemu-io should normally return 1 on
failure to end the command loop, on the presumption that when
batching commands all on the command line, failure to open means
nothing further can be attempted. But when executing qemu-io
interactively, there is a special case: if open is executed a
second time, we print a hint that the user should try the
interactive 'close' first.  But the hint is useless if we don't
actually LET them try 'close'.

This has been awkward since at least as far back as commit
43642b3, in 2011 (probably earlier, but git blame has a harder
time going past the file renames at that point).

Signed-off-by: Eric Blake <address@hidden>
 qemu-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-io.c b/qemu-io.c
index 34fa8a1..0c82dac 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -63,7 +63,7 @@ static int openfile(char *name, int flags, bool writethrough, 
bool force_share,
     if (qemuio_blk) {
         error_report("file open already, try 'help close'");
-        return 1;
+        return 0;

     if (force_share) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]