[libvirt] [PATCH 1/3] esx: add pciBridge devices when SCSI is used
Matthias Bolte
matthias.bolte at googlemail.com
Thu May 26 08:57:45 UTC 2016
2016-05-23 23:22 GMT+02:00 Dawid Zamirski <dzamirski at datto.com>:
> 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.
> ---
> src/vmx/vmx.c | 25 ++++++++++++++++++++++
> tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx | 13 +++++++++++
> tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx | 13 +++++++++++
> tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx | 13 +++++++++++
> 4 files changed, 64 insertions(+)
> @@ -3298,6 +3300,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
> }
> }
>
> +
> for (i = 0; i < def->ndisks; ++i) {
> switch (def->disks[i]->device) {
> case VIR_DOMAIN_DISK_DEVICE_DISK:
Unnecessary whitespace change. I'll remove this hunk before pushing.
> @@ -3380,6 +3383,28 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
> goto cleanup;
> }
>
> + if (virtualHW_version >= 7) {
> + if (hasScsi) {
> + }
> + }
Those two if blocks can be merged into one. I'll do that before pushing.
Also hasScsi doesn't pass make syntax-check. It has to be hasSCSI.
I'll fix that before pushing.
> diff --git a/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx
> index 5693210..ab09bc9 100644
> --- a/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx
> +++ b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx
> @@ -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"
Matches what we already have in some vmx2xml in-the-wild files.
ACK and pushed with the listed changes.
--
Matthias Bolte
http://photron.blogspot.com
More information about the libvir-list
mailing list