virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath,
                               virNodeDevCapPCIDevPtr pci_dev)
{
    if (virNodeDeviceGetPCISRIOVCaps(sysfsPath, pci_dev) < 0 ||
        virNodeDeviceGetPCIIOMMUGroupCaps(pci_dev) < 0)
        return -1;

    pci_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_PCI_MDEV;
    if (virNodeDeviceGetMdevTypesCaps(sysfsPath,
                                      &pci_dev->mdev_types,
                                      &pci_dev->nmdev_types) < 0)
        return -1;
    if (pci_dev->nmdev_types > 0)
        pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_MDEV;

    return 0;
}
virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath,
                               virNodeDevCapPCIDevPtr pci_dev)
{
    if (virNodeDeviceGetPCISRIOVCaps(sysfsPath, pci_dev) < 0 ||
        virNodeDeviceGetPCIIOMMUGroupCaps(pci_dev) < 0)
        return -1;

    pci_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_PCI_MDEV;
    if (virNodeDeviceGetMdevTypesCaps(sysfsPath,
                                      &pci_dev->mdev_types,
                                      &pci_dev->nmdev_types) < 0)
        return -1;
    if (pci_dev->nmdev_types > 0)
        pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_MDEV;

    return 0;
}