]> git.proxmox.com Git - qemu.git/log
qemu.git
13 years agousb-linux: Don't try to open the same device twice
Hans de Goede [Tue, 31 May 2011 09:35:24 +0000 (11:35 +0200)]
usb-linux: Don't try to open the same device twice

If a user wants to redirect 2 identical usb sticks, in theory this is
possible by doing:
usb_add host:1234:5678
usb_add host:1234:5678

But this will lead to us trying to open the first stick twice, since we
don't break the loop after having found a match in our filter list, so the next'
filter list entry will result in us trying to open the same device again.

Fix this by adding the missing break.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-linux: Ensure devep != 0
Hans de Goede [Tue, 31 May 2011 09:35:22 +0000 (11:35 +0200)]
usb-linux: Ensure devep != 0

So that we don't index endp_table with a negative index.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-linux: Don't do perror when errno is not set
Hans de Goede [Tue, 31 May 2011 09:35:20 +0000 (11:35 +0200)]
usb-linux: Don't do perror when errno is not set

Note that "op" also is not set, so before this change these error paths
would feed NULL to perror.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-linux: Teach about super speed
Hans de Goede [Tue, 31 May 2011 09:35:19 +0000 (11:35 +0200)]
usb-linux: Teach about super speed

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-linux: Get speed from sysfs rather then from the connectinfo ioctl
Hans de Goede [Tue, 31 May 2011 09:35:18 +0000 (11:35 +0200)]
usb-linux: Get speed from sysfs rather then from the connectinfo ioctl

The connectinfo ioctl only differentiates between lo speed devices, and
all other speeds, where as we would like to know the real speed. The real
speed is available in sysfs so use that when available.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb: documentation update
Gerd Hoffmann [Tue, 31 May 2011 10:21:43 +0000 (12:21 +0200)]
usb: documentation update

Add some more informations to docs/usb2.txt about using usb2 (also usb1)
devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: split trace calls to handle arg count limits
Gerd Hoffmann [Mon, 6 Jun 2011 10:31:34 +0000 (12:31 +0200)]
usb-ehci: split trace calls to handle arg count limits

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: itd handling fixes.
Gerd Hoffmann [Mon, 30 May 2011 14:09:08 +0000 (16:09 +0200)]
usb-ehci: itd handling fixes.

This patch fixes a bunch of issues in the itd descriptor handling.
Most important fix is to handle transfers which cross page borders
correctly by looking up the address of the next page.  Luckily the
linux uses physically contigous memory so the data used to hits the
correct location even with this bug instead of corrupting guest
memory.  Also the transfer length updates for outgoing transfers wasn't
correct.

While being at it DPRINTFs have been replaced by tracepoints.

The isoch_pause logic has been disabled.  Not clear to me which propose
this serves and I think it is incorrect too as we just skip processing
itds.  Even when no xfer happens we have to clear the active bit.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoThe USB tablet should not claim boot protocol support.
Kevin O'Connor [Sat, 28 May 2011 15:47:50 +0000 (11:47 -0400)]
The USB tablet should not claim boot protocol support.

The USB tablet advertises that it supports the "boot" protocol.
However, its reports aren't "boot" protocol compatible.  So, it
shouldn't claim that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoFix USB mouse Set_Protocol behavior
Kevin O'Connor [Sat, 28 May 2011 15:47:15 +0000 (11:47 -0400)]
Fix USB mouse Set_Protocol behavior

The QEMU USB mouse claims to support the "boot" protocol
(bInterfaceSubClass is 1).  However, the mouse rejects the
Set_Protocol command.

The qemu mouse does support the "boot" protocol specification, so a
simple fix is to enable the Set_Protocol request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: drop EXECUTING checks.
Gerd Hoffmann [Fri, 20 May 2011 20:08:44 +0000 (22:08 +0200)]
usb-ehci: drop EXECUTING checks.

The state machine doesn't stop in EXECUTING state any more when async
packets are in flight, so the checks are not needed any more and can
be dropped.

Also kick out the check for the frame timer.  As we don't stop & sleep
any more on async packets this is obsolete.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb: cancel async packets on unplug
Gerd Hoffmann [Mon, 23 May 2011 15:37:12 +0000 (17:37 +0200)]
usb: cancel async packets on unplug

This patch adds USBBusOps struct with (for now) only a single callback
which is called when a device is about to be destroyed.  The USB Host
adapters are implementing this callback and use it to cancel any async
requests which might be in flight before the device actually goes away.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)
Hans de Goede [Mon, 23 May 2011 12:49:43 +0000 (14:49 +0200)]
ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: fix error handling.
Gerd Hoffmann [Mon, 23 May 2011 07:50:27 +0000 (09:50 +0200)]
usb-ehci: fix error handling.

Set the correct bits for nodev, stall and babble errors.
Raise errint irq.  Fix state transition from WRITEBACK
to the next state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: fix offset writeback in ehci_buffer_rw
Gerd Hoffmann [Fri, 20 May 2011 15:25:07 +0000 (17:25 +0200)]
usb-ehci: fix offset writeback in ehci_buffer_rw

Two bugs at once:

First the mask is backwards, so the it used to keeps the offset and
clears the page address, which is not what we need when we update the
offset.

Second the offset calculation is wrong in case head isn't page aligned.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: multiqueue support
Gerd Hoffmann [Thu, 19 May 2011 15:56:19 +0000 (17:56 +0200)]
usb-ehci: multiqueue support

This patch adds support for keeping multiple queues going at the same
time.  One slow device will not affect other devices any more.

The patch adds code to manage EHCIQueue structs.  It also does a number
of changes to the state machine:

 * The state machine will never ever stop in EXECUTING any more.
   Instead it will continue with the next queue (aka HORIZONTALQH) when
   the usb device returns USB_RET_ASYNC.
 * The state machine will stop processing when it figures it walks in
   circles (easy to figure now that we have a EHCIQueue struct for each
   QH we've processed).  The bailout logic should not be needed any
   more.  For now it is still in, but will assert() in case it triggers.
 * The state machine will just skip queues with a async USBPacket in
   flight.
 * The state machine will resume processing as soon as the async
   USBPacket is finished.

The patch also takes care to flush the QH struct back to guest memory
when needed, so we don't get stale data when (re-)loading it from guest
memory in FETCHQH state.

It also makes the writeback code to not touch the first three dwords of
the QH struct as the EHCI must not write them.  This actually fixes a
bug where QH chaining changes (next ptr) by the linux ehci driver where
overwritten by the emulated EHCI.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: add queue data struct
Gerd Hoffmann [Thu, 19 May 2011 08:49:03 +0000 (10:49 +0200)]
usb-ehci: add queue data struct

Add EHCIQueue struct, move the fields needed to track the queue state
into that struct.  Pass the new struct instead of ehci state down to
functions which handle the queue state.  Lot of variable references have
changed due to that without an actual functional change.

Replace fetch_addr with two variables, one for async and one for
periodic schedule.  Add functions to get and set the fetch address.

Use EHCIQueue->usb_status (old name: EHCIState->exec_status) directly in
ehci_execute_complete instead of passing around the status using a
parameters and the return value.

ehci_state_fetchqh returns a EHCIQueue struct now.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: trace buffer copy
Gerd Hoffmann [Thu, 19 May 2011 07:24:00 +0000 (09:24 +0200)]
usb-ehci: trace buffer copy

Add a trace point for buffer copies and drop the DPRINTF's.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: improve mmio tracing
Gerd Hoffmann [Thu, 19 May 2011 06:55:09 +0000 (08:55 +0200)]
usb-ehci: improve mmio tracing

Add a separate tracepoint to log how register values change in response
to a mmio write.  Especially useful for registers which have read-only
or clear-on-write bits in them.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: trace port state
Gerd Hoffmann [Thu, 19 May 2011 06:46:53 +0000 (08:46 +0200)]
usb-ehci: trace port state

Trace usb port operations (attach, detach, reset),
drop a few obsolete DPRINTF's.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: trace state machine changes
Gerd Hoffmann [Wed, 18 May 2011 12:23:35 +0000 (14:23 +0200)]
usb-ehci: trace state machine changes

Add functions to get and set the current state of the state machine,
add tracepoints there to trace state transitions.  Add support for
traceing the queue heads and transfer descriptors as we look at them.

Drop a few DPRINTFs and all DPRINTF_ST lines, they are obsolete now.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-ehci: trace mmio and usbsts
Gerd Hoffmann [Wed, 18 May 2011 08:12:58 +0000 (10:12 +0200)]
usb-ehci: trace mmio and usbsts

This patch starts adding trace support to ehci.  It traces
updates of the status register (USBSTS), mmio access and
controller reset.

It also adds functions to set and clear status register bits
and puts them in use everywhere.

Some DPRINTF's are dropped in favor of the new tracepoints.

No change in behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-linux: catch ENODEV in more places.
Gerd Hoffmann [Tue, 24 May 2011 14:12:31 +0000 (16:12 +0200)]
usb-linux: catch ENODEV in more places.

Factor out disconnect code (called when a device disappears) to a
separate function.  Add a check for ENODEV errno to a few more places
to make sure we notice disconnects.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoblock/rbd: Remove unused local variable
Stefan Weil [Fri, 10 Jun 2011 20:05:30 +0000 (22:05 +0200)]
block/rbd: Remove unused local variable

Variable 'snap' is assigned a value that is never used.
Remove snap and the related code.

Cc: Christian Brunner <chb@muc.de>
Cc: Josh Durgin <josh.durgin@dreamhost.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoDarwin: Fix compilation warning regarding the deprecated daemon() function
Alexandre Raymond [Tue, 7 Jun 2011 03:34:10 +0000 (23:34 -0400)]
Darwin: Fix compilation warning regarding the deprecated daemon() function

Changes since v1: create a wrapper function named qemu_daemon() in oslib-posix.c
instead of putting the OS specific workaround in qemu-nbd.c directly.

On OSX >= 10.5, daemon() is deprecated, resulting in the following warning:
----8<----
qemu-nbd.c: In function ‘main’:
qemu-nbd.c:371: warning: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:289)
----8<----

The following trick, used in mDNSResponder, takes care of this warning:
http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-258.18/mDNSPosix/PosixDaemon.c

On OSX, it temporarily renames the daemon() function before including stdlib.h
and declares it manually as an extern function. This way, the compiler does not
see the declaration from stdlib.h and thus does not display the warning.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agococoa: Avoid warning related to multiple handleEvent: definitions
Andreas Färber [Thu, 9 Jun 2011 18:53:32 +0000 (20:53 +0200)]
cocoa: Avoid warning related to multiple handleEvent: definitions

Avoid compiler confusion as to which method signature to use for the
handleEvent: selector on OSX >= 10.6 by making the variable type-safe
as opposed to generic 'id' type.
Requires moving the variable definition to after the class definition.

----8<----
ui/cocoa.m: In function ‘cocoa_refresh’:
ui/cocoa.m:997: warning: multiple methods named ‘-handleEvent:’ found
/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputContext.h:84: warning: using ‘-(BOOL)handleEvent:(NSEvent *)theEvent’
ui/cocoa.m:272: warning: also found ‘-(void)handleEvent:(NSEvent *)event’
----8<---

Reported-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Alexandre Raymond <cerbere@gmail.com>
13 years agococoa: Revert dependency on VNC
Andreas Färber [Thu, 2 Jun 2011 18:51:22 +0000 (20:51 +0200)]
cocoa: Revert dependency on VNC

In 821601ea5b02a68ada479731a4d3d07a9876632a (Make VNC support optional)
cocoa.o was moved from ui-obj-$(CONFIG_COCOA) to vnc-obj-$(CONFIG_COCOA),
adding a dependency on $(CONFIG_VNC). That must've been unintentional.

Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agococoa: Provide central qemu_main() prototype
Andreas Färber [Sun, 29 May 2011 17:42:51 +0000 (19:42 +0200)]
cocoa: Provide central qemu_main() prototype

This fixes a missing prototype warning in vl.c and obsoletes
the prototype in cocoa.m. Adjust callers in cocoa.m to supply
third argument, which is currently only used on Linux/ppc.

The prototype is designed so that it could be shared with SDL
and other frontends, if desired.

Cc: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agoFix libfdt warnings on Darwin
Andreas Färber [Sat, 28 May 2011 13:45:18 +0000 (15:45 +0200)]
Fix libfdt warnings on Darwin

Building with libfdt results in the following warnings on Mac OS X:

  CC    ppc-softmmu/device_tree.o
In file included from /Users/andreas/QEMU/latest64/include/libfdt.h:54,
                 from /Users/andreas/QEMU/qemu/device_tree.c:26:
/Users/andreas/QEMU/qemu/libfdt_env.h:25:20: warning: endian.h: No such file or directory
/Users/andreas/QEMU/qemu/libfdt_env.h:26:22: warning: byteswap.h: No such file or directory
/Users/andreas/QEMU/qemu/libfdt_env.h:28:5: warning: "__BYTE_ORDER" is not defined
/Users/andreas/QEMU/qemu/libfdt_env.h:28:21: warning: "__BIG_ENDIAN" is not defined

Since QEMU's copy of libfdt_env.h only uses bswap_32() and bswap_64(),
let QEMU's bswap.h take care of the headers and use its endianness define.

Cc: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>
13 years agoconfigure: Fix check for fdatasync()
Alexandre Raymond [Sun, 29 May 2011 22:22:48 +0000 (18:22 -0400)]
configure: Fix check for fdatasync()

Under Darwin, a symbol exists for the fdatasync() function, so that our
link test succeeds. However _POSIX_SYNCHRONIZED_IO is set to '-1'.

According to POSIX:2008, a value of -1 means the feature is not supported.
A value of 0 means supported at compilation time, and a value greater 0
means supported at both compilation and run time.

Enable fdatasync() only if _POSIX_SYNCHRONIZED_IO is '>0'.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agoRemove warning in printf due to type mismatch
Alexandre Raymond [Sun, 29 May 2011 22:22:50 +0000 (18:22 -0400)]
Remove warning in printf due to type mismatch

----8<----
qemu/target-lm32/translate.c: In function ‘gen_intermediate_code_internal’:
qemu/target-lm32/translate.c:1135: warning: format ‘%zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’
----8<----

Both gen_opc_ptr and gen_opc_buf are "uint16_t *". The difference between
pointers is a ptrdiff_t so printf needs '%td'.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agoCocoa: avoid displaying window when command-line contains '-h' or '-help'
Alexandre Raymond [Sun, 29 May 2011 22:22:49 +0000 (18:22 -0400)]
Cocoa: avoid displaying window when command-line contains '-h' or '-help'

There was already a check in place to avoid displaying a window
in certain modes such as vnc, nographic or curses.

Add a check for '-h' and '-help' to avoid displaying a window for a split-
second before showing the usage information.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agoFix compilation warning due to incorrectly specified type
Alexandre Raymond [Fri, 27 May 2011 17:22:28 +0000 (13:22 -0400)]
Fix compilation warning due to incorrectly specified type

In audio/coreaudio.c, a variable named "str" was assigned "const char" values,
which resulted in the following warnings:

-----8<-----
audio/coreaudio.c: In function ‘coreaudio_logstatus’:
audio/coreaudio.c:59: warning: initialization discards qualifiers from pointer target type
audio/coreaudio.c:63: warning: assignment discards qualifiers from pointer target type
(...)
-----8<-----

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agococoa: do not create a spurious window for -version
Tristan Gingold [Tue, 15 Mar 2011 13:18:22 +0000 (14:18 +0100)]
cocoa: do not create a spurious window for -version

When invoked with -version, qemu will exit just after displaying the version,
so there is no need to create a window.
Also handles --XXX options.

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
13 years agoconfigure: Detect and don't try to use older libcurl
Peter Maydell [Thu, 9 Jun 2011 21:54:29 +0000 (22:54 +0100)]
configure: Detect and don't try to use older libcurl

Older versions of libcurl don't have some of the features we try to
use, in particular curl_multi_setopt(). Check for this in the 'is
libcurl available?' configure test so we disable curl support if the
library is too old.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoChangelog: Add explanatory note that this file is no longer updated
Peter Maydell [Thu, 9 Jun 2011 10:43:12 +0000 (11:43 +0100)]
Changelog: Add explanatory note that this file is no longer updated

Add an explanatory note to the top of Changelog pointing at the
wiki and git history for changelogs for more recent releases.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agovirtio: event index support
Michael S. Tsirkin [Sun, 12 Jun 2011 13:21:57 +0000 (16:21 +0300)]
virtio: event index support

Add support for event_idx feature, and utilize it to
reduce the number of interrupts and exits for the guest.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomsix: Use replace local defines with pci_regs versions
Jan Kiszka [Thu, 9 Jun 2011 07:39:56 +0000 (09:39 +0200)]
msix: Use replace local defines with pci_regs versions

This also cleans up an open-coded 64-bit message address readout.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: Update pci_regs header
Jan Kiszka [Thu, 9 Jun 2011 07:18:30 +0000 (09:18 +0200)]
pci: Update pci_regs header

Pulls in latest version from kernel 3.0-rc2.

Some changes around AER now require local defines as QEMU accesses the
error source identification register via sub-words.

CC: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomsi: Fix copy&paste mistake in msi_uninit
Jan Kiszka [Tue, 7 Jun 2011 17:26:20 +0000 (19:26 +0200)]
msi: Fix copy&paste mistake in msi_uninit

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio: correctly initialize vm_running
Jason Wang [Wed, 18 May 2011 05:57:37 +0000 (13:57 +0800)]
virtio: correctly initialize vm_running

Current vm_running was not explicitly initialized and its value was changed by
vm state notifier, this may confuse the virtio device being hotplugged such as
virtio-net with vhost backend as it may think the vm was not running. Solve this
by initialize this value explicitly in virtio_common_init().

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio: guard against negative vq notifies
Stefan Hajnoczi [Sun, 8 May 2011 21:29:07 +0000 (22:29 +0100)]
virtio: guard against negative vq notifies

The virtio_queue_notify() function checks that the virtqueue number is
less than the maximum number of virtqueues.  A signed comparison is used
but the virtqueue number could be negative if a buggy or malicious guest
is run.  This results in memory accesses outside of the virtqueue array.

It is risky doing input validation in common code instead of at the
guest<->host boundary.  Note that virtio_queue_set_addr(),
virtio_queue_get_addr(), virtio_queue_get_num(), and many other virtio
functions do *not* validate the virtqueue number argument.

Instead of fixing the comparison in virtio_queue_notify(), move the
comparison to the virtio bindings (just like VIRTIO_PCI_QUEUE_SEL) where
we have a uint32_t value and can avoid ever calling into common virtio
code if the virtqueue number is invalid.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio-pci.c: convert to PCIDEviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:36 +0000 (10:58 +0900)]
virtio-pci.c: convert to PCIDEviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/xio3130_upstream.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:35 +0000 (10:58 +0900)]
hw/xio3130_upstream.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/xio3130_downstream.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:34 +0000 (10:58 +0900)]
hw/xio3130_downstream.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/wdt_i6300esb.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:33 +0000 (10:58 +0900)]
hw/wdt_i6300esb.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/vt82c686.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:32 +0000 (10:58 +0900)]
hw/vt82c686.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/vga-pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:31 +0000 (10:58 +0900)]
hw/vga-pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/versatile_pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:30 +0000 (10:58 +0900)]
hw/versatile_pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/usb-ohci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:29 +0000 (10:58 +0900)]
hw/usb-ohci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/unin_pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:28 +0000 (10:58 +0900)]
hw/unin_pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/sun4u.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:27 +0000 (10:58 +0900)]
hw/sun4u.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/sh_pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:26 +0000 (10:58 +0900)]
hw/sh_pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/rtl8139.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:25 +0000 (10:58 +0900)]
hw/rtl8139.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/qxl.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:24 +0000 (10:58 +0900)]
hw/qxl.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/piix_pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:23 +0000 (10:58 +0900)]
hw/piix_pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/piix4.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:22 +0000 (10:58 +0900)]
hw/piix4.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/pcnet-pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:21 +0000 (10:58 +0900)]
hw/pcnet-pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ne2000.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:20 +0000 (10:58 +0900)]
hw/ne2000.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/lsi53c895a.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:19 +0000 (10:58 +0900)]
hw/lsi53c895a.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ivshmem.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:18 +0000 (10:58 +0900)]
hw/ivshmem.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ioh3420.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:17 +0000 (10:58 +0900)]
hw/ioh3420.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/intel-hda.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:16 +0000 (10:58 +0900)]
hw/intel-hda.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ide/via.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:15 +0000 (10:58 +0900)]
hw/ide/via.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ide/ich.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:14 +0000 (10:58 +0900)]
hw/ide/ich.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ide/cmd646.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:13 +0000 (10:58 +0900)]
hw/ide/cmd646.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/gt64xxx.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:12 +0000 (10:58 +0900)]
hw/gt64xxx.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/grackle_pci.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:11 +0000 (10:58 +0900)]
hw/grackle_pci.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/es1370.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:10 +0000 (10:58 +0900)]
hw/es1370.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/e1000.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:09 +0000 (10:58 +0900)]
hw/e1000.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/cirrus_vga.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:08 +0000 (10:58 +0900)]
hw/cirrus_vga.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/bonito.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:07 +0000 (10:58 +0900)]
hw/bonito.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/acpi_piix4.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:06 +0000 (10:58 +0900)]
hw/acpi_piix4.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agohw/ac97.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:05 +0000 (10:58 +0900)]
hw/ac97.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovmware_vga.c: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:04 +0000 (10:58 +0900)]
vmware_vga.c: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoide/piix: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:03 +0000 (10:58 +0900)]
ide/piix: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoapb_pci: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:02 +0000 (10:58 +0900)]
apb_pci: convert to PCIDeviceInfo to initialize ids

Use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agodec_pci: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:01 +0000 (10:58 +0900)]
dec_pci: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoeepro100: convert to PCIDeviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:58:00 +0000 (10:58 +0900)]
eepro100: convert to PCIDeviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agousb-uhci: convert to PCIDEviceInfo to initialize ids
Isaku Yamahata [Wed, 25 May 2011 01:57:59 +0000 (10:57 +0900)]
usb-uhci: convert to PCIDEviceInfo to initialize ids

use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: move ids of config space into PCIDeviceInfo
Isaku Yamahata [Wed, 25 May 2011 01:57:58 +0000 (10:57 +0900)]
pci: move ids of config space into PCIDeviceInfo

vender id/device id... in configuration space are read-only registers
which are commonly defined for all pci devices.
So move those initialization into common place.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoCPUPhysMemoryClient: batch addresses in catchup
Alex Williamson [Tue, 3 May 2011 18:36:58 +0000 (12:36 -0600)]
CPUPhysMemoryClient: batch addresses in catchup

When a phys memory client registers and we play catchup by walking
the page tables, we can make a huge improvement in the number of
times the set_memory callback is called by batching contiguous
pages together.  With a 4G guest, this reduces the number of callbacks
at registration from 1048866 to 296.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agodoc: Minor typo fix.
Brad Hards [Wed, 8 Jun 2011 21:50:43 +0000 (07:50 +1000)]
doc: Minor typo fix.

Thanks to agraf_, stefanha and Snader_LB for their IRC assistance.

Thanks to Markus Armbruster and Alexander Graf (again) for their
assistance with the second version of this patch. No patch is too
simple to test...

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agosigfd: use pthread_sigmask
Alexander Graf [Wed, 8 Jun 2011 22:55:37 +0000 (00:55 +0200)]
sigfd: use pthread_sigmask

Qemu uses signalfd to figure out, if a signal occured without the need
to actually receive the signal. Instead, it can read from the fd to receive
its news.

Now, we obviously don't always have signalfd around. Especially not on
non-Linux systems. So what we do there is that we create a new thread,
block that thread on all signals and simply call sigwait to wait for a
signal we're interested in to occur.

This all sounds great, but what we're really doing is:

    sigset_t all;

    sigfillset(&all);
    sigprocmask(SIG_BLOCK, &all, NULL);

which - on Darwin - blocks all signals on the current _process_, not only
on the current thread. To block signals on the thread, we can use
pthread_sigmask().

This patch does that, assuming that my above analysis is correct, and thus
renders Qemu useable on Darwin again.

Reported-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Paolo Bonizni <pbonzini@redhat.com>
CC: Jan Kiszka <jan.kiszka@siemens.com>
CC: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoMerge remote branch 'rth/axp-next' into alpha-merge
Edgar E. Iglesias [Fri, 10 Jun 2011 20:21:14 +0000 (22:21 +0200)]
Merge remote branch 'rth/axp-next' into alpha-merge

* rth/axp-next: (26 commits)
  target-alpha: Implement TLB flush primitives.
  target-alpha: Use a fixed frequency for the RPCC in system mode.
  target-alpha: Trap for unassigned and unaligned addresses.
  target-alpha: Remap PIO space for 43-bit KSEG for EV6.
  target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode.
  target-alpha: Implement more CALL_PAL values inline.
  target-alpha: Disable interrupts properly.
  target-alpha: All ISA checks to use TB->FLAGS.
  target-alpha: Swap shadow registers moving to/from PALmode.
  target-alpha: Implement do_interrupt for system mode.
  target-alpha: Add IPRs to be used by the emulation PALcode.
  target-alpha: Use kernel mmu_idx for pal_mode.
  target-alpha: Add various symbolic constants.
  target-alpha: Use do_restore_state for arithmetic exceptions.
  target-alpha: Tidy up arithmetic exceptions.
  target-alpha: Tidy exception constants.
  target-alpha: Enable the alpha-softmmu target.
  target-alpha: Rationalize internal processor registers.
  target-alpha: Merge HW_REI and HW_RET implementations.
  target-alpha: Cleanup MMU modes.
  ...

13 years agofsdev: Fix archs that dont use fsdev
Edgar E. Iglesias [Fri, 10 Jun 2011 13:29:11 +0000 (15:29 +0200)]
fsdev: Fix archs that dont use fsdev

Fix provided by: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoMerge remote-tracking branch 'qmp/for-anthony' into staging
Anthony Liguori [Wed, 8 Jun 2011 17:16:24 +0000 (12:16 -0500)]
Merge remote-tracking branch 'qmp/for-anthony' into staging

13 years agoMerge remote-tracking branch 'jvrao/for-anthony' into staging
Anthony Liguori [Wed, 8 Jun 2011 17:15:43 +0000 (12:15 -0500)]
Merge remote-tracking branch 'jvrao/for-anthony' into staging

13 years agoMerge remote-tracking branch 'spice/spice.v37' into staging
Anthony Liguori [Wed, 8 Jun 2011 17:15:11 +0000 (12:15 -0500)]
Merge remote-tracking branch 'spice/spice.v37' into staging

Conflicts:
vl.c

13 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Wed, 8 Jun 2011 17:13:58 +0000 (12:13 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

13 years agoqemu-img create: Fix displayed default cluster size
Kevin Wolf [Tue, 31 May 2011 13:01:46 +0000 (15:01 +0200)]
qemu-img create: Fix displayed default cluster size

When not specifying a cluster size on the command line, qemu-img printed
a cluster size of 0:

    Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864
    encryption=off cluster_size=0

This patch adds the default cluster size to the QEMUOptionParameter list, so
that it displays the default value that is used.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agobdrv_img_create: Fix segfault
Kevin Wolf [Wed, 1 Jun 2011 12:03:31 +0000 (14:03 +0200)]
bdrv_img_create: Fix segfault

Block drivers that don't support creating images don't have a size option. Fail
gracefully instead of segfaulting when trying to access the option's value.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoqcow2: Fix memory leaks in error cases
Kevin Wolf [Wed, 1 Jun 2011 08:50:00 +0000 (10:50 +0200)]
qcow2: Fix memory leaks in error cases

This fixes memory leaks that may be caused by I/O errors during L1 table growth
(can happen during save_vm) and in qemu-img check.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agorbd: Add bdrv_truncate implementation
Josh Durgin [Thu, 26 May 2011 23:07:34 +0000 (16:07 -0700)]
rbd: Add bdrv_truncate implementation

Reviewed-by: Christian Brunner <chb@muc.de>
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agorbd: check return values when scheduling aio
Josh Durgin [Thu, 26 May 2011 23:07:33 +0000 (16:07 -0700)]
rbd: check return values when scheduling aio

If scheduling fails, the number of outstanding I/Os must be correct,
or there will be a hang when waiting for everything to be flushed.

Reviewed-by: Christian Brunner <chb@muc.de>
Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agorbd: allow configuration of rados from the rbd filename
Josh Durgin [Thu, 26 May 2011 23:07:32 +0000 (16:07 -0700)]
rbd: allow configuration of rados from the rbd filename

The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]]
Each option is used to configure rados, and may be any Ceph option, or "conf".
The "conf" option specifies a Ceph configuration file to read.

This allows rbd volumes from more than one Ceph cluster to be used by
specifying different monitor addresses, as well as having different
logging levels or locations for different volumes.

Reviewed-by: Christian Brunner <chb@muc.de>
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agorbd: use the higher level librbd instead of just librados
Josh Durgin [Thu, 26 May 2011 23:07:31 +0000 (16:07 -0700)]
rbd: use the higher level librbd instead of just librados

librbd stacks on top of librados to provide access
to rbd images.

Using librbd simplifies the qemu code, and allows
qemu to use new versions of the rbd format
with few (if any) changes.

Reviewed-by: Christian Brunner <chb@muc.de>
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock/raw-posix: get right partition size
Christoph Egger [Mon, 23 May 2011 12:31:17 +0000 (14:31 +0200)]
block/raw-posix: get right partition size

use the correct way to get the size of a disk device or partition

From: Adam Hamsik <haad@netbsd.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock/raw-posix: use a character device if a block device is given
Christoph Egger [Tue, 24 May 2011 09:30:29 +0000 (11:30 +0200)]
block/raw-posix: use a character device if a block device is given

On NetBSD a userland process is better with the character device
interface. In addition, a block device can't be opened twice; if a Xen
backend opens it, qemu can't and vice-versa.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agovmdk: fix endianness bugs
Alexander Graf [Tue, 24 May 2011 22:46:55 +0000 (00:46 +0200)]
vmdk: fix endianness bugs

The vmdk code is sloppy when handling the header descriptor during
creation of an image. Fix all header accesses in the create path to
either store native endianness or convert it when appropriate.

Reported-by: Yury Tsarev <ytsarev@novell.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>