[libvirt] [PATCH] esx: Explicitly disable unused floppy0 device for GSX

floppy0.present defaults to true for GSX. Therefore, it needs to be explicitly disabled for GSX. --- src/esx/esx_vmx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c index d5d9ff0..61aaf10 100644 --- a/src/esx/esx_vmx.c +++ b/src/esx/esx_vmx.c @@ -216,6 +216,7 @@ def->disks[0]... ## disks: floppy from .flp image ############################################### floppy0.present = "true" # defaults to "false" + # defaults to "true" for GSX floppy0.startConnected = "true" # defaults to "true" floppy0.clientDevice = "false" # defaults to "false" @@ -236,6 +237,7 @@ def->disks[0]... ## disks: floppy from host device ############################################## floppy0.present = "true" # defaults to "false" + # defaults to "true" for GSX floppy0.startConnected = "true" # defaults to "true" floppy0.clientDevice = "false" # defaults to "false" @@ -2320,6 +2322,7 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, virBuffer buffer = VIR_BUFFER_INITIALIZER; bool scsi_present[4] = { false, false, false, false }; int scsi_virtualDev[4] = { -1, -1, -1, -1 }; + bool hasFloppyDevice = false; if (ctx->formatFileName == NULL) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", @@ -2525,6 +2528,8 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, break; case VIR_DOMAIN_DISK_DEVICE_FLOPPY: + hasFloppyDevice = true; + if (esxVMX_FormatFloppy(ctx, def->disks[i], &buffer) < 0) { goto failure; } @@ -2539,6 +2544,11 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, } } + if (!hasFloppyDevice && productVersion & esxVI_ProductVersion_GSX) { + /* floppy0.present defaults to true for GSX, disable it explicitly */ + virBufferAddLit(&buffer, "floppy0.present = \"false\"\n"); + } + /* def:fss */ /* FIXME */ -- 1.7.0.4

On 08/05/2010 06:45 PM, Matthias Bolte wrote:
floppy0.present defaults to true for GSX. Therefore, it needs to be explicitly disabled for GSX. --- src/esx/esx_vmx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
If I understand correctly, you want to uniformly make floppy not present except when the user asked for it. The other ESX clients meet this goal, but for GSX, you have to add an extra argument to make it so. That being the case, I agree with the approach.
@@ -2539,6 +2544,11 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, } }
+ if (!hasFloppyDevice && productVersion & esxVI_ProductVersion_GSX) {
I'd add an extra () here to make precedence clear: if (!hasFloppyDevice && (productVersion & esxVI_ProductVersion_GSX)) { ACK with that nit fixed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Mon, Aug 09, 2010 at 04:44:14PM -0600, Eric Blake wrote:
On 08/05/2010 06:45 PM, Matthias Bolte wrote:
floppy0.present defaults to true for GSX. Therefore, it needs to be explicitly disabled for GSX. --- src/esx/esx_vmx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
If I understand correctly, you want to uniformly make floppy not present except when the user asked for it. The other ESX clients meet this goal, but for GSX, you have to add an extra argument to make it so. That being the case, I agree with the approach.
@@ -2539,6 +2544,11 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, } }
+ if (!hasFloppyDevice && productVersion & esxVI_ProductVersion_GSX) {
I'd add an extra () here to make precedence clear:
if (!hasFloppyDevice && (productVersion & esxVI_ProductVersion_GSX)) {
ACK with that nit fixed.
Agreed, ACK Matthias you push it ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2010/8/11 Daniel Veillard <veillard@redhat.com>:
On Mon, Aug 09, 2010 at 04:44:14PM -0600, Eric Blake wrote:
On 08/05/2010 06:45 PM, Matthias Bolte wrote:
floppy0.present defaults to true for GSX. Therefore, it needs to be explicitly disabled for GSX. --- src/esx/esx_vmx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
If I understand correctly, you want to uniformly make floppy not present except when the user asked for it. The other ESX clients meet this goal, but for GSX, you have to add an extra argument to make it so. That being the case, I agree with the approach.
That's the intention, but it didn't struck me right away that ESX and GSX being different here is odd. I noticed that floppy0.present defaults to true on GSX while investigating some other GSX related issues in the VMX handling code. The comments in the esx_vmx.c file indicate that ESX would default to false in that case, but that's wrong, as I know now. floppy0.present defaults to true for GSX _and_ ESX, so the assumed default for ESX was wrong all the time. I probably screwed it when I wrote the initial VMX handling code. Therefore, this patch is incomplete and we need a v2 to address the ESX issue too.
@@ -2539,6 +2544,11 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, } }
+ if (!hasFloppyDevice && productVersion & esxVI_ProductVersion_GSX) {
I'd add an extra () here to make precedence clear:
if (!hasFloppyDevice && (productVersion & esxVI_ProductVersion_GSX)) {
ACK with that nit fixed.
v2 won't have the product version check anymore.
Agreed, ACK
Matthias you push it ?
Daniel
Well, no, as we need a v2 for this :) Matthias
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Matthias Bolte