mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
esx: add pciBridge devices when SCSI is used
When a SCSI controller is present, ESX adds several pciBridge devices to vmx file. This fixes an error message where it refuses to create VM due to not enough PCI devices available. This applies only to virtualHW version >= 7.
This commit is contained in:
parent
4d100c7a41
commit
2b89f1d8f5
@ -3082,6 +3082,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
|
||||
int scsi_virtualDev[4] = { -1, -1, -1, -1 };
|
||||
bool floppy_present[2] = { false, false };
|
||||
unsigned int maxvcpus;
|
||||
bool hasSCSI = false;
|
||||
|
||||
if (ctx->formatFileName == NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
@ -3288,6 +3289,8 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
if (scsi_present[i]) {
|
||||
hasSCSI = true;
|
||||
|
||||
virBufferAsprintf(&buffer, "scsi%zu.present = \"true\"\n", i);
|
||||
|
||||
if (scsi_virtualDev[i] != -1) {
|
||||
@ -3380,6 +3383,26 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virtualHW_version >= 7 && hasSCSI) {
|
||||
virBufferAddLit(&buffer, "pciBridge0.present = \"true\"\n");
|
||||
|
||||
virBufferAddLit(&buffer, "pciBridge4.present = \"true\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge4.virtualDev = \"pcieRootPort\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge4.functions = \"8\"\n");
|
||||
|
||||
virBufferAddLit(&buffer, "pciBridge5.present = \"true\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge5.virtualDev = \"pcieRootPort\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge5.functions = \"8\"\n");
|
||||
|
||||
virBufferAddLit(&buffer, "pciBridge6.present = \"true\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge6.virtualDev = \"pcieRootPort\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge6.functions = \"8\"\n");
|
||||
|
||||
virBufferAddLit(&buffer, "pciBridge7.present = \"true\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge7.virtualDev = \"pcieRootPort\"\n");
|
||||
virBufferAddLit(&buffer, "pciBridge7.functions = \"8\"\n");
|
||||
}
|
||||
|
||||
/* Get final VMX output */
|
||||
if (virBufferCheckError(&buffer) < 0)
|
||||
goto cleanup;
|
||||
|
@ -28,3 +28,16 @@ ethernet1.addressType = "generated"
|
||||
ethernet1.generatedAddress = "00:0c:29:3b:64:f4"
|
||||
ethernet1.generatedAddressOffset = "0"
|
||||
svga.vramSize = "4194304"
|
||||
pciBridge0.present = "true"
|
||||
pciBridge4.present = "true"
|
||||
pciBridge4.virtualDev = "pcieRootPort"
|
||||
pciBridge4.functions = "8"
|
||||
pciBridge5.present = "true"
|
||||
pciBridge5.virtualDev = "pcieRootPort"
|
||||
pciBridge5.functions = "8"
|
||||
pciBridge6.present = "true"
|
||||
pciBridge6.virtualDev = "pcieRootPort"
|
||||
pciBridge6.functions = "8"
|
||||
pciBridge7.present = "true"
|
||||
pciBridge7.virtualDev = "pcieRootPort"
|
||||
pciBridge7.functions = "8"
|
||||
|
@ -20,3 +20,16 @@ ethernet0.addressType = "static"
|
||||
ethernet0.address = "00:90:b9:dc:ea:81"
|
||||
ethernet0.checkMACAddress = "false"
|
||||
svga.vramSize = "4194304"
|
||||
pciBridge0.present = "true"
|
||||
pciBridge4.present = "true"
|
||||
pciBridge4.virtualDev = "pcieRootPort"
|
||||
pciBridge4.functions = "8"
|
||||
pciBridge5.present = "true"
|
||||
pciBridge5.virtualDev = "pcieRootPort"
|
||||
pciBridge5.functions = "8"
|
||||
pciBridge6.present = "true"
|
||||
pciBridge6.virtualDev = "pcieRootPort"
|
||||
pciBridge6.functions = "8"
|
||||
pciBridge7.present = "true"
|
||||
pciBridge7.virtualDev = "pcieRootPort"
|
||||
pciBridge7.functions = "8"
|
||||
|
@ -20,3 +20,16 @@ ethernet0.addressType = "static"
|
||||
ethernet0.address = "00:90:b9:dc:ea:81"
|
||||
ethernet0.checkMACAddress = "false"
|
||||
svga.vramSize = "4194304"
|
||||
pciBridge0.present = "true"
|
||||
pciBridge4.present = "true"
|
||||
pciBridge4.virtualDev = "pcieRootPort"
|
||||
pciBridge4.functions = "8"
|
||||
pciBridge5.present = "true"
|
||||
pciBridge5.virtualDev = "pcieRootPort"
|
||||
pciBridge5.functions = "8"
|
||||
pciBridge6.present = "true"
|
||||
pciBridge6.virtualDev = "pcieRootPort"
|
||||
pciBridge6.functions = "8"
|
||||
pciBridge7.present = "true"
|
||||
pciBridge7.virtualDev = "pcieRootPort"
|
||||
pciBridge7.functions = "8"
|
||||
|
Loading…
x
Reference in New Issue
Block a user