[10/15] libxl_usb: Use proper domid value, from libxl__device
diff mbox series

Message ID 20190614112444.29980-11-anthony.perard@citrix.com
State New, archived
Headers show
Series
  • Some cleanup of libxl
Related show

Commit Message

Anthony PERARD June 14, 2019, 11:24 a.m. UTC
ao->domid isn't a reliable way of getting a domid, it might not be set
(this isn't the case here). The right domid value can be found in the
libxl__device (which is the device we want to remove) attached to
libxl__ao_device.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libxl/libxl_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ian Jackson Sept. 17, 2019, 4:43 p.m. UTC | #1
Anthony PERARD writes ("[PATCH 10/15] libxl_usb: Use proper domid value, from libxl__device"):
> ao->domid isn't a reliable way of getting a domid, it might not be set
> (this isn't the case here). The right domid value can be found in the
> libxl__device (which is the device we want to remove) attached to
> libxl__ao_device.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Patch
diff mbox series

diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c
index adb122ac85..3d389c0198 100644
--- a/tools/libxl/libxl_usb.c
+++ b/tools/libxl/libxl_usb.c
@@ -515,7 +515,7 @@  void libxl__initiate_device_usbctrl_remove(libxl__egc *egc,
     libxl_device_usbdev *usbdevs = NULL;
     int num_usbdev = 0;
     int i, rc;
-    uint32_t domid = ao->domid;
+    uint32_t domid = aodev->dev->domid;
     int usbctrl_devid = aodev->dev->devid;
     libxl_device_usbctrl usbctrl;
     libxl_usbctrlinfo usbctrlinfo;