entries if the filename didn't end in .flp. There is no such restriction in
arbitrary file with any extension.
regular file.
---
src/vmx/vmx.c | 26 +++++---------------------
1 file changed, 5 insertions(+), 21 deletions(-)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 38b7cc0..ffe7e7a 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2250,27 +2250,18 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
goto cleanup;
}
} else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
- if (virFileHasSuffix(fileName, ".flp")) {
- if (fileType != NULL) {
- if (STRCASENEQ(fileType, "file")) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'file' but "
- "found '%s'"), fileType_name, fileType);
- goto cleanup;
- }
- }
+ if (fileType != NULL && STRCASEEQ(fileType, "device")) {
+ (*def)->type = VIR_DOMAIN_DISK_TYPE_BLOCK;
+ (*def)->src = fileName;
+ fileName = NULL;
+ } else if (fileType != NULL && STRCASEEQ(fileType, "file")) {
(*def)->type = VIR_DOMAIN_DISK_TYPE_FILE;
(*def)->src = ctx->parseFileName(fileName, ctx->opaque);
if ((*def)->src == NULL) {
goto cleanup;
}
- } else if (fileType != NULL && STRCASEEQ(fileType, "device")) {
- (*def)->type = VIR_DOMAIN_DISK_TYPE_BLOCK;
- (*def)->src = fileName;
-
- fileName = NULL;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid or not yet handled value '%s' "
@@ -3538,13 +3529,6 @@ virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def,
virBufferAsprintf(buffer, "floppy%d.fileType = \"file\"\n", unit);
if (def->src != NULL) {
- if (! virFileHasSuffix(def->src, ".flp")) {
- virReportError(VIR_ERR_INTERNAL_ERROR,