[PATCH v6 2/4] conf: introduce support for acpi-bridge-hotplug feature

Laine Stump laine at redhat.com
Fri Oct 8 03:41:39 UTC 2021


On 10/7/21 11:12 PM, Laine Stump wrote:
> @@ -27932,6 +27995,30 @@ virDomainDefFormatFeatures(virBuffer *buf,
>                                  
> virDomainIBSTypeToString(def->features[i]));
>                break;
> +        case VIR_DOMAIN_FEATURE_PCI:
> +            if (def->features[i] != VIR_TRISTATE_SWITCH_ON)
> +                break;
> +
> +            virBufferAddLit(&childBuf, "<pci>\n");
> +            virBufferAdjustIndent(&childBuf, 2);
> +            for (j = 0; j < VIR_DOMAIN_PCI_LAST; j++) {
> +                switch ((virDomainPCI) j) {
> +                case VIR_DOMAIN_PCI_ACPI_BRIDGE_HP:
> +                    if (def->pci_features[j])

Oops, I missed this the first time I went through - this should compare 
to VIR_TRISTATE_SWITCH_ABSENT rather than just checking for non-0. It 
ends up being the same thing, but you never know - some day someone may 
decide to change the values of the VIR_TRISTATE_* enums just for fun...

> +                        virBufferAsprintf(&childBuf, "<%s state='%s'/>\n",
> +                                          virDomainPCITypeToString(j),
> +                                          virTristateSwitchTypeToString(
> +                                              def->pci_features[j]));
> +                    break;




More information about the libvir-list mailing list