diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-05 23:01:15 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-05 23:01:15 +0000 |
commit | bb5fc20f7c1c65e95030da3629dd0d7a0cce38cd (patch) | |
tree | 2cb53fa2bf9b5165b338e1cc85c8dedc5bf25879 /hw/usb-msd.c | |
parent | 9dd442b1234a27375c956e650e49a32c61ff6167 (diff) | |
download | qemu-bb5fc20f7c1c65e95030da3629dd0d7a0cce38cd.zip qemu-bb5fc20f7c1c65e95030da3629dd0d7a0cce38cd.tar.gz qemu-bb5fc20f7c1c65e95030da3629dd0d7a0cce38cd.tar.bz2 |
monitor: Rework modal password input (Jan Kiszka)
Currently, waiting for the user to type in some password blocks the
whole VM because monitor_readline starts its own I/O loop. And this loop
also screws up reading passwords from virtual console.
Patch below fixes the shortcomings by using normal I/O processing also
for waiting on a password. To keep to modal property for the monitor
terminal, the command handler is temporarily replaced by a password
handler and a callback infrastructure is established to process the
result before switching back to command mode.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6710 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb-msd.c')
-rw-r--r-- | hw/usb-msd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c index 0c8d9cc..41c92c3 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -514,7 +514,7 @@ static void usb_msd_handle_destroy(USBDevice *dev) qemu_free(s); } -USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs) +USBDevice *usb_msd_init(const char *filename) { MSDState *s; BlockDriverState *bdrv; @@ -554,7 +554,6 @@ USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs) if (bdrv_open2(bdrv, filename, 0, drv) < 0) goto fail; s->bs = bdrv; - *pbs = bdrv; s->dev.speed = USB_SPEED_FULL; s->dev.handle_packet = usb_generic_handle_packet; @@ -574,3 +573,10 @@ USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs) qemu_free(s); return NULL; } + +BlockDriverState *usb_msd_get_bdrv(USBDevice *dev) +{ + MSDState *s = (MSDState *)dev; + + return s->bs; +} |