[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/9] dev-serial: add always-plugged property to ensure USB de
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH 6/9] dev-serial: add always-plugged property to ensure USB device is always attached |
Date: |
Tue, 27 Oct 2020 09:09:38 +0100 |
> case CHR_EVENT_OPENED:
> - if (!s->dev.attached) {
> + if (!s->always_plugged && !s->dev.attached) {
> usb_device_attach(&s->dev, &error_abort);
> }
Not needed (but doesn't hurt either).
> break;
> case CHR_EVENT_CLOSED:
> - if (s->dev.attached) {
> + if (!s->always_plugged && s->dev.attached) {
> usb_device_detach(&s->dev);
> }
Ok.
> - if (qemu_chr_fe_backend_open(&s->cs) && !dev->attached) {
> + if (s->always_plugged || (qemu_chr_fe_backend_open(&s->cs) &&
> + !dev->attached)) {
The dev->attached check should not be skipped, i.e. the logic should be
((always_plugged || open) && !attached).
take care,
Gerd
- Re: [PATCH 3/9] dev-serial: convert from DPRINTF to trace-events, (continued)
- [PATCH 4/9] dev-serial: add trace-events for baud rate and data parameters, Mark Cave-Ayland, 2020/10/26
- [PATCH 5/9] dev-serial: replace DeviceOutVendor/DeviceInVendor with equivalent macros from usb.h, Mark Cave-Ayland, 2020/10/26
- [PATCH 6/9] dev-serial: add always-plugged property to ensure USB device is always attached, Mark Cave-Ayland, 2020/10/26
- [PATCH 7/9] dev-serial: add support for setting data_bits in QEMUSerialSetParams, Mark Cave-Ayland, 2020/10/26
- [PATCH 9/9] dev-serial: store flow control and xon/xoff characters, Mark Cave-Ayland, 2020/10/26
- [PATCH 8/9] dev-serial: fix FTDI_GET_MDM_ST response, Mark Cave-Ayland, 2020/10/26