Patchwork [06/19] Fix regression for "-drive file="

login
register
mail settings
Submitter Kevin Wolf
Date June 15, 2010, 2:19 p.m.
Message ID <1276611581-3757-7-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/55693/
State New
Headers show

Comments

Kevin Wolf - June 15, 2010, 2:19 p.m.
From: Markus Armbruster <armbru@redhat.com>

Empty file used to create an empty drive (no media).  Since commit
9dfd7c7a, it's an error: "qemu: could not open disk image : No such
file or directory".  Older versions of libvirt can choke on this.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/blockdev.c b/blockdev.c
index 642ce75..dbeef09 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -462,7 +462,7 @@  DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
     case IF_COUNT:
         abort();
     }
-    if (!file) {
+    if (!file || !*file) {
         *fatal_error = 0;
         return NULL;
     }