
On Mon, Oct 14, 2013 at 06:14:33PM -0400, Geoff Hickey wrote:
[Updated to include unit tests]
The vmx file parsing code was reporting errors when parsing floppy.fileName entries if the filename didn't end in .flp. There is no such restriction in ESX; even using the GUI to configure floppy filenames you can specify any arbitrary file with any extension.
Fix by changing the vmx parsing code so that it uses the floppy.fileType value to determine whether floppy.fileName refers to a block device or a regular file.
Also remove code that would have generated an error if no floppy.fileName was specified. This is not an error either.
Updated the floppy tests in vmx2xmltest.c and xml2vmxtest.c. --- src/vmx/vmx.c | 28 ++++------------------------ tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 3 +++ tests/vmx2xmldata/vmx2xml-floppy-file.xml | 5 +++++ tests/xml2vmxdata/xml2vmx-floppy-file.vmx | 4 +++- tests/xml2vmxdata/xml2vmx-floppy-file.xml | 4 ++++ 5 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/tests/vmx2xmldata/vmx2xml-floppy-file.vmx b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx index b9ee81b..344ac78 100644 --- a/tests/vmx2xmldata/vmx2xml-floppy-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx @@ -3,3 +3,6 @@ virtualHW.version = "4" floppy0.present = "true" floppy0.fileType = "file" floppy0.fileName = "floppy.flp" +floppy1.present = "true" +floppy1.fileType = "file" +floppy1.fileName = "floppy" \ No newline at end of file
We require a newline at end of files. If you ever do more patches in the future use the 'make syntax-check' command to validate style issues. ACK, I've fixed this style issue & pushed to GIT master. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|