hw/vfio/pci: fix vfio_pci_hot_reset_result trace point
authorEric Auger <eric.auger@redhat.com>
Mon, 2 May 2022 09:42:21 +0000 (02:42 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 6 May 2022 15:06:50 +0000 (09:06 -0600)
"%m" format specifier is not interpreted by the trace infrastructure
and thus "%m" is output instead of the actual errno string. Fix it by
outputting strerror(errno).

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20220502094223.36384-2-yi.l.liu@intel.com
[aw: replace commit log as provided by Eric]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/pci.c

index ef9d7bf326decd922eadd284c4b92d5e2d469ff5..cb912bd3f4b27cb81d3914fd512eb64861701333 100644 (file)
@@ -2380,7 +2380,7 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single)
     g_free(reset);
 
     trace_vfio_pci_hot_reset_result(vdev->vbasedev.name,
-                                    ret ? "%m" : "Success");
+                                    ret ? strerror(errno) : "Success");
 
 out:
     /* Re-enable INTx on affected devices */