virNodeDeviceCapMdevDefFormat(virBufferPtr buf,
                              const virNodeDevCapData *data)
{
    size_t i;

    virBufferEscapeString(buf, "<type id='%s'/>\n", data->mdev.type);
    virBufferAsprintf(buf, "<iommuGroup number='%u'/>\n",
                      data->mdev.iommuGroupNumber);

    for (i = 0; i < data->mdev.nattributes; i++) {
        virMediatedDeviceAttrPtr attr = data->mdev.attributes[i];
        virBufferAsprintf(buf, "<attr name='%s' value='%s'/>\n",
                          attr->name, attr->value);
    }
}
virNodeDeviceCapMdevDefFormat(virBufferPtr buf,
                              const virNodeDevCapData *data)
{
    size_t i;

    virBufferEscapeString(buf, "<type id='%s'/>\n", data->mdev.type);
    virBufferAsprintf(buf, "<iommuGroup number='%u'/>\n",
                      data->mdev.iommuGroupNumber);

    for (i = 0; i < data->mdev.nattributes; i++) {
        virMediatedDeviceAttrPtr attr = data->mdev.attributes[i];
        virBufferAsprintf(buf, "<attr name='%s' value='%s'/>\n",
                          attr->name, attr->value);
    }
}