sdk/emulator/qemu.git
10 years agoMerge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0...
Peter Maydell [Tue, 3 Jun 2014 13:37:43 +0000 (14:37 +0100)]
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging

VFIO patches: realtek NIC quirk + SPAPR IOMMU AddressSpace support

# gpg: Signature made Mon 02 Jun 2014 22:44:42 BST using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

* remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0:
  vfio: Add guest side IOMMU support
  vfio: Create VFIOAddressSpace objects as needed
  vfio: Introduce VFIO address spaces
  vfio: Rework to have error paths
  vfio: Fix 128 bit handling
  int128: Add int128_exts64()
  memory: Sanity check that no listeners remain on a destroyed AddressSpace
  vfio-pci: Quirk RTL8168 NIC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-roms-3' into staging
Peter Maydell [Tue, 3 Jun 2014 10:59:48 +0000 (11:59 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-3' into staging

seabios: update to 1.7.5 final

# gpg: Signature made Mon 02 Jun 2014 15:49:59 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-roms-3:
  seabios: update to 1.7.5 final

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-8' into staging
Peter Maydell [Mon, 2 Jun 2014 16:07:21 +0000 (17:07 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-8' into staging

qtest: improve ehci/uhci test
usb: misc fixes, mostly for usb3/xhci

# gpg: Signature made Mon 02 Jun 2014 15:40:34 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-usb-8:
  xhci: order superspeed ports first
  xhci: make port reset trace point more verbose
  usb: add usb_pick_speed
  usb-host: add HAVE_STREAMS define
  usb-host: allow attaching usb3 devices to ehci
  usb: improve ehci/uhci test
  usb: move ehci register defines to header file
  usb: add uhci port status reserved bit
  usb: move uhci register defines to header file
  qtest: fix qpci_config_writel

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into staging
Peter Maydell [Mon, 2 Jun 2014 15:10:12 +0000 (16:10 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into staging

sdl2: add support for text consoles

# gpg: Signature made Mon 02 Jun 2014 15:35:20 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-sdl-3:
  sdl2: textinput + terminal
  sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
  console: add kbd_put_string_console
  console: add kbd_put_qcode_console

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoseabios: update to 1.7.5 final
Gerd Hoffmann [Mon, 2 Jun 2014 14:49:00 +0000 (16:49 +0200)]
seabios: update to 1.7.5 final

git shortlog since -rc1:

Gerd Hoffmann (2):
      acpi: remove PORT_ACPI_PM_BASE constant
      Allow using full io region on q35.

Kevin O'Connor (2):
      vgabios: Add debug message if x86emu leal check triggers.
      python3 fixes for vgabios and csm builds.

Paolo Bonzini (1):
      smm: remove code to handle ACPI disable/enable

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-3' into staging
Peter Maydell [Mon, 2 Jun 2014 14:47:40 +0000 (15:47 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-3' into staging

misc minor vnc patches

# gpg: Signature made Mon 02 Jun 2014 15:31:53 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vnc-3:
  vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}
  vnc: add trace events for key events
  vnc: refuse to set a password with VNC_AUTH_NONE

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoxhci: order superspeed ports first
Gerd Hoffmann [Thu, 15 May 2014 10:42:16 +0000 (12:42 +0200)]
xhci: order superspeed ports first

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}
Gonglei [Wed, 28 May 2014 13:21:35 +0000 (21:21 +0800)]
vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}

Spotted by Coverity:

(1) Event assignment:  Assigning: "pixels" = "0".
(2) Event cond_true:  Condition "y < h", taking true branch
(3) Event cond_false:  Condition "x < w", taking false branch
(4) Event loop_end:  Reached end of loop
(5) Event divide_by_zero:  In expression "(stats[0] + stats[1]) * 100U / pixels",
division by expression "pixels" which may be zero has undefined behavior.

290     DEFINE_DETECT_FUNCTION(16)
291     DEFINE_DETECT_FUNCTION(32)

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc: add trace events for key events
Gerd Hoffmann [Wed, 21 May 2014 11:18:20 +0000 (13:18 +0200)]
vnc: add trace events for key events

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc: refuse to set a password with VNC_AUTH_NONE
Gerd Hoffmann [Wed, 11 Dec 2013 12:15:37 +0000 (13:15 +0100)]
vnc: refuse to set a password with VNC_AUTH_NONE

Current code silently changes the authentication settings
in case you try to set a password without password authentication
turned on.  This is bad.  Return an error instead.

If we want allow changing auth settings at runtime this should
be done explicitly using a separate monitor command, not as
side effect of set_passwd.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: make port reset trace point more verbose
Gerd Hoffmann [Fri, 23 May 2014 13:44:42 +0000 (15:44 +0200)]
xhci: make port reset trace point more verbose

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add usb_pick_speed
Gerd Hoffmann [Fri, 23 May 2014 14:20:54 +0000 (16:20 +0200)]
usb: add usb_pick_speed

We can pick the usb port speed in generic code, by looking at the port
and device speed masks and looking for the fastest match.  So add a
function to do exactly that, and drop the speed setting code from
usb_desc_attach as it isn't needed any more.

This way we can set the device speed before calling port->ops->attach,
which fixes some xhci hotplug issues.

https://bugzilla.redhat.com/show_bug.cgi?id=1046873

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb-host: add HAVE_STREAMS define
Gerd Hoffmann [Fri, 23 May 2014 09:26:52 +0000 (11:26 +0200)]
usb-host: add HAVE_STREAMS define

10 years agousb-host: allow attaching usb3 devices to ehci
Gerd Hoffmann [Fri, 23 May 2014 08:27:00 +0000 (10:27 +0200)]
usb-host: allow attaching usb3 devices to ehci

Extend compatibility test function to also figure whenever usb3
devices can be supported on ehci.  Tweak ep0 maxpacketsize field
due to usb2 <-> usb3 difference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: improve ehci/uhci test
Gerd Hoffmann [Wed, 7 May 2014 14:39:11 +0000 (16:39 +0200)]
usb: improve ehci/uhci test

 * Attach usb devices to the bus.
 * Check initial port status register state.
 * Flip ehci initialization bit.
 * Check port status register state again to
   see whenever device handover to ehci worked.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move ehci register defines to header file
Gerd Hoffmann [Thu, 8 May 2014 10:15:23 +0000 (12:15 +0200)]
usb: move ehci register defines to header file

So we can easily use them in tests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add uhci port status reserved bit
Gerd Hoffmann [Thu, 8 May 2014 09:42:53 +0000 (11:42 +0200)]
usb: add uhci port status reserved bit

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move uhci register defines to header file
Gerd Hoffmann [Thu, 8 May 2014 08:58:44 +0000 (10:58 +0200)]
usb: move uhci register defines to header file

So we can easily use them in tests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqtest: fix qpci_config_writel
Gerd Hoffmann [Thu, 8 May 2014 08:54:33 +0000 (10:54 +0200)]
qtest: fix qpci_config_writel

Found by Paolo.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl2: textinput + terminal
Gerd Hoffmann [Mon, 26 May 2014 12:05:51 +0000 (14:05 +0200)]
sdl2: textinput + terminal

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
Gerd Hoffmann [Tue, 27 May 2014 07:44:39 +0000 (09:44 +0200)]
sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoconsole: add kbd_put_string_console
Gerd Hoffmann [Tue, 27 May 2014 07:32:36 +0000 (09:32 +0200)]
console: add kbd_put_string_console

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoconsole: add kbd_put_qcode_console
Gerd Hoffmann [Tue, 27 May 2014 07:28:38 +0000 (09:28 +0200)]
console: add kbd_put_qcode_console

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Mon, 2 Jun 2014 14:27:18 +0000 (15:27 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches

# gpg: Signature made Mon 02 Jun 2014 14:56:00 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  qemu-img: Report error even with --oformat=json
  vmdk: Fix local_err in vmdk_create
  block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX
  qemu-img: Plug memory leak in convert command
  block/sheepdog: Plug memory leak in sd_snapshot_create()
  block/vvfat: Plug memory leak in read_directory()
  block/vvfat: Plug memory leak in check_directory_consistency()
  block/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR
  blockdev: Plug memory leak in drive_init()
  blockdev: Plug memory leak in blockdev_init()
  qemu-io: Don't print NULL when open without non-option arg fails
  qemu-io: Plug memory leak in open command
  qemu-io: Support multiple -o in open command
  block: Plug memory leak on brv_open_image() error path
  qcow2: Plug memory leak on qcow2_invalidate_cache() error paths
  block/vvfat: Plug memory leak in enable_write_target()
  qemu-img: Plug memory leak on block option help error path

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoRevert "bsd-user: replace fprintf(stderr, ...) with error_report()"
Peter Maydell [Mon, 2 Jun 2014 12:24:37 +0000 (13:24 +0100)]
Revert "bsd-user: replace fprintf(stderr, ...) with error_report()"

This reverts commit 1fba509527beb74bdcf50bc07ad3cd8244ad9c61.

That commit converted various fprintf(stderr, ...) calls to
use error_report(); however none of these bsd-user files include
a header which gives a prototype for error_report, so this
causes compiler warnings. Since these are just straightforward
reporting of command line errors, we should handle these in the
obvious way by printing to stderr, as we do for linux-user.
There's no need to drag in the error-handling framework for this,
especially since user-mode doesn't have the "maybe we need to
send this to the monitor" issues system emulation does.

Acked-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoqemu-img: Report error even with --oformat=json
Max Reitz [Sat, 31 May 2014 19:33:30 +0000 (21:33 +0200)]
qemu-img: Report error even with --oformat=json

img_check() should report that the format of the given image does not
support checks even if JSON output is desired. JSON data is output to
stdout, as opposed to error messages, which are (in the case of
qemu-img) printed to stderr. Therefore, it is easy to distinguish
between the two.

Also, img_info() does already use error_report() for human-readable
messages even though JSON output is desired (through
collect_image_info_list()).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agovfio: Add guest side IOMMU support
David Gibson [Fri, 30 May 2014 19:10:07 +0000 (13:10 -0600)]
vfio: Add guest side IOMMU support

This patch uses the new IOMMU notifiers to allow VFIO pass through devices
to work with guest side IOMMUs, as long as the host-side VFIO iommu has
sufficient capability and granularity to match the guest side. This works
by tracking all map and unmap operations on the guest IOMMU using the
notifiers, and mirroring them into VFIO.

There are a number of FIXMEs, and the scheme involves rather more notifier
structures than I'd like, but it should make for a reasonable proof of
concept.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovfio: Create VFIOAddressSpace objects as needed
David Gibson [Fri, 30 May 2014 19:09:14 +0000 (13:09 -0600)]
vfio: Create VFIOAddressSpace objects as needed

So far, VFIO has a notion of different logical DMA address spaces, but
only ever uses one (system memory).  This patch extends this, creating
new VFIOAddressSpace objects as necessary, according to the AddressSpace
reported by the PCI subsystem for this device's DMAs.

This isn't enough yet to support guest side IOMMUs with VFIO, but it does
mean we could now support VFIO devices on, for example, a guest side PCI
host bridge which maps system memory at somewhere other than 0 in PCI
space.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovfio: Introduce VFIO address spaces
David Gibson [Fri, 30 May 2014 19:05:19 +0000 (13:05 -0600)]
vfio: Introduce VFIO address spaces

The only model so far supported for VFIO passthrough devices is the model
usually used on x86, where all of the guest's RAM is mapped into the
(host) IOMMU and there is no IOMMU visible in the guest.

This patch begins to relax this model, introducing the notion of a
VFIOAddressSpace.  This represents a logical DMA address space which will
be visible to one or more VFIO devices by appropriate mapping in the (host)
IOMMU.  Thus the currently global list of containers becomes local to
a VFIOAddressSpace, and we verify that we don't attempt to add a VFIO
group to multiple address spaces.

For now, only one VFIOAddressSpace is created and used, corresponding to
main system memory, that will change in future patches.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovfio: Rework to have error paths
Alexey Kardashevskiy [Fri, 30 May 2014 19:03:21 +0000 (13:03 -0600)]
vfio: Rework to have error paths

This reworks vfio_connect_container() and vfio_get_group() to have
common exit path at the end of the function bodies.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovfio: Fix 128 bit handling
Alexey Kardashevskiy [Fri, 30 May 2014 19:02:02 +0000 (13:02 -0600)]
vfio: Fix 128 bit handling

Upcoming VFIO on SPAPR PPC64 support will initialize the IOMMU
memory region with UINT64_MAX (2^64 bytes) size so int128_get64()
will assert.

The patch takes care of this check. The existing type1 IOMMU code
is not expected to map all 64 bits of RAM so the patch does not
touch that part.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agoint128: Add int128_exts64()
Alexey Kardashevskiy [Fri, 30 May 2014 19:00:28 +0000 (13:00 -0600)]
int128: Add int128_exts64()

This adds macro to extend signed 64bit value to signed 128bit value.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agomemory: Sanity check that no listeners remain on a destroyed AddressSpace
David Gibson [Fri, 30 May 2014 18:59:00 +0000 (12:59 -0600)]
memory: Sanity check that no listeners remain on a destroyed AddressSpace

At the moment, most AddressSpace objects last as long as the guest system
in practice, but that could well change in future.  In addition, for VFIO
we will be introducing some private per-AdressSpace information, which must
be disposed of before the AddressSpace itself is destroyed.

To reduce the chances of subtle bugs in this area, this patch adds
asssertions to ensure that when an AddressSpace is destroyed, there are no
remaining MemoryListeners using that AS as a filter.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovfio-pci: Quirk RTL8168 NIC
Alex Williamson [Fri, 30 May 2014 18:43:50 +0000 (12:43 -0600)]
vfio-pci: Quirk RTL8168 NIC

This device is ridiculous.  It has two MMIO BARs, BAR4 and BAR2.  BAR4
hosts the MSI-X table, so oviously it would be too easy to access it
directly, instead it creates a window register in BAR2 that, among
other things, provides access to the MSI-X table.  This means MSI-X
doesn't work in the guest because the driver actually manages to
program the physical table.  When interrupt remapping is present, the
device MSI will be blocked.  The Linux driver doesn't make use of this
window, so apparently it's not required to make use of MSI-X.  This
quirk makes the device work with the Windows driver that does use this
window for MSI-X, but I certainly cannot recommend this device for
assignment (the Windows 7 driver also constantly pokes PCI config
space).

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
10 years agovmdk: Fix local_err in vmdk_create
Fam Zheng [Wed, 28 May 2014 03:38:58 +0000 (11:38 +0800)]
vmdk: Fix local_err in vmdk_create

In vmdk_create and vmdk_create_extent, initialize local_err before using
it, and don't leak it on error.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/raw-posix.c: Avoid nonstandard LONG_LONG_MAX
Peter Maydell [Fri, 23 May 2014 16:15:41 +0000 (17:15 +0100)]
block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX

In the MacOSX specific code in raw-posix.c we use the define
LONG_LONG_MAX. This is actually a non-standard pre-C99 define;
switch to using the standard LLONG_MAX instead.

This apparently fixes a compilation failure with certain
compiler/OS versions (though it is unclear which).

Reported-by: Peter Bartoli <peter@bartoli.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-img: Plug memory leak in convert command
Markus Armbruster [Wed, 28 May 2014 09:17:07 +0000 (11:17 +0200)]
qemu-img: Plug memory leak in convert command

Introduced in commit 661a0f7.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/sheepdog: Plug memory leak in sd_snapshot_create()
Markus Armbruster [Wed, 28 May 2014 09:17:06 +0000 (11:17 +0200)]
block/sheepdog: Plug memory leak in sd_snapshot_create()

Has always been leaky.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/vvfat: Plug memory leak in read_directory()
Markus Armbruster [Wed, 28 May 2014 09:17:05 +0000 (11:17 +0200)]
block/vvfat: Plug memory leak in read_directory()

Has always been leaky.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/vvfat: Plug memory leak in check_directory_consistency()
Markus Armbruster [Wed, 28 May 2014 09:17:04 +0000 (11:17 +0200)]
block/vvfat: Plug memory leak in check_directory_consistency()

On error path.  Introduced in commit a046433a.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR
Markus Armbruster [Wed, 28 May 2014 09:17:03 +0000 (11:17 +0200)]
block/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR

Introduced in commit a8d8ecb.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblockdev: Plug memory leak in drive_init()
Markus Armbruster [Wed, 28 May 2014 09:17:02 +0000 (11:17 +0200)]
blockdev: Plug memory leak in drive_init()

bs_opts is leaked on all paths from its qdev_new() that don't got
through blockdev_init().  Add the missing QDECREF(), and zap bs_opts
after blockdev_init(), so the new QDECREF() does nothing when we go
through blockdev_init().

Leak introduced in commit f298d07.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblockdev: Plug memory leak in blockdev_init()
Markus Armbruster [Wed, 28 May 2014 09:17:01 +0000 (11:17 +0200)]
blockdev: Plug memory leak in blockdev_init()

blockdev_init() leaks bs_opts when qemu_opts_create() fails, i.e. when
the ID is bad.  Missed in commit ec9c10d.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-io: Don't print NULL when open without non-option arg fails
Markus Armbruster [Wed, 28 May 2014 09:17:00 +0000 (11:17 +0200)]
qemu-io: Don't print NULL when open without non-option arg fails

Reproducer: "open -o a=b".  Broken in commit fd0fee3.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-io: Plug memory leak in open command
Markus Armbruster [Wed, 28 May 2014 09:16:59 +0000 (11:16 +0200)]
qemu-io: Plug memory leak in open command

Introduced in commit b543c5c.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-io: Support multiple -o in open command
Markus Armbruster [Wed, 28 May 2014 09:16:58 +0000 (11:16 +0200)]
qemu-io: Support multiple -o in open command

Instead of ignoring all option values but the last one, multiple -o
options now have the same meaning as having a single option with all
settings in the order of their respective -o options.

Same as commit 2dc8328 for qemu-img convert, except here we do it with
QemuOpts rather than QEMUOptionParameter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock: Plug memory leak on brv_open_image() error path
Markus Armbruster [Wed, 28 May 2014 09:16:57 +0000 (11:16 +0200)]
block: Plug memory leak on brv_open_image() error path

Introduced in commit da557a.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqcow2: Plug memory leak on qcow2_invalidate_cache() error paths
Markus Armbruster [Wed, 28 May 2014 09:16:56 +0000 (11:16 +0200)]
qcow2: Plug memory leak on qcow2_invalidate_cache() error paths

Introduced in commit 5a8a30d.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock/vvfat: Plug memory leak in enable_write_target()
Markus Armbruster [Wed, 28 May 2014 09:16:55 +0000 (11:16 +0200)]
block/vvfat: Plug memory leak in enable_write_target()

I figure the leak originated in bdrv_create2(), and was duplicated
into callers when commit 91a073a dropped that function.  Looks like
the other places have since been fixed.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-img: Plug memory leak on block option help error path
Markus Armbruster [Wed, 28 May 2014 09:16:54 +0000 (11:16 +0200)]
qemu-img: Plug memory leak on block option help error path

Introduced in commit a283cb6; mostly harmless.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
Peter Maydell [Wed, 28 May 2014 17:38:38 +0000 (18:38 +0100)]
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM/QTest infrastructure fixes and device conversions

* qom-test extension
* QEMUMachineInitArgs conversion to MachineState
* -machine options turned into /machine properties
* Named GPIO IRQs for devices

# gpg: Signature made Wed 28 May 2014 18:24:04 BST using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

* remotes/afaerber/tags/qom-devices-for-peter:
  ssi: Name the CS GPIO
  qdev: Implement named GPIOs
  machine: Make -machine opts properties of MachineState
  tests: Check empty QMP output visitor
  qapi: Avoid output visitor crashing if it encounters a NULL value
  vl.c: Do not set 'type' property in obj_set_property()
  machine: Conversion of QEMUMachineInitArgs to MachineState
  qom-test: Test qom-list on link<> properties

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/tcg-next' into staging
Peter Maydell [Wed, 28 May 2014 16:44:45 +0000 (17:44 +0100)]
Merge remote-tracking branch 'remotes/rth/tcg-next' into staging

* remotes/rth/tcg-next:
  tcg/optimize: Remember garbage high bits for 32-bit ops
  tcg/optimize: Move updating of gen_opc_buf into tcg_opt_gen_mov*
  tcg-sparc: Make debug_frame const
  tcg-s390: Make debug_frame const
  tcg-arm: Make debug_frame const
  tcg-aarch64: Make debug_frame const
  tcg-i386: Make debug_frame const
  tcg: Allow the debug_frame data structure to be constant
  tcg: Move size effects out of dh_arg
  tcg: Remove sizemask and flags arguments to tcg_gen_callN
  tcg: Save flags and computed sizemask in TCGHelperInfo
  tcg: Register the helper info struct rather than the name
  tcg: Move side effects out of dh_sizemask
  tcg: Inline tcg_gen_helperN
  tcg: Use helper-gen.h in tcg-op.h
  tcg: Push tcg-runtime routines into exec/helper-*
  tcg: Invert the inclusion of helper.h
  tcg: Optimize brcond2 and setcond2 ne/eq

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotcg/optimize: Remember garbage high bits for 32-bit ops
Richard Henderson [Thu, 22 May 2014 18:14:10 +0000 (11:14 -0700)]
tcg/optimize: Remember garbage high bits for 32-bit ops

For a 64-bit host, the high bits of a register after a 32-bit operation
are undefined.  Adjust the temps mask for all 32-bit ops to reflect that.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg/optimize: Move updating of gen_opc_buf into tcg_opt_gen_mov*
Richard Henderson [Thu, 22 May 2014 17:59:12 +0000 (10:59 -0700)]
tcg/optimize: Move updating of gen_opc_buf into tcg_opt_gen_mov*

No functional change, just reduce a bit of redundancy.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-sparc: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:49:56 +0000 (12:49 -0700)]
tcg-sparc: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:49:42 +0000 (12:49 -0700)]
tcg-s390: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-arm: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:49:30 +0000 (12:49 -0700)]
tcg-arm: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-aarch64: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:49:13 +0000 (12:49 -0700)]
tcg-aarch64: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-i386: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:48:43 +0000 (12:48 -0700)]
tcg-i386: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Allow the debug_frame data structure to be constant
Richard Henderson [Thu, 15 May 2014 19:48:01 +0000 (12:48 -0700)]
tcg: Allow the debug_frame data structure to be constant

Adjust the FDE to point to the code_buffer after we've copied it
to the image, rather than requiring that the backend set it prior.
This allows the backend to use read-only storage for its data.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Move size effects out of dh_arg
Richard Henderson [Tue, 8 Apr 2014 15:53:28 +0000 (08:53 -0700)]
tcg: Move size effects out of dh_arg

Tidying the initialization of the args arrays at the same time.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Remove sizemask and flags arguments to tcg_gen_callN
Richard Henderson [Tue, 8 Apr 2014 15:39:43 +0000 (08:39 -0700)]
tcg: Remove sizemask and flags arguments to tcg_gen_callN

Take them from the TCGHelperInfo struct instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Save flags and computed sizemask in TCGHelperInfo
Richard Henderson [Mon, 7 Apr 2014 22:10:05 +0000 (15:10 -0700)]
tcg: Save flags and computed sizemask in TCGHelperInfo

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Register the helper info struct rather than the name
Richard Henderson [Tue, 8 Apr 2014 07:17:53 +0000 (00:17 -0700)]
tcg: Register the helper info struct rather than the name

This will let us find all the info from the hash table.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Move side effects out of dh_sizemask
Richard Henderson [Tue, 8 Apr 2014 07:01:09 +0000 (00:01 -0700)]
tcg: Move side effects out of dh_sizemask

Moving them into dh_arg instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Inline tcg_gen_helperN
Richard Henderson [Tue, 8 Apr 2014 06:44:10 +0000 (23:44 -0700)]
tcg: Inline tcg_gen_helperN

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Use helper-gen.h in tcg-op.h
Richard Henderson [Tue, 8 Apr 2014 06:36:08 +0000 (23:36 -0700)]
tcg: Use helper-gen.h in tcg-op.h

No need to open-code the setup of the builtin helpers.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Push tcg-runtime routines into exec/helper-*
Richard Henderson [Tue, 8 Apr 2014 06:08:47 +0000 (23:08 -0700)]
tcg: Push tcg-runtime routines into exec/helper-*

Rather than special casing them, use the standard mechanisms
for tcg helper generation.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Invert the inclusion of helper.h
Richard Henderson [Tue, 8 Apr 2014 05:31:41 +0000 (22:31 -0700)]
tcg: Invert the inclusion of helper.h

Rather than include helper.h with N values of GEN_HELPER, include a
secondary file that sets up the macros to include helper.h.  This
minimizes the files that must be rebuilt when changing the macros
for file N.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Optimize brcond2 and setcond2 ne/eq
Richard Henderson [Thu, 24 Apr 2014 05:18:30 +0000 (22:18 -0700)]
tcg: Optimize brcond2 and setcond2 ne/eq

If either the high or low pair can be resolved, we can
simplify to either a constant or to a 32-bit comparison.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agossi: Name the CS GPIO
Peter Crosthwaite [Tue, 20 May 2014 06:31:33 +0000 (23:31 -0700)]
ssi: Name the CS GPIO

To get it out of the default GPIO list. This allows child devices to
use the un-named GPIO namespace without having to be SSI aware. That
is, there is no more need for machines to know about the obscure
policy where GPIO 0 is the SSI chip-select and GPIO 1..N are the
concrete class GPIOs (defined locally as 0..N-1).

This is most notable in stellaris, which uses a device which has both
SSI and concrete level GPIOs.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev: Implement named GPIOs
Peter Crosthwaite [Tue, 20 May 2014 06:30:58 +0000 (23:30 -0700)]
qdev: Implement named GPIOs

Implement named GPIOs on the Device layer. Listifies the existing GPIOs
stuff using string keys. Legacy un-named GPIOs are preserved by using
a NULL name string - they are just a single matchable element in the
name list.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomachine: Make -machine opts properties of MachineState
Marcel Apfelbaum [Mon, 26 May 2014 12:40:58 +0000 (15:40 +0300)]
machine: Make -machine opts properties of MachineState

Make machine's QemuOpts QOM properties of /machine. The properties
are automatically filled in. This opens the possibility to create
opts per machine rather than global.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agotests: Check empty QMP output visitor
Marcel Apfelbaum [Mon, 26 May 2014 12:40:56 +0000 (15:40 +0300)]
tests: Check empty QMP output visitor

Checks the output visitor behaviour for NULL values.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqapi: Avoid output visitor crashing if it encounters a NULL value
Marcel Apfelbaum [Mon, 26 May 2014 12:40:55 +0000 (15:40 +0300)]
qapi: Avoid output visitor crashing if it encounters a NULL value

A NULL value is not added to visitor's stack, but there
is no check for that when the visitor tries to return
that value, leading to QEMU crash.

Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agovl.c: Do not set 'type' property in obj_set_property()
Marcel Apfelbaum [Mon, 26 May 2014 12:40:57 +0000 (15:40 +0300)]
vl.c: Do not set 'type' property in obj_set_property()

Filter out also 'type' property when setting
object's properties.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomachine: Conversion of QEMUMachineInitArgs to MachineState
Marcel Apfelbaum [Wed, 7 May 2014 14:42:57 +0000 (17:42 +0300)]
machine: Conversion of QEMUMachineInitArgs to MachineState

Total removal of QEMUMachineInitArgs struct. QEMUMachineInitArgs's fields
are copied into MachineState. Removed duplicated fields from MachineState.

All the other changes are only mechanical refactoring, no semantic changes.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (s390)
Reviewed-by: Michael S. Tsirkin <mst@redhat.com> (PC)
[AF: Renamed ms -> machine, use MACHINE_GET_CLASS()]
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqom-test: Test qom-list on link<> properties
Cole Robinson [Fri, 11 Apr 2014 22:07:12 +0000 (18:07 -0400)]
qom-test: Test qom-list on link<> properties

But don't test their properties, otherwise we will recurse forever.
Their properties are already tested when we encounter them as child<>
properties elsewhere in the hierarchy, like /machine/unattached/...

This would have caught the crash fixed by 92b3eead.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Wed, 28 May 2014 14:22:40 +0000 (15:22 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Block pull request

# gpg: Signature made Wed 28 May 2014 13:31:15 BST using RSA key ID 81AB73C8
# gpg: Can't check signature: public key not found

* remotes/stefanha/tags/block-pull-request: (33 commits)
  block/sheepdog: Don't use qerror_report()
  block/sheepdog: Fix silent sd_open(), sd_create() failures
  block/sheepdog: Propagate errors to open and create methods
  block/sheepdog: Propagate errors through find_vdi_name()
  block/sheepdog: Propagate errors through do_sd_create()
  block/sheepdog: Propagate errors through sd_prealloc()
  block/sheepdog: Propagate errors through get_sheep_fd()
  block/sheepdog: Propagate errors through connect_to_sdog()
  block/vvfat: Propagate errors through init_directories()
  block/vvfat: Propagate errors through enable_write_target()
  block/ssh: Propagate errors to open and create methods
  block/ssh: Propagate errors through connect_to_ssh()
  block/ssh: Propagate errors through authenticate()
  block/ssh: Propagate errors through check_host_key()
  block/ssh: Drop superfluous libssh2_session_last_errno() calls
  block/rbd: Propagate errors to open and create methods
  qemu-nbd: Don't use qerror_report()
  blockdev: Don't use qerror_report() in do_drive_del()
  blockdev: Don't use qerror_report_err() in drive_init()
  docs: Define refcount_bits value
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140527' into...
Peter Maydell [Wed, 28 May 2014 14:00:33 +0000 (15:00 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140527' into staging

target-arm:
 * Preliminary restructuring for EL2/EL3 support
 * improve CPACR handling
 * fix pxa2xx_lcd palette formats
 * update highbank/midway maintainer

# gpg: Signature made Tue 27 May 2014 17:26:27 BST using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

* remotes/pmaydell/tags/pull-target-arm-20140527: (26 commits)
  target-arm: A64: Register VBAR_EL3
  target-arm: A64: Register VBAR_EL2
  target-arm: Make vbar_write writeback to any CPREG
  target-arm: A64: Generalize update_spsel for the various ELs
  target-arm: A64: Generalize ERET to various ELs
  target-arm: A64: Trap ERET from EL0 at translation time
  target-arm: A64: Forbid ERET to higher or unimplemented ELs
  target-arm: Register EL3 versions of ELR and SPSR
  target-arm: Register EL2 versions of ELR and SPSR
  target-arm: Add a feature flag for EL3
  target-arm: Add a feature flag for EL2
  target-arm: A64: Introduce aarch64_banked_spsr_index()
  target-arm: Add SPSR entries for EL2/HYP and EL3/MON
  target-arm: A64: Add ELR entries for EL2 and 3
  target-arm: A64: Add SP entries for EL2 and 3
  target-arm: c12_vbar -> vbar_el[]
  target-arm: Make esr_el1 an array
  target-arm: Make elr_el1 an array
  target-arm: Use a 1:1 mapping between EL and MMU index
  target-arm: A32: Use get_mem_index for load/stores
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into staging
Peter Maydell [Wed, 28 May 2014 13:47:35 +0000 (14:47 +0100)]
Merge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into staging

Xtensa fixes queue 2014-05-26:
- fix cross-page jumps/calls at the end of TB;
- add tests for TBs and instructions crossing page boundary.

# gpg: Signature made Mon 26 May 2014 09:37:39 BST using RSA key ID F83FA044
# gpg: Can't check signature: public key not found

* remotes/xtensa/tags/20140526-xtensa:
  target-xtensa: add tests for cross-page TB
  target-xtensa: completely clean TLB between MMU tests
  target-xtensa: fix cross-page jumps/calls at the end of TB

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-7' into staging
Peter Maydell [Wed, 28 May 2014 12:52:03 +0000 (13:52 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-7' into staging

usb: usb3 streams support for usb-host and usb-redir
usb: xhci and mtp bugfixes.

# gpg: Signature made Mon 26 May 2014 09:44:09 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-usb-7:
  usb-host-libusb: Set stream id when submitting bulk-stream transfers
  usb-host-libusb: Add alloc / free streams ops
  usb-host-libusb: Fill in endpoint max_streams when available
  usb-redir: Add support for bulk streams
  usb-mtp: handle usb_mtp_get_object failure
  usb-mtp: handle lseek failure
  usb-mtp: use bool to track MTPObject init status
  xhci: add xhci_get_flag
  xhci: add endpoint cap on express bus only
  xhci: child detach fix

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoblock/sheepdog: Don't use qerror_report()
Markus Armbruster [Fri, 16 May 2014 09:00:26 +0000 (11:00 +0200)]
block/sheepdog: Don't use qerror_report()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.
Replace by error_report().

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Fix silent sd_open(), sd_create() failures
Markus Armbruster [Fri, 16 May 2014 09:00:25 +0000 (11:00 +0200)]
block/sheepdog: Fix silent sd_open(), sd_create() failures

Open and create methods must set an error when they fail.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:24 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0,
except for a few bugs fixed in the next commit.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through find_vdi_name()
Markus Armbruster [Fri, 16 May 2014 09:00:23 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through find_vdi_name()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through do_sd_create()
Markus Armbruster [Fri, 16 May 2014 09:00:22 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through do_sd_create()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through sd_prealloc()
Markus Armbruster [Fri, 16 May 2014 09:00:21 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through sd_prealloc()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through get_sheep_fd()
Markus Armbruster [Fri, 16 May 2014 09:00:20 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through get_sheep_fd()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through connect_to_sdog()
Markus Armbruster [Fri, 16 May 2014 09:00:19 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through connect_to_sdog()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vvfat: Propagate errors through init_directories()
Markus Armbruster [Fri, 16 May 2014 09:00:18 +0000 (11:00 +0200)]
block/vvfat: Propagate errors through init_directories()

Completes the conversion of the open method to Error started in commit
015a103.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vvfat: Propagate errors through enable_write_target()
Markus Armbruster [Fri, 16 May 2014 09:00:17 +0000 (11:00 +0200)]
block/vvfat: Propagate errors through enable_write_target()

Continues the conversion of the open method to Error started in commit
015a103.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:16 +0000 (11:00 +0200)]
block/ssh: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through connect_to_ssh()
Markus Armbruster [Fri, 16 May 2014 09:00:15 +0000 (11:00 +0200)]
block/ssh: Propagate errors through connect_to_ssh()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through authenticate()
Markus Armbruster [Fri, 16 May 2014 09:00:14 +0000 (11:00 +0200)]
block/ssh: Propagate errors through authenticate()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through check_host_key()
Markus Armbruster [Fri, 16 May 2014 09:00:13 +0000 (11:00 +0200)]
block/ssh: Propagate errors through check_host_key()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Drop superfluous libssh2_session_last_errno() calls
Markus Armbruster [Fri, 16 May 2014 09:00:12 +0000 (11:00 +0200)]
block/ssh: Drop superfluous libssh2_session_last_errno() calls

libssh2_session_last_error() already returns the error code.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/rbd: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:11 +0000 (11:00 +0200)]
block/rbd: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0.

Cc: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-nbd: Don't use qerror_report()
Markus Armbruster [Fri, 16 May 2014 09:00:10 +0000 (11:00 +0200)]
qemu-nbd: Don't use qerror_report()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.
Replace by error_report().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblockdev: Don't use qerror_report() in do_drive_del()
Markus Armbruster [Fri, 16 May 2014 09:00:09 +0000 (11:00 +0200)]
blockdev: Don't use qerror_report() in do_drive_del()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.

do_drive_del() is an HMP command that won't be converted to QMP (we'll
create a new QMP command instead).  It uses both qerror_report() and
error_report().  Convert the former to the latter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>