mirror of https://gitee.com/openkylin/qemu.git
Avoid asprintf() which is not available on mingw
Use g_strdup_printf() instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
731dc9ecd4
commit
5f893b4e9c
|
@ -307,13 +307,9 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (asprintf(&name, "%s-msix", dev->name) == -1) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
name = g_strdup_printf("%s-msix", dev->name);
|
||||
memory_region_init(&dev->msix_exclusive_bar, name, MSIX_EXCLUSIVE_BAR_SIZE);
|
||||
|
||||
free(name);
|
||||
g_free(name);
|
||||
|
||||
ret = msix_init(dev, nentries, &dev->msix_exclusive_bar, bar_nr,
|
||||
MSIX_EXCLUSIVE_BAR_TABLE_OFFSET, &dev->msix_exclusive_bar,
|
||||
|
|
Loading…
Reference in New Issue