<div dir="ltr">Eric: No problem, I'll resubmit with git (sorry about that, it's been long enough since my last submit that I forgot about that), but I'll fix the issue that Doug pointed out first. As for the pointer comparison to NULL, I'm in complete agreement, but that particular source file uses the != NULL idiom everywhere. I'd be happy to remove it everywhere, but that should be done as a separate submit, I would think?<div>
<br></div><div>Thanks, 2nd try soon. :)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 10, 2013 at 4:15 PM, Doug Goldstein <span dir="ltr"><<a href="mailto:cardoe@gentoo.org" target="_blank">cardoe@gentoo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Oct 10, 2013 at 2:21 PM, Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:<br>

> On 10/09/2013 07:39 PM, Geoff Hickey wrote:<br>
>> The vmx file parsing code was reporting errors when parsing floppy.fileName<br>
>> entries if the filename didn't end in .flp. There is no such restriction in<br>
>> ESX; even using the GUI to configure floppy filenames you can specify any<br>
>> arbitrary file with any extension.<br>
>><br>
>> Fix by changing the vmx parsing code so that it uses the floppy.fileType<br>
>> value to determine whether floppy.fileName refers to a block device or a<br>
>> regular file.<br>
>> ---<br>
>>  src/vmx/vmx.c | 26 +++++---------------------<br>
>>  1 file changed, 5 insertions(+), 21 deletions(-)<br>
>><br>
>> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c<br>
>> index 38b7cc0..ffe7e7a 100644<br>
>> --- a/src/vmx/vmx.c<br>
>> +++ b/src/vmx/vmx.c<br>
>> @@ -2250,27 +2250,18 @@ virVMXParseDisk(virVMXContext *ctx,<br>
>> virDomainXMLOptionPtr xmlopt, virConfPtr con<br>
>>              goto cleanup;<br>
>>          }<br>
>>      } else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {<br>
>> -        if (virFileHasSuffix(fileName, ".flp")) {<br>
>> -            if (fileType != NULL) {<br>
>> -                if (STRCASENEQ(fileType, "file")) {<br>
>> -                    virReportError(VIR_ERR_INTERNAL_ERROR,<br>
>> -                                   _("Expecting VMX entry '%s' to be<br>
>> 'file' but "<br>
><br>
> Your mailer corrupted your patch.  Would you mind resending it via 'git<br>
> send-email', or at a bare minimum as an attachment rather than inline,<br>
> so that maintainers can just 'git am' it?<br>
><br>
> Applying: esx: Fix floppy.fileName handling in the vmx file parser<br>
> fatal: corrupt patch at line 10<br>
> Repository lacks necessary blobs to fall back on 3-way merge.<br>
> Cannot fall back to three-way merge.<br>
> Patch failed at 0001 esx: Fix floppy.fileName handling in the vmx file<br>
> parser<br>
><br>
> See also <a href="http://libvirt.org/hacking.html" target="_blank">http://libvirt.org/hacking.html</a> for hints.<br>
><br>
>> +        if (fileType != NULL && STRCASEEQ(fileType, "device")) {<br>
><br>
> It's simpler to just use a pointer variable in boolean context instead<br>
> of explicit comparison against NULL (this isn't Java).  As in:<br>
><br>
> if (fileType && STRCASEEQ(fileType, "device")) {<br>
><br>
> At any rate, your change looks reasonable to me; I wouldn't mind<br>
> applying it if you can resend to touch up those issues.<br>
><br>
> --<br>
> Eric Blake   eblake redhat com    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
> Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
><br>
><br>
</div></div>> --<br>
> libvir-list mailing list<br>
> <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvir-list" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
<br>
FWIW, I've been fixing a number of these poor assumptions lately.<br>
There's no limitation that there must be a fileName specified either<br>
and the way the patch is formulated it will treat it as a fatal error<br>
that there is a floppy drive defined with no file name for the floppy<br>
image.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Doug Goldstein<br>
</font></span></blockquote></div><br></div>