From eb19d2b9d15bf68d27704e8727772924681644b8 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 15 Jun 2016 11:46:56 +0200 Subject: usb: make USBDevice->attached bool Signed-off-by: Gerd Hoffmann Reviewed-by: Markus Armbruster Message-id: 1465984019-28963-3-git-send-email-kraxel@redhat.com --- include/hw/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/hw/usb.h b/include/hw/usb.h index 163fe04..8f39470 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -235,7 +235,7 @@ struct USBDevice { uint8_t addr; char product_desc[32]; int auto_attach; - int attached; + bool attached; int32_t state; uint8_t setup_buf[8]; -- cgit v1.1 From 1e351dc373c96a6df4107db3f780a4c89a791afd Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 15 Jun 2016 11:46:57 +0200 Subject: usb: Add QOM property "attached". USB devices in attached state are visible to the guest. This patch adds a QOM property for this. Write access is opt-in per device. Some devices manage attached state automatically (usb-host, usb-serial, usb-redir), so we can't enable write access universally but have to do it on a case by case base. So far, no device opts in. Signed-off-by: Gerd Hoffmann Reviewed-by: Markus Armbruster Message-id: 1465984019-28963-4-git-send-email-kraxel@redhat.com [ minor codestyle fix ] Signed-off-by: Gerd Hoffmann --- include/hw/usb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hw/usb.h b/include/hw/usb.h index 8f39470..847c9de 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -347,6 +347,7 @@ typedef struct USBDeviceClass { const char *product_desc; const USBDesc *usb_desc; + bool attached_settable; } USBDeviceClass; typedef struct USBPortOps { -- cgit v1.1