diff mbox

Fix regression for "-drive file="

Message ID m3sk5y4l1t.fsf@blackfin.pond.sub.org
State New
Headers show

Commit Message

Markus Armbruster May 11, 2010, 1:36 p.m. UTC
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>
---
If this goes in, I'll prepare a patch for stable as well.

 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Markus Armbruster June 8, 2010, 7:38 a.m. UTC | #1
Did this fall through the cracks?

Markus Armbruster <armbru@redhat.com> writes:

> 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>
> ---
> If this goes in, I'll prepare a patch for stable as well.
>
>  vl.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 85bcc84..78ec1b2 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1097,7 +1097,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
>      case IF_COUNT:
>          abort();
>      }
> -    if (!file) {
> +    if (!file || !*file) {
>          *fatal_error = 0;
>          return NULL;
>      }
Kevin Wolf June 8, 2010, 8:09 a.m. UTC | #2
Am 08.06.2010 09:38, schrieb Markus Armbruster:
> Did this fall through the cracks?

Looks like it. Rebased and applied to the block branch.

Kevin


> Markus Armbruster <armbru@redhat.com> writes:
> 
>> 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>
>> ---
>> If this goes in, I'll prepare a patch for stable as well.
>>
>>  vl.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index 85bcc84..78ec1b2 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -1097,7 +1097,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
>>      case IF_COUNT:
>>          abort();
>>      }
>> -    if (!file) {
>> +    if (!file || !*file) {
>>          *fatal_error = 0;
>>          return NULL;
>>      }
>
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 85bcc84..78ec1b2 100644
--- a/vl.c
+++ b/vl.c
@@ -1097,7 +1097,7 @@  DriveInfo *drive_init(QemuOpts *opts, void *opaque,
     case IF_COUNT:
         abort();
     }
-    if (!file) {
+    if (!file || !*file) {
         *fatal_error = 0;
         return NULL;
     }