Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-05 Thread Gerd Hoffmann
On Thu, Feb 04, 2021 at 04:51:39PM +0100, Thomas Huth wrote:
> On 04/02/2021 09.36, Gerd Hoffmann wrote:
> >Hi,
> > 
> > >   enum USBDeviceFlags {
> > > -USB_DEV_FLAG_FULL_PATH,
> > > +USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */
> > 
> > Why not just drop it?  Any remaining users?
> 
> I didn't want to change the values of the other members of the enum ...

This should be purely internal to qemu hw/usb and not some kind of abi,
so changing the values shouldn't break anything ...

take care,
  Gerd



Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-04 Thread Thomas Huth

On 04/02/2021 09.36, Gerd Hoffmann wrote:

   Hi,


  enum USBDeviceFlags {
-USB_DEV_FLAG_FULL_PATH,
+USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */


Why not just drop it?  Any remaining users?


I didn't want to change the values of the other members of the enum ... but 
if you prefer, I can also a "= 1" after the next member of the enum and 
remove the USB_DEV_FLAG_FULL_PATH instead.


 Thomas



Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-04 Thread Gerd Hoffmann
  Hi,

>  enum USBDeviceFlags {
> -USB_DEV_FLAG_FULL_PATH,
> +USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */

Why not just drop it?  Any remaining users?

take care,
  Gerd



[PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-03 Thread Thomas Huth
This property was only required for the pc-1.0 and earlier machine
types. Since these have been removed now, we can delete the property
as well.

Signed-off-by: Thomas Huth 
---
 hw/usb/bus.c | 7 +--
 include/hw/usb.h | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 064f94e9c3..df7411fea8 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -19,8 +19,6 @@ static void usb_qdev_unrealize(DeviceState *qdev);
 static Property usb_props[] = {
 DEFINE_PROP_STRING("port", USBDevice, port_path),
 DEFINE_PROP_STRING("serial", USBDevice, serial),
-DEFINE_PROP_BIT("full-path", USBDevice, flags,
-USB_DEV_FLAG_FULL_PATH, true),
 DEFINE_PROP_BIT("msos-desc", USBDevice, flags,
 USB_DEV_FLAG_MSOS_DESC_ENABLE, true),
 DEFINE_PROP_STRING("pcap", USBDevice, pcap_filename),
@@ -596,11 +594,8 @@ static char *usb_get_dev_path(DeviceState *qdev)
 {
 USBDevice *dev = USB_DEVICE(qdev);
 DeviceState *hcd = qdev->parent_bus->parent;
-char *id = NULL;
+char *id = qdev_get_dev_path(hcd);
 
-if (dev->flags & (1 << USB_DEV_FLAG_FULL_PATH)) {
-id = qdev_get_dev_path(hcd);
-}
 if (id) {
 char *ret = g_strdup_printf("%s/%s", id, dev->port->path);
 g_free(id);
diff --git a/include/hw/usb.h b/include/hw/usb.h
index abfbfc5284..c44b77dae0 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -216,7 +216,7 @@ struct USBEndpoint {
 };
 
 enum USBDeviceFlags {
-USB_DEV_FLAG_FULL_PATH,
+USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */
 USB_DEV_FLAG_IS_HOST,
 USB_DEV_FLAG_MSOS_DESC_ENABLE,
 USB_DEV_FLAG_MSOS_DESC_IN_USE,
-- 
2.27.0