On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote:
[...]
@@ -166,6 +166,10 @@ struct _virDomainDeviceInfo {
* assignment, never saved and never reported.
*/
int pciConnectFlags; /* enum virDomainPCIConnectFlags */
+ /* pciAddrExtFlags is only used interanlly to calculate PCI
+ * address extension flag before address assignment.
+ */
s/interanlly/internally/
s/flag before/flags during/
[...]
+typedef enum {
+ VIR_PCI_ADDRESS_EXTENSION_NONE = 0, /* no extension */
+ VIR_PCI_ADDRESS_EXTENSION_ZPCI = 1 << 0, /* zpci support */
s/zpci/zPCI/
[...]
+static bool
+qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device)
+{
+ switch ((virDomainDeviceType) device->type) {
No space after the cast, please.
This would ideally have been caught by 'make syntax-check' but
currently that's not the case (see [1]).
[...]
+static void
+qemuDomainFillDevicePCIExtensionFlags(virDomainDeviceDefPtr dev,
+ virQEMUCapsPtr qemuCaps)
+{
+ info->pciAddrExtFlags =
+ qemuDomainDeviceCalculatePCIAddressExtensionFlags(qemuCaps, dev);
This will not build because 'info' is not defined: you need to
either pass it to the function or obtain it from 'dev' using
virDomainDeviceGetInfo().
qemuDomainFillDevicePCIConnectFlags() is doing the latter, but you
seem to be going for the former since...
[...]
@@ -2989,6 +3121,8 @@ qemuDomainEnsurePCIAddress(virDomainObjPtr
obj,
qemuDomainFillDevicePCIConnectFlags(obj->def, dev, priv->qemuCaps, driver);
+ qemuDomainFillDevicePCIExtensionFlags(dev, info, priv->qemuCaps);
... you're passing it to the function here, which again the compiler
very understandably complains about.
With the above addressed,
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
[1]
https://www.redhat.com/archives/libvir-list/2018-October/msg00641.html
--
Andrea Bolognani / Red Hat / Virtualization