Skip to content

Commit 20c1df5

Browse files
committed
Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200713-pull-request' into staging
bugfixes for audio, usb, ui and docs. # gpg: Signature made Mon 13 Jul 2020 15:10:35 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full] # gpg: aka "Gerd Hoffmann <[email protected]>" [full] # gpg: aka "Gerd Hoffmann (private) <[email protected]>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/fixes-20200713-pull-request: usb: fix usb-host build on windows. ui: fix vc_chr_write call in text_console_do_init docs/qdev-device-use: Clean up the sentences related to -usbdevice ossaudio: fix out of bounds write Signed-off-by: Peter Maydell <[email protected]>
2 parents 5c65b1f + 631009e commit 20c1df5

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

audio/ossaudio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ static size_t oss_read(HWVoiceIn *hw, void *buf, size_t len)
691691
len, dst);
692692
break;
693693
}
694+
break;
694695
}
695696

696697
pos += nread;

docs/qdev-device-use.txt

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,7 @@ The -device argument differs in detail for each type of drive:
125125

126126
* if=pflash, if=mtd, if=sd, if=xen are not yet available with -device
127127

128-
For USB devices, the old way is actually different:
129-
130-
-usbdevice disk:format=FMT:FILENAME
131-
132-
Provides much less control than -drive's OPTS... The new way fixes
133-
that:
128+
For USB storage devices, you can use something like:
134129

135130
-device usb-storage,drive=DRIVE-ID,removable=RMB
136131

@@ -177,8 +172,6 @@ The appropriate DEVNAME depends on the machine type. For type "pc":
177172

178173
This lets you control I/O ports and IRQs.
179174

180-
* -usbdevice serial::chardev becomes -device usb-serial,chardev=dev.
181-
182175
* -usbdevice braille doesn't support LEGACY-CHARDEV syntax. It always
183176
uses "braille". With -device, this useful default is gone, so you
184177
have to use something like
@@ -238,10 +231,6 @@ The old way to define the guest part looks like this:
238231

239232
-net nic,netdev=NET-ID,macaddr=MACADDR,model=MODEL,name=ID,addr=STR,vectors=V
240233

241-
Except for USB it looks like this:
242-
243-
-usbdevice net:netdev=NET-ID,macaddr=MACADDR,name=ID
244-
245234
The new way is -device:
246235

247236
-device DEVNAME,netdev=NET-ID,mac=MACADDR,DEV-OPTS...
@@ -336,12 +325,7 @@ The new way is -device DEVNAME,DEV-OPTS... Details depend on DRIVER:
336325
* mouse -device usb-mouse
337326
* tablet -device usb-tablet
338327
* wacom-tablet -device usb-wacom-tablet
339-
* host:... See "Host Device Assignment"
340-
* disk:... See "Block Devices"
341-
* serial:... See "Character Devices"
342328
* braille See "Character Devices"
343-
* net:... See "Network Devices"
344-
* bt:... not yet available with -device
345329

346330
=== Watchdog Devices ===
347331

@@ -358,17 +342,11 @@ and host USB devices. PCI devices can only be assigned with -device:
358342

359343
-device vfio-pci,host=ADDR,id=ID
360344

361-
The old way to assign a host USB device is
362-
363-
-usbdevice host:auto:BUS.ADDR:VID:PRID
364-
365-
where any of BUS, ADDR, VID, PRID can be the wildcard *.
366-
367-
The new way is
345+
To assign a host USB device use:
368346

369347
-device usb-host,hostbus=BUS,hostaddr=ADDR,vendorid=VID,productid=PRID
370348

371-
Omitted options match anything, just like the old way's wildcard.
349+
Omitted options match anything.
372350

373351
=== Default Devices ===
374352

hw/usb/host-libusb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
907907
goto fail;
908908
}
909909
} else {
910-
#if LIBUSB_API_VERSION >= 0x01000107
910+
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
911911
trace_usb_host_open_hostfd(hostfd);
912912

913913
rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
11071107
QTAILQ_INIT(&s->isorings);
11081108
s->hostfd = -1;
11091109

1110-
#if LIBUSB_API_VERSION >= 0x01000107
1110+
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
11111111
if (s->hostdevice) {
11121112
int fd;
11131113
s->needs_autoscan = false;

ui/console.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,12 +2184,12 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
21842184
text_console_resize(s);
21852185

21862186
if (chr->label) {
2187-
char msg[128];
2188-
int len;
2187+
char *msg;
21892188

21902189
s->t_attrib.bgcol = QEMU_COLOR_BLUE;
2191-
len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label);
2192-
vc_chr_write(chr, (uint8_t *)msg, len);
2190+
msg = g_strdup_printf("%s console\r\n", chr->label);
2191+
vc_chr_write(chr, (uint8_t *)msg, strlen(msg));
2192+
g_free(msg);
21932193
s->t_attrib = s->t_attrib_default;
21942194
}
21952195

0 commit comments

Comments
 (0)