VFIO updates 2015-09-25

- Remove use of g_malloc0_n for glib2.22 compat
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWBX0cAAoJECObm247sIsidV0P/1A1hgFW+iFl2sA5kesfV3DG
 FSiPTEI0xF+lDJM498i31QatvVAAMYgk6qK7CWyRCodfWhCntAUxAPoUkeKsEP+k
 cVo7qOeO+PUCFwVdykuxWRTsVVkuhjcOZZ0UylWs9A5G2biIncTzum8mAycTshqz
 AWqk52pQMTAgkV5bD/ZAH1IMp9NX1Ipc2mngtXubhYDZPCVq2ERHbr2TqTj27Qzj
 9f1tdeD0VOy6JvQqu2nFqDMrDaVtjMAUldg473UfNTNNaNUdvbr4+o88+oSrNdke
 U7tdLwV/ani7FLUI1dadezbvGlx64EOO8Pa7FO5ZrjmS+IHVMBTVlPLxNd5ljHdJ
 e9Ei+lsgH6nGnAWuL7b1HI6VUS1dExahqZtA6NGG2DxmYqcKQDH49bDUNmSuFcFj
 ViQAeU11+ZpEm3IgvvQl3ZYuSTuQwzfH7xc73v5nWp9m7YNPVyqPerxqOgHxxzeG
 +v9wSi+9Tt4SoEMzyABr4s8WwRUY7YWXPtF077/E4Jk24xNpJaDoP/A1bQ0JORee
 gVlKOYJA+Smy5sQmLss5h5iQ9zun97Ad+WwTA2QdCLeKA7p6x+NCtUUk+7aH4lVv
 doood1Xx2Seic9LDOy9G8h2TN8gMG870gcbPUfEgxfEnLwSHLOnW7w+X5xLSoFjr
 u/8eIeLuPQLMeNf11ocj
 =BLF9
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150925.0' into staging

VFIO updates 2015-09-25

 - Remove use of g_malloc0_n for glib2.22 compat

# gpg: Signature made Fri 25 Sep 2015 17:58:04 BST using RSA key ID 3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
# gpg:                 aka "Alex Williamson <alex@shazbot.org>"
# gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
# gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"

* remotes/awilliam/tags/vfio-update-20150925.0:
  vfio/pci: Remove use of g_malloc0_n() from quirks

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2015-09-25 21:11:12 +01:00
commit 8bfbbb4bcb

View File

@ -284,7 +284,7 @@ static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice *vdev)
}
quirk = g_malloc0(sizeof(*quirk));
quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 1);
quirk->mem = g_malloc0(sizeof(MemoryRegion));
quirk->nr_mem = 1;
memory_region_init_io(quirk->mem, OBJECT(vdev), &vfio_ati_3c3_quirk, vdev,
@ -319,7 +319,7 @@ static void vfio_probe_ati_bar4_quirk(VFIOPCIDevice *vdev, int nr)
}
quirk = g_malloc0(sizeof(*quirk));
quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 2);
quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);
quirk->nr_mem = 2;
window = quirk->data = g_malloc0(sizeof(*window) +
sizeof(VFIOConfigWindowMatch));
@ -368,7 +368,7 @@ static void vfio_probe_ati_bar2_quirk(VFIOPCIDevice *vdev, int nr)
quirk = g_malloc0(sizeof(*quirk));
mirror = quirk->data = g_malloc0(sizeof(*mirror));
mirror->mem = quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 1);
mirror->mem = quirk->mem = g_malloc0(sizeof(MemoryRegion));
quirk->nr_mem = 1;
mirror->vdev = vdev;
mirror->offset = 0x4000;
@ -544,7 +544,7 @@ static void vfio_vga_probe_nvidia_3d0_quirk(VFIOPCIDevice *vdev)
quirk = g_malloc0(sizeof(*quirk));
quirk->data = data = g_malloc0(sizeof(*data));
quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 2);
quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);
quirk->nr_mem = 2;
data->vdev = vdev;
@ -661,7 +661,7 @@ static void vfio_probe_nvidia_bar5_quirk(VFIOPCIDevice *vdev, int nr)
}
quirk = g_malloc0(sizeof(*quirk));
quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 4);
quirk->mem = g_malloc0(sizeof(MemoryRegion) * 4);
quirk->nr_mem = 4;
bar5 = quirk->data = g_malloc0(sizeof(*bar5) +
(sizeof(VFIOConfigWindowMatch) * 2));
@ -756,7 +756,7 @@ static void vfio_probe_nvidia_bar0_quirk(VFIOPCIDevice *vdev, int nr)
quirk = g_malloc0(sizeof(*quirk));
mirror = quirk->data = g_malloc0(sizeof(*mirror));
mirror->mem = quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 1);
mirror->mem = quirk->mem = g_malloc0(sizeof(MemoryRegion));
quirk->nr_mem = 1;
mirror->vdev = vdev;
mirror->offset = 0x88000;
@ -775,7 +775,7 @@ static void vfio_probe_nvidia_bar0_quirk(VFIOPCIDevice *vdev, int nr)
if (vdev->has_vga) {
quirk = g_malloc0(sizeof(*quirk));
mirror = quirk->data = g_malloc0(sizeof(*mirror));
mirror->mem = quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 1);
mirror->mem = quirk->mem = g_malloc0(sizeof(MemoryRegion));
quirk->nr_mem = 1;
mirror->vdev = vdev;
mirror->offset = 0x1800;
@ -938,7 +938,7 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
}
quirk = g_malloc0(sizeof(*quirk));
quirk->mem = g_malloc0_n(sizeof(MemoryRegion), 2);
quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);
quirk->nr_mem = 2;
quirk->data = rtl = g_malloc0(sizeof(*rtl));
rtl->vdev = vdev;