Detect cdrom via ioctl (#473154) re add increased buffer for USB control
requests (#546483)
This commit is contained in:
parent
4382ef67eb
commit
c98f18f73e
61
0050-raw-posix-Detect-CDROM-via-ioctl-on-linux.patch
Normal file
61
0050-raw-posix-Detect-CDROM-via-ioctl-on-linux.patch
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
From 361f29d46ce4a310818e88adaef0912573847295 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Cole Robinson <crobinso@redhat.com>
|
||||||
|
Date: Thu, 14 Jan 2010 16:19:40 +0000
|
||||||
|
Subject: [PATCH] raw-posix: Detect CDROM via ioctl on linux
|
||||||
|
|
||||||
|
Current CDROM detection is hardcoded based on source file name.
|
||||||
|
Make this smarter on linux by attempting a CDROM specific ioctl.
|
||||||
|
|
||||||
|
This makes '-cdrom /dev/sr0' succeed with no media present.
|
||||||
|
|
||||||
|
v2:
|
||||||
|
Give ioctl check higher priority than filename check.
|
||||||
|
|
||||||
|
v3:
|
||||||
|
Actually initialize 'prio' variable.
|
||||||
|
Check for ioctl success rather than absence of specific failure.
|
||||||
|
|
||||||
|
v4:
|
||||||
|
Explicitly mention that change is linux specific.
|
||||||
|
|
||||||
|
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
||||||
|
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
||||||
|
---
|
||||||
|
block/raw-posix.c | 20 ++++++++++++++++++--
|
||||||
|
1 files changed, 18 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/block/raw-posix.c b/block/raw-posix.c
|
||||||
|
index c204cf9..1c777a1 100644
|
||||||
|
--- a/block/raw-posix.c
|
||||||
|
+++ b/block/raw-posix.c
|
||||||
|
@@ -1142,9 +1142,25 @@ static int cdrom_open(BlockDriverState *bs, const char *filename, int flags)
|
||||||
|
|
||||||
|
static int cdrom_probe_device(const char *filename)
|
||||||
|
{
|
||||||
|
+ int fd, ret;
|
||||||
|
+ int prio = 0;
|
||||||
|
+
|
||||||
|
if (strstart(filename, "/dev/cd", NULL))
|
||||||
|
- return 100;
|
||||||
|
- return 0;
|
||||||
|
+ prio = 50;
|
||||||
|
+
|
||||||
|
+ fd = open(filename, O_RDONLY | O_NONBLOCK);
|
||||||
|
+ if (fd < 0) {
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Attempt to detect via a CDROM specific ioctl */
|
||||||
|
+ ret = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
|
||||||
|
+ if (ret >= 0)
|
||||||
|
+ prio = 100;
|
||||||
|
+
|
||||||
|
+ close(fd);
|
||||||
|
+out:
|
||||||
|
+ return prio;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cdrom_is_inserted(BlockDriverState *bs)
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
From afba60f63354fc6376e30dd51cadeda7170bcf4b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Krause <chkr@plauener.de>
|
||||||
|
Date: Sun, 24 Jan 2010 16:34:52 +0000
|
||||||
|
Subject: [PATCH] usb-linux: increase buffer for USB control requests
|
||||||
|
|
||||||
|
The WLAN USB stick ZyXEL NWD271N (0586:3417) uses very large
|
||||||
|
usb control transfers of more than 2048 bytes which won't fit
|
||||||
|
into the buffer of the ctrl_struct. This results in an error message
|
||||||
|
"husb: ctrl buffer too small" and a non-working device.
|
||||||
|
Increasing the buffer size to 8192 seems to be a safe choice.
|
||||||
|
|
||||||
|
Signed-off-by: Christian Krause <chkr@plauener.de>
|
||||||
|
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
|
||||||
|
---
|
||||||
|
usb-linux.c | 2 +-
|
||||||
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/usb-linux.c b/usb-linux.c
|
||||||
|
index 5619b30..e6cd432 100644
|
||||||
|
--- a/usb-linux.c
|
||||||
|
+++ b/usb-linux.c
|
||||||
|
@@ -113,7 +113,7 @@ struct ctrl_struct {
|
||||||
|
uint16_t offset;
|
||||||
|
uint8_t state;
|
||||||
|
struct usb_ctrlrequest req;
|
||||||
|
- uint8_t buffer[2048];
|
||||||
|
+ uint8_t buffer[8192];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct USBAutoFilter {
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
10
qemu.spec
10
qemu.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: QEMU is a FAST! processor emulator
|
Summary: QEMU is a FAST! processor emulator
|
||||||
Name: qemu
|
Name: qemu
|
||||||
Version: 0.12.3
|
Version: 0.12.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
# Epoch because we pushed a qemu-1.0 package
|
# Epoch because we pushed a qemu-1.0 package
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
License: GPLv2+ and LGPLv2+ and BSD
|
License: GPLv2+ and LGPLv2+ and BSD
|
||||||
@ -83,6 +83,8 @@ Patch46: 0046-pc-Add-backward-compatibility-options-for-virtio-ser.patch
|
|||||||
Patch47: 0047-virtio-serial-don-t-set-MULTIPORT-for-1-port-dev.patch
|
Patch47: 0047-virtio-serial-don-t-set-MULTIPORT-for-1-port-dev.patch
|
||||||
Patch48: 0048-virtio-serial-pci-Allow-MSI-to-be-disabled.patch
|
Patch48: 0048-virtio-serial-pci-Allow-MSI-to-be-disabled.patch
|
||||||
Patch49: 0049-migration-Clear-fd-also-in-error-cases.patch
|
Patch49: 0049-migration-Clear-fd-also-in-error-cases.patch
|
||||||
|
Patch50: 0050-raw-posix-Detect-CDROM-via-ioctl-on-linux.patch
|
||||||
|
Patch51: 0051-usb-linux-increase-buffer-for-USB-control-requests.patch
|
||||||
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
@ -324,6 +326,8 @@ such as kvmtrace and kvm_stat.
|
|||||||
%patch47 -p1
|
%patch47 -p1
|
||||||
%patch48 -p1
|
%patch48 -p1
|
||||||
%patch49 -p1
|
%patch49 -p1
|
||||||
|
%patch50 -p1
|
||||||
|
%patch51 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# By default we build everything, but allow x86 to build a minimal version
|
# By default we build everything, but allow x86 to build a minimal version
|
||||||
@ -626,6 +630,10 @@ fi
|
|||||||
%{_mandir}/man1/qemu-img.1*
|
%{_mandir}/man1/qemu-img.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 11 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-4
|
||||||
|
- Detect cdrom via ioctl (#473154)
|
||||||
|
- re add increased buffer for USB control requests (#546483)
|
||||||
|
|
||||||
* Wed Mar 10 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-3
|
* Wed Mar 10 2010 Justin M. Forbes <jforbes@redhat.com> - 2:0.12.3-3
|
||||||
- Migration clear the fd in error cases (#518032)
|
- Migration clear the fd in error cases (#518032)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user