]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:37 +0000 (14:44 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  qapi: Convert getfd and closefd
  qapi: input_type_enum(): fix error message
  qmp: dump-guest-memory: improve schema doc

11 years agoMerge remote-tracking branch 'kraxel/bios.2' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:32 +0000 (14:44 -0500)]
Merge remote-tracking branch 'kraxel/bios.2' into staging

* kraxel/bios.2:
  Add vgabios build rules to roms/Makefile

11 years agoMerge remote-tracking branch 'kraxel/usb.57' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:27 +0000 (14:44 -0500)]
Merge remote-tracking branch 'kraxel/usb.57' into staging

* kraxel/usb.57:
  ehci: improve expire time calculation
  ehci: implement Interrupt Threshold Control support
  ehci: raise irq in the frame timer
  uhci: initialize expire_time when loading v1 vmstate
  usb: add usb attached scsi emulation
  scsi: add free_request callback

11 years agobuild: fix build breakage due to bad merge
Anthony Liguori [Tue, 17 Jul 2012 23:58:20 +0000 (18:58 -0500)]
build: fix build breakage due to bad merge

34bb443ee74df3780d86044dbf6492eb798c5807 broke the build but in a subtle way.
The patch on the ML was actually based on the 1.1.1 stable branch
(accidentally).  When I merged it from the ML, the fuzzing got resolved in a
such a way that the newly introduced Makefile dependency on GENERATED_HEADERS
got lost (that was not in 1.1.1).

The dist bits also got duplicated (but this is just cosmetic).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agobuild: add make dist target (v2)
Anthony Liguori [Tue, 17 Jul 2012 18:33:32 +0000 (13:33 -0500)]
build: add make dist target (v2)

Let's stop screwing up releases by having a script do the work that Anthony's
fat fingers can't seem to get right.

Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-options.hx: Fix set_password and expire_password description
Michal Novotny [Mon, 16 Jul 2012 13:54:38 +0000 (15:54 +0200)]
qemu-options.hx: Fix set_password and expire_password description

The description for set_password and expire_password commands is
incomplete. This patch fixes the man page that is being generated
to match the real behaviour of these functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-options.hx: Improve -nodefaults description
Michal Novotny [Mon, 16 Jul 2012 12:35:10 +0000 (14:35 +0200)]
qemu-options.hx: Improve -nodefaults description

This patch improves the description of -nodefaults QEMU command line
option by adding more information what is being disabled using this
command.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-options.hx: Improve -{read|write}config options description
Michal Novotny [Mon, 16 Jul 2012 12:28:32 +0000 (14:28 +0200)]
qemu-options.hx: Improve -{read|write}config options description

This is the patch to improve description for -{read|write}config
functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoconstify value pointer for qdev_prop_set_string
Christian Borntraeger [Tue, 17 Jul 2012 13:26:17 +0000 (15:26 +0200)]
constify value pointer for qdev_prop_set_string

qdev_prop_set_string uses object_property_set_str, which takes
a const char * for the value. Lets propagate the constness
into qdev_prop_set_string.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: Fix indefinite article an -> a before nouns that begin with 'h'
Stefan Weil [Mon, 16 Jul 2012 21:37:07 +0000 (23:37 +0200)]
doc: Fix indefinite article an -> a before nouns that begin with 'h'

Although the rule also allows 'an' for historical reasons,
'a' is more common because 'h' is pronounced.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: Unbreak capturing in mixemu case
malc [Mon, 16 Jul 2012 14:08:36 +0000 (18:08 +0400)]
audio: Unbreak capturing in mixemu case

Signed-off-by: malc <av1474@comtv.ru>
11 years agoqemu-log: fix x86 and user logging
Blue Swirl [Sat, 7 Jul 2012 14:40:18 +0000 (14:40 +0000)]
qemu-log: fix x86 and user logging

5726c27fa913296aafab9f50b912cea5b3709271 broke
x86 specific options and user emulation specific stdio buffering.

Always enable all log items. They may not be useful for non-x86 targets,
but there's no harm either.

Fix user emulation buffering by passing around a flag.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 'trivial-patches' of git://github.com/stefanha/qemu
Blue Swirl [Sat, 14 Jul 2012 10:58:22 +0000 (10:58 +0000)]
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

* 'trivial-patches' of git://github.com/stefanha/qemu:
  make: Remove 'build-all' rule
  qemu-keymaps: Finnish keyboard mapping broken
  vnc: add a more descriptive error message
  bitops: Fix documentation
  megasas: mark mfi_frame_desc as 'static'

11 years agovga: Implement blinking of text cursor
Jan Kiszka [Wed, 4 Jul 2012 17:49:54 +0000 (19:49 +0200)]
vga: Implement blinking of text cursor

Let the text cursor blink at 1.875 Hz, the original VGA cursor
frequency. No timer is used, instead we rely on the fact that the
display is updated periodically.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoconsole: Implementing blinking of cursor
Jan Kiszka [Tue, 10 Jul 2012 20:00:55 +0000 (22:00 +0200)]
console: Implementing blinking of cursor

Let the text console cursor blink at 2 HZ.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoconfigure: add -Werror to QEMU_CFLAGS early
Alexander Graf [Mon, 9 Jul 2012 12:38:08 +0000 (14:38 +0200)]
configure: add -Werror to QEMU_CFLAGS early

We want all configure tests pass with -Werror if it is enabled. So we
need to update QEMU_CFLAGS early on to make sure we also pass it in to
all the compile test jobs.

This fixes a warning-became-error bug in nss for me with the default
configuration:

In file included from /usr/include/nss3/pkcs11t.h:1780,
                 from /usr/include/nss3/keythi.h:41,
                 from /usr/include/nss3/keyt.h:41,
                 from /usr/include/nss3/pk11pub.h:43,
                 from libcacard/vcard_emul_nss.c:21:
/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agomonitor: Use TARGET_PRI*PHYS to avoid TARGET_PHYS_ADDR_BITS ifdef
Peter Maydell [Mon, 25 Jun 2012 15:52:24 +0000 (16:52 +0100)]
monitor: Use TARGET_PRI*PHYS to avoid TARGET_PHYS_ADDR_BITS ifdef

Now we have TARGET_PRI*PHYS for printing target_phys_addr_t values,
we can use them in monitor.c rather than having duplicate code
in two arms of a TARGET_PHYS_ADDR_BITS ifdef.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr
Peter Maydell [Mon, 25 Jun 2012 15:52:23 +0000 (16:52 +0100)]
hw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr

Switch a format string from %x to TARGET_PRIxPHYS so that it will
continue to work even if target_phys_addr_t is changed
to 64 bits in the future.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohw/omap.h: Use TARGET_PRIxPHYS to define OMAP_FMT_plx
Peter Maydell [Mon, 25 Jun 2012 15:52:22 +0000 (16:52 +0100)]
hw/omap.h: Use TARGET_PRIxPHYS to define OMAP_FMT_plx

Use the new TARGET_PRIxPHYS macro to avoid the need to define an
OMAP_FMT_plx macro whose expansion depends directly on
TARGET_PHYS_ADDR_BITS.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotargphys.h: Define TARGET_PRI*PHYS format specifier macros
Peter Maydell [Mon, 25 Jun 2012 15:52:21 +0000 (16:52 +0100)]
targphys.h: Define TARGET_PRI*PHYS format specifier macros

Define a set of TARGET_PRI*PHYS format specifier macros for working
with target_phys_addr_t types. These follow the standard pattern
for such macros, and are more flexible than TARGET_FMT_plx, which
does not allow specification of field widths.

Suggested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agodisas: Fix printing of addresses in disassembly
Peter Maydell [Mon, 25 Jun 2012 04:55:55 +0000 (04:55 +0000)]
disas: Fix printing of addresses in disassembly

In our disassembly code, the bfd_vma type is always 64 bits,
even if the target's virtual address width is only 32 bits. This
means that when we print out addresses we need to truncate them
to 32 bits, to avoid odd output which has incorrectly sign-extended
a value to 64 bits, for instance this ARM example:
    0x80479a60:  e59f4088     ldr  r4, [pc, #136]  ; 0xffffffff80479a4f

(It would also be possible to truncate before passing the address
to info->print_address_func(), but truncating in the final print
function is the same approach that binutils takes to this problem.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: add AMD PCscsi emulation (PCI SCSI adapter)
Hervé Poussineau [Mon, 9 Jul 2012 10:02:31 +0000 (12:02 +0200)]
esp: add AMD PCscsi emulation (PCI SCSI adapter)

The PCI version is supported in lots of Operating Systems,
and has been successfully tested on:
- MS DOS 6.22 (using DC390 driver)
- MS Windows 3.11 (using DC390 driver)
- MS Windows 98 SE (using default driver)
- MS Windows NT 3.1 (using DC390 driver)
- MS Windows NT 4.0 (using default driver)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agopci: add some stubs
Hervé Poussineau [Mon, 9 Jul 2012 10:02:30 +0000 (12:02 +0200)]
pci: add some stubs

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: use trace framework instead of stderr output
Hervé Poussineau [Mon, 9 Jul 2012 10:02:29 +0000 (12:02 +0200)]
esp: use trace framework instead of stderr output

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: split esp code into generic chip emulation and sysbus layer
Hervé Poussineau [Mon, 9 Jul 2012 10:02:28 +0000 (12:02 +0200)]
esp: split esp code into generic chip emulation and sysbus layer

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: use hba_private field instead of a complex cast
Hervé Poussineau [Mon, 9 Jul 2012 10:02:27 +0000 (12:02 +0200)]
esp: use hba_private field instead of a complex cast

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: support future change of chip_id
Hervé Poussineau [Mon, 9 Jul 2012 10:02:26 +0000 (12:02 +0200)]
esp: support future change of chip_id

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: implement Reset ATN command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:25 +0000 (12:02 +0200)]
esp: implement Reset ATN command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: implement Disable selection command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:24 +0000 (12:02 +0200)]
esp: implement Disable selection command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: delay Transfer Information command if dma is not enabled
Hervé Poussineau [Mon, 9 Jul 2012 10:02:23 +0000 (12:02 +0200)]
esp: delay Transfer Information command if dma is not enabled

The same mechanism is already in place for some select commands.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoesp: execute select commands immediately when it is a non-dma command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:22 +0000 (12:02 +0200)]
esp: execute select commands immediately when it is a non-dma command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Sat, 14 Jul 2012 10:07:37 +0000 (10:07 +0000)]
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf

* 's390-for-upstream' of git://repo.or.cz/qemu/agraf:
  s390: autodetect map private

11 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 14 Jul 2012 10:07:34 +0000 (10:07 +0000)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  target-arm: Add support for long format translation table walks
  target-arm: Implement TTBCR changes for LPAE
  target-arm: Implement long-descriptor PAR format
  target-arm: Use target_phys_addr_t in get_phys_addr()
  target-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE
  target-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE
  target-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers
  target-arm: Extend feature flags to 64 bits
  target-arm: Implement privileged-execute-never (PXN)
  ARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits
  hw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits
  target-arm: Fix TCG temp handling in 64 bit cp writes
  target-arm: Fix some copy-and-paste errors in cp register names
  target-arm: Fix typo that meant TTBR1 accesses went to TTBR0
  target-arm: Fix CP15 based WFI

11 years agoqapi: Convert getfd and closefd
Corey Bryant [Fri, 22 Jun 2012 18:36:09 +0000 (14:36 -0400)]
qapi: Convert getfd and closefd

Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: input_type_enum(): fix error message
Luiz Capitulino [Fri, 29 Jun 2012 17:25:01 +0000 (14:25 -0300)]
qapi: input_type_enum(): fix error message

The enum string is pointed to by 'enum_str' not 'name'. This bug
causes the error message to be:

{ "error": { "class": "InvalidParameter",
             "desc": "Invalid parameter 'null'",
             "data": { "name": "null" } } }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
11 years agoqmp: dump-guest-memory: improve schema doc
Luiz Capitulino [Thu, 28 Jun 2012 14:59:15 +0000 (11:59 -0300)]
qmp: dump-guest-memory: improve schema doc

Clarify a few points and makes it looks more like the other commands'
documentation.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agomake: Remove 'build-all' rule
Stefan Weil [Mon, 9 Jul 2012 18:36:36 +0000 (20:36 +0200)]
make: Remove 'build-all' rule

It is not needed, because the 'all' rule does the same.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
11 years agoqemu-keymaps: Finnish keyboard mapping broken
Michael Tokarev [Thu, 12 Jul 2012 11:59:12 +0000 (12:59 +0100)]
qemu-keymaps: Finnish keyboard mapping broken

As mentioned in http://bugs.debian.org/660154 , finnish keyboard mapping
is kind of broken.  Fix it as Timo Sirainen suggests in #660154.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
11 years agovnc: add a more descriptive error message
Amos Kong [Sat, 30 Jun 2012 02:02:20 +0000 (10:02 +0800)]
vnc: add a more descriptive error message

Currently qemu outputs some low-level error in qemu-sockets.c
when failed to start vnc server.
eg. 'getaddrinfo(127.0.0.1,5902): Name or service not known'

Some libvirt users could not know what's happened with this
unclear error message. This patch added a more descriptive
error message.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
11 years agobitops: Fix documentation
Stefan Weil [Sun, 8 Jul 2012 20:31:21 +0000 (22:31 +0200)]
bitops: Fix documentation

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
11 years agomegasas: mark mfi_frame_desc as 'static'
Hannes Reinecke [Wed, 4 Jul 2012 10:02:07 +0000 (12:02 +0200)]
megasas: mark mfi_frame_desc as 'static'

Suggested by blue swirl. Patch is on top of Paolo's
scsi-next tree.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
11 years agoAdd vgabios build rules to roms/Makefile
Gerd Hoffmann [Thu, 9 Feb 2012 09:40:31 +0000 (10:40 +0100)]
Add vgabios build rules to roms/Makefile

This patch adds some glue to roms/Makefile to build vgabios binaries for
qemu.  It covers both the lgpl'ed vgabios implementation used by qemu
traditionally and the new seabios implementation.

The purpose of this patch is to (a) document the vgabios build process
and (b) simplify seavgabios testing for those who want to play with it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoehci: improve expire time calculation
Gerd Hoffmann [Wed, 11 Jul 2012 09:23:17 +0000 (11:23 +0200)]
ehci: improve expire time calculation

Move down the expire time calculation down in the frame timer, to the
point where the timer is actually reloaded.  This way we'll notice any
async_stepdown changes (especially resetting to 0 due to usb activity).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoehci: implement Interrupt Threshold Control support
Gerd Hoffmann [Wed, 11 Jul 2012 09:06:05 +0000 (11:06 +0200)]
ehci: implement Interrupt Threshold Control support

Also reorganize and comment the irq functions while being at it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoehci: raise irq in the frame timer
Gerd Hoffmann [Tue, 10 Jul 2012 16:00:50 +0000 (18:00 +0200)]
ehci: raise irq in the frame timer

With the async schedule being kicked from other places than the frame
timer (commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39) it may happen
that we call ehci_commit_interrupt() more than once per frame.

Move the call from the async schedule handler to the frame timer to
restore old irq behavior, which is more correct.  Fixes regressions
with some linux kernel versions.

TODO: implement full Interrupt Threshold Control support.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouhci: initialize expire_time when loading v1 vmstate
Gerd Hoffmann [Tue, 10 Jul 2012 10:51:07 +0000 (12:51 +0200)]
uhci: initialize expire_time when loading v1 vmstate

$subject says all: when loading old (v1) vmstate which doesn't contain
expire_time initialize it with a reasonable default (current time).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb: add usb attached scsi emulation
Gerd Hoffmann [Fri, 8 Jun 2012 14:03:37 +0000 (16:03 +0200)]
usb: add usb attached scsi emulation

$subject says all.  First cut.

It's a pure UAS (usb attached scsi) emulation, without BOT (bulk-only
transport) compatibility.  If your guest can't handle it use usb-storage
instead.

The emulation works like any other scsi hba emulation (eps, lsi, virtio,
megasas, ...).  It provides just the HBA where you can attach scsi
devices as you like using '-device'.  A single scsi target with up to
256 luns is supported.

For now only usb 2.0 transport is supported.  This will change in the
future though as I plan to use this as playground when codeing up &
testing usb 3.0 transport and streams support in the qemu usb core and
the xhci emulation.

No migration support yet.  I'm planning to add usb 3.0 support first as
this probably requires saving additional state.

Special thanks go to Paolo for bringing the qemu scsi emulation into
shape, so this can be added nicely without having to touch a single line
of scsi code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agotarget-arm: Add support for long format translation table walks
Peter Maydell [Thu, 12 Jul 2012 10:59:12 +0000 (10:59 +0000)]
target-arm: Add support for long format translation table walks

Implement the actual table walk code for LPAE's long format
translation tables.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Implement TTBCR changes for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:11 +0000 (10:59 +0000)]
target-arm: Implement TTBCR changes for LPAE

Implement the changes to the TTBCR register required for LPAE:
 * many fewer bits should be RAZ/WI
 * since TTBCR changes can result in a change of ASID, we must
   flush the TLB on writes to it

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Implement long-descriptor PAR format
Peter Maydell [Thu, 12 Jul 2012 10:59:10 +0000 (10:59 +0000)]
target-arm: Implement long-descriptor PAR format

Implement the different format of the PAR when long descriptor
translation tables are in use. Note that we assume that
get_phys_addr() returns a long-descriptor format DFSR value on
failure if long descriptors are in use; this added subtlety tips
the balance and makes it worth adding a comment documenting the
API to get_phys_addr().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Use target_phys_addr_t in get_phys_addr()
Peter Maydell [Thu, 12 Jul 2012 10:59:09 +0000 (10:59 +0000)]
target-arm: Use target_phys_addr_t in get_phys_addr()

In the implementation of get_phys_addr(), consistently use
target_phys_addr_t to hold the physical address rather than
uint32_t.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:09 +0000 (10:59 +0000)]
target-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE

Under LPAE, the cp15 registers PAR, TTBR0 and TTBR1 are extended
to 64 bits, with a 64 bit (MRRC/MCRR) access path to read the
full width of the register. Add the state fields for the top
half and the 64 bit access path. Actual use of the top half of
the register will come with the addition of the long-descriptor
translation table format support.

For the PAR we also need to correct the masking applied for
32 bit writes (there are no bits reserved if LPAE is implemented)
and clear the high half when doing a 32 bit result VA-to-PA
lookup.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:08 +0000 (10:59 +0000)]
target-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE

LPAE extends the DBGDRAR and DBGDSAR debug registers to 64 bits; we
only implement these as dummy RAZ versions; provide dummies for
the 64 bit accesses as well.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers
Peter Maydell [Thu, 12 Jul 2012 10:59:07 +0000 (10:59 +0000)]
target-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers

Add implementations of the AMAIR0 and AMAIR1 LPAE
Auxiliary Memory Attribute Indirection Registers.
These are implementation defined and we choose to
implement them as RAZ/WI, matching the Cortex-A7
and Cortex-A15.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Extend feature flags to 64 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:06 +0000 (10:59 +0000)]
target-arm: Extend feature flags to 64 bits

Extend feature flags to 64 bits, as we've just run out of space
in the 32 bit integer we were using for them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Implement privileged-execute-never (PXN)
Peter Maydell [Thu, 12 Jul 2012 10:59:05 +0000 (10:59 +0000)]
target-arm: Implement privileged-execute-never (PXN)

Implement the privileged-execute-never (PXN) translation table bit.
It is implementation-defined whether this is implemented, so we give
it its own ARM_FEATURE_ flag. LPAE requires PXN, so add also an
LPAE feature flag and the implication logic, as a placeholder
for actually implementing LPAE at a later date.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agoARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:03 +0000 (10:59 +0000)]
ARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits

Make target_phys_addr_t 64 bits for ARM targets, and set
TARGET_PHYS_ADDR_SPACE_BITS to 40.  This should have no effect for ARM
boards where physical addresses really are 32 bits (except perhaps a
slight performance hit on 32 bit hosts for system emulation) but allows
us to implement the Large Physical Address Extensions for Cortex-A15,
which mean 40 bit physical addresses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agohw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:02 +0000 (10:59 +0000)]
hw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits

Add a missing cast to avoid gcc complaining about format string
errors when printing an expression based on a target_phys_addr_t.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Chubb <peter.chubb@nicta.com.au>
11 years agotarget-arm: Fix TCG temp handling in 64 bit cp writes
Peter Maydell [Thu, 12 Jul 2012 10:59:04 +0000 (10:59 +0000)]
target-arm: Fix TCG temp handling in 64 bit cp writes

Fix errors in the TCG temp handling in the 64 bit coprocessor
write path: we were reusing a 32 bit temp after it had been
freed by store_reg(), and failing to free a 64 bit temp.

This bug has no visible effect at this point because there
aren't any non-NOP 64 bit registers yet; it needs to be fixed
as a prerequisite for the 64 bit registers in LPAE support.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Fix some copy-and-paste errors in cp register names
Peter Maydell [Thu, 12 Jul 2012 10:58:36 +0000 (10:58 +0000)]
target-arm: Fix some copy-and-paste errors in cp register names

Fix a couple of cases where cp register names were copy-and-pasted.
These are harmless since we don't use the name for anything (except
debugging convenience) but could be confusing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
11 years agotarget-arm: Fix typo that meant TTBR1 accesses went to TTBR0
Peter Maydell [Thu, 12 Jul 2012 10:58:36 +0000 (10:58 +0000)]
target-arm: Fix typo that meant TTBR1 accesses went to TTBR0

Fix a copy-and-paste error in the register description for TTBR1
that meant it was a duplicate of TTBR0 rather than affecting the
correct bit of CPU state.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agotarget-arm: Fix CP15 based WFI
Paul Brook [Thu, 12 Jul 2012 10:58:35 +0000 (10:58 +0000)]
target-arm: Fix CP15 based WFI

The coprocessor register rework broke cp15 based WFI instructions.
We incorrectly fall through the normal register write case, which
incorrectly adds a forced block termination.  We've already done
a special version of this (DISAS_WFI), so return immediately.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agoiov: Fix do_send_recv() for MinGW (also fixes a build breakage)
Stefan Weil [Wed, 11 Jul 2012 05:09:05 +0000 (07:09 +0200)]
iov: Fix do_send_recv() for MinGW (also fixes a build breakage)

Commit 25e5e4c7 broke compilation for non POSIX hosts (e.g. MinGW)
because it partially replaced "ret" by "count".

It also changed the handling of EINTR in a wrong way.

The patch restores the old code for these two changes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu_find_file: check name as a straight path even if it has no '/'
Peter Maydell [Fri, 25 May 2012 12:07:01 +0000 (13:07 +0100)]
qemu_find_file: check name as a straight path even if it has no '/'

Make qemu_find_file() check for the passed in name as a straight
pathname even if it doesn't have any path separator character in it.
This means that "-bios foo", "-dtb foo" etc will find a file 'foo'
in the current directory.
This removes an inconsistency with -kernel and -initrd, which both
accept plain filenames as meaning files in the current directory.
It's also less confusing for the user than an undocumented restriction
that "this option accepts a filename, except for the special case
where the filename you pass happens not to have a '/' in it, in
which case we'll ignore it."

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agos390: autodetect map private
Christian Borntraeger [Fri, 15 Jun 2012 05:10:30 +0000 (05:10 +0000)]
s390: autodetect map private

By default qemu will use MAP_PRIVATE for guest pages. This will write
protect pages and thus break on s390 systems that dont support this feature.
Therefore qemu has a hack to always use MAP_SHARED for s390. But MAP_SHARED
has other problems (no dirty pages tracking, a lot more swap overhead etc.)
Newer systems allow the distinction via KVM_CAP_S390_COW. With this feature
qemu can use the standard qemu alloc if available, otherwise it will use
the old s390 hack.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoscsi: add free_request callback
Paolo Bonzini [Mon, 9 Jul 2012 10:06:28 +0000 (12:06 +0200)]
scsi: add free_request callback

Most device models have a simple lifecycle for the hba_private field
and they can free it when a request is completed or cancelled.
However, in some cases it may be simpler to tie the lifetime
of hba_private to that of the included SCSIRequest.  This patch
adds a free_request callback to SCSIBusInfo that lets an HBA
device model do exactly that.

Normally, device models use req->hba_private == NULL to flag requests
that have been completed already.  Device models that use free_request
will still need to track this using a flag.  This is the reason why
"converting" existing HBAs to use free_request adds complexity and
makes little sense.  It is simply an additional convenience that is
provided by the SCSI layer.  USB-attached storage will be the first
user.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agomegasas: disable due to build breakage
Anthony Liguori [Mon, 9 Jul 2012 23:16:16 +0000 (18:16 -0500)]
megasas: disable due to build breakage

The Buildbot has detected a new failure on builder default_i386_rhel61 while
building qemu.

Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/default_i386_rhel61/builds/304

The proper fix is non-trivial so let's disable the build by default until it's
fixed properly.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mjt/mjt-iov2' into staging
Anthony Liguori [Mon, 9 Jul 2012 17:35:06 +0000 (12:35 -0500)]
Merge remote-tracking branch 'mjt/mjt-iov2' into staging

* mjt/mjt-iov2:
  rewrite iov_send_recv() and move it to iov.c
  cleanup qemu_co_sendv(), qemu_co_recvv() and friends
  export iov_send_recv() and use it in iov_send() and iov_recv()
  rename qemu_sendv to iov_send, change proto and move declarations to iov.h
  change qemu_iovec_to_buf() to match other to,from_buf functions
  consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
  allow qemu_iovec_from_buffer() to specify offset from which to start copying
  consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
  rewrite iov_* functions
  change iov_* function prototypes to be more appropriate
  virtio-serial-bus: use correct lengths in control_out() message

Conflicts:
tests/Makefile

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'quintela/migration-anthony-v2' into staging
Anthony Liguori [Mon, 9 Jul 2012 16:57:34 +0000 (11:57 -0500)]
Merge remote-tracking branch 'quintela/migration-anthony-v2' into staging

* quintela/migration-anthony-v2:
  Maintain the number of dirty pages
  dirty bitmap: abstract its use
  Exit loop if we have been there too long
  Only calculate expected_time for stage 2
  Only TCG needs TLB handling
  No need to iterate if we already are over the limit
  Add tracepoints for savevm section start/end
  Add spent time for migration
  Add migration_end function
  Add debugging infrastructure
  Add save_block_hdr function
  Add MigrationParams structure
  Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE

11 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Mon, 9 Jul 2012 16:56:43 +0000 (11:56 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  slirp: Improve error reporting of inaccessible smb directories
  slirp: Ensure smbd and shared directory exist when enable smb
  slirp: add 'cmd:' target for guestfwd
  slirp: Enforce host-side user of smb share

11 years agoslirp: Improve error reporting of inaccessible smb directories
Jan Kiszka [Fri, 6 Jul 2012 06:40:48 +0000 (08:40 +0200)]
slirp: Improve error reporting of inaccessible smb directories

Instead of guessing, print the error code returned by access.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 years agoslirp: Ensure smbd and shared directory exist when enable smb
Dunrong Huang [Fri, 6 Jul 2012 06:04:43 +0000 (14:04 +0800)]
slirp: Ensure smbd and shared directory exist when enable smb

Users may pass the following parameters to qemu:
    $ qemu-kvm -net nic -net user,smb= ...
    $ qemu-kvm -net nic -net user,smb ...
    $ qemu-kvm -net nic -net user,smb=bad_directory ...

In these cases, qemu started successfully while samba server
failed to start. Users will confuse since samba server
failed silently without any indication of what it did wrong.

To avoid it, we check whether the shared directory exist and
if users have permission to access this directory when QEMU's
"built-in" SMB server is enabled.

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 years agoslirp: add 'cmd:' target for guestfwd
Alexander Graf [Sun, 3 Jun 2012 07:45:01 +0000 (09:45 +0200)]
slirp: add 'cmd:' target for guestfwd

When using guestfwd=, Qemu only connects the virtual server's TCP port
to a single chardev. This is useless in most cases, as we usually want
to have more than a single connection from the guest to the outside world.

This patch adds a new cmd: target to guestfwd= that allows for execution
of a command on every TCP connection. This leverages the same code as
the -smb parameter, just that here the command is user defined.

Reported-by: Sascha Wilde <wilde@intevation.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 years agoslirp: Enforce host-side user of smb share
Jan Kiszka [Thu, 5 Jul 2012 17:35:57 +0000 (19:35 +0200)]
slirp: Enforce host-side user of smb share

Windows 7 (and possibly other versions) cannot connect to the samba
share if the exported host directory is not world-readable. This can be
resolved by forcing the username used for access checks to the one
under which QEMU and smbd are running.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 9 Jul 2012 15:29:40 +0000 (10:29 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (24 commits)
  block: Factor bdrv_read_unthrottled() out of guess_disk_lchs()
  qtest: Tidy up temporary files properly
  fdc: Drop broken code for user-defined floppy geometry
  fdc_test: introduce test_sense_interrupt
  fdc_test: update media_change test
  fdc: fix interrupt handling
  fdc: rewrite seek and DSKCHG bit handling
  block: introduce bdrv_swap, implement bdrv_append on top of it
  block: copy over job and dirty bitmap fields in bdrv_append
  raw: hook into blkdebug
  blkdebug: optionally tie errors to a specific sector
  blkdebug: store list of active rules
  blkdebug: pass getlength to underlying file
  blkdebug: tiny cleanup
  blkdebug: remove sync i/o events
  sheepdog: traverse pending_list from the first for each time
  sheepdog: split outstanding list into inflight and pending
  sheepdog: make sure we don't free aiocb before sending all requests
  sheepdog: use coroutine based socket functions in coroutine context
  sheepdog: restart I/O when socket becomes ready in do_co_req()
  ...

11 years agoblock: Factor bdrv_read_unthrottled() out of guess_disk_lchs()
Markus Armbruster [Fri, 29 Jun 2012 15:34:29 +0000 (17:34 +0200)]
block: Factor bdrv_read_unthrottled() out of guess_disk_lchs()

To prepare move of guess_disk_lchs() into hw/, where it poking
BlockDriverState member io_limits_enabled directly would be unclean.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoqtest: Tidy up temporary files properly
Markus Armbruster [Fri, 29 Jun 2012 15:34:27 +0000 (17:34 +0200)]
qtest: Tidy up temporary files properly

Each test litters /tmp with several files: a pid file and two
sockets.  Tidy up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoMerge remote-tracking branch 'kraxel/usb.55' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:33 +0000 (09:51 -0500)]
Merge remote-tracking branch 'kraxel/usb.55' into staging

* kraxel/usb.55:
  usb-host: add trace events for iso xfers
  usb: fix interface initialization
  usb: split endpoint init and reset
  usb-redir: Correctly handle the usb_redir_babble usbredir status
  ehci: Kick async schedule on wakeup in the non companion case
  usb-ehci: Fix an assert whenever isoc transfers are used
  ehci: don't flush cache on doorbell rings.
  ehci: fix td writeback
  ehci: fix ehci_qh_do_overlay

11 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:19 +0000 (09:51 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

* bonzini/scsi-next:
  scsi: Fix transfer length for READ POSITION commands.
  scsi: Add basic support for SCSI media changer commands.
  scsi: Ensure command and transfer lengths are set for all SCSI devices
  scsi: Fix LOAD_UNLOAD
  scsi: Fix data length == SCSI_SENSE_BUF_SIZE
  virtio-scsi: do not crash on adding buffers to the event queue
  megasas: LSI Megaraid SAS HBA emulation
  megasas: Add header file
  ISCSI: force use of sg for SMC and SSC devices
  ISCSI: Add SCSI passthrough via scsi-generic to libiscsi
  scsi-disk: implement READ DISC INFORMATION
  atapi: implement READ DISC INFORMATION
  scsi: add a qdev property for the disk's WWN
  scsi: simplify handling of the VPD page length field

11 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:06 +0000 (09:51 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  configure: Remove help for --disable-vnc-thread, --enable-vnc-thread
  cpu-common.h: Remove a pointless ifndef CONFIG_USER_ONLY
  cpu-common.h: Remove unnecessary guard on including targphys.h

11 years agofdc: Drop broken code for user-defined floppy geometry
Markus Armbruster [Fri, 29 Jun 2012 15:34:23 +0000 (17:34 +0200)]
fdc: Drop broken code for user-defined floppy geometry

bdrv_get_floppy_geometry_hint() fails to store through its parameter
drive when bs has a geometry hint.  Makes fd_revalidate() assign
random crap to drv->drive.

Has been broken that way for ages.  Harmless, because:

* The only way to set a geometry hint is -drive if=none,cyls=...
  Since commit c219331e, probably unintentional.

* The only use of drv->drive is as argument to another
  bdrv_get_floppy_geometry_hint().  Which doesn't use it, since the
  geometry hint is still there.

Drop the broken code, ignore -drive parameter cyls, heads and secs for
floppies even with if=none, just like before commit c219331e.  Matches
-help, which explains cyls, heads, secs as "hard disk physical
geometry".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agofdc_test: introduce test_sense_interrupt
Pavel Hrdina [Wed, 4 Jul 2012 09:18:35 +0000 (11:18 +0200)]
fdc_test: introduce test_sense_interrupt

Calling sense interrupt status while there is no interrupt should
return invalid command (0x80).

Read command should always returns in st0 seek_end bit set to 1.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agofdc_test: update media_change test
Pavel Hrdina [Wed, 4 Jul 2012 14:26:04 +0000 (16:26 +0200)]
fdc_test: update media_change test

After rewrite DSKCHG bit handling the test has to be updated. Now
is needed to seek to different track to clear DSKCHG bit.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agofdc: fix interrupt handling
Pavel Hrdina [Fri, 22 Jun 2012 10:33:55 +0000 (12:33 +0200)]
fdc: fix interrupt handling

If you call the SENSE INTERRUPT STATUS command while there is no interrupt
waiting you get as result unknown command.

Fixed status0 register handling for read/write/format commands.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agofdc: rewrite seek and DSKCHG bit handling
Pavel Hrdina [Fri, 22 Jun 2012 10:33:54 +0000 (12:33 +0200)]
fdc: rewrite seek and DSKCHG bit handling

This bit is cleared on every successful seek to a different track (cylinder).
The seek is also called on revalidate or on read/write/format commands which
also clear the DSKCHG bit.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: introduce bdrv_swap, implement bdrv_append on top of it
Paolo Bonzini [Thu, 14 Jun 2012 14:55:02 +0000 (16:55 +0200)]
block: introduce bdrv_swap, implement bdrv_append on top of it

The new function can be made a bit nicer than bdrv_append.  It swaps the
whole contents, and then swaps back (using the usual t=a;a=b;b=t idiom)
the fields that need to stay on top.  Thus, it does not need explicit
bdrv_detach_dev, bdrv_iostatus_disable, etc.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: copy over job and dirty bitmap fields in bdrv_append
Paolo Bonzini [Thu, 14 Jun 2012 14:55:01 +0000 (16:55 +0200)]
block: copy over job and dirty bitmap fields in bdrv_append

While these should not be in use at the time a transaction is started,
a command in the prepare phase of a transaction might have added them,
so they need to be brought over.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoraw: hook into blkdebug
Paolo Bonzini [Wed, 6 Jun 2012 06:10:44 +0000 (08:10 +0200)]
raw: hook into blkdebug

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblkdebug: optionally tie errors to a specific sector
Paolo Bonzini [Wed, 6 Jun 2012 06:10:43 +0000 (08:10 +0200)]
blkdebug: optionally tie errors to a specific sector

This makes blkdebug scripts more powerful, and independent of the
exact sequence of operations performed by streaming.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblkdebug: store list of active rules
Paolo Bonzini [Wed, 6 Jun 2012 06:10:42 +0000 (08:10 +0200)]
blkdebug: store list of active rules

This prepares for the next patch, where some active rules may actually
not trigger depending on input to readv/writev.  Store the active rules
in a SIMPLEQ (so that it can be emptied easily with QSIMPLEQ_INIT), and
fetch the errno/once/immediately arguments from there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblkdebug: pass getlength to underlying file
Paolo Bonzini [Wed, 6 Jun 2012 06:10:41 +0000 (08:10 +0200)]
blkdebug: pass getlength to underlying file

This is required when using blkdebug with raw format.  Unlike qcow2/QED,
raw asks blkdebug for the length of the file, it doesn't get it from
a header.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblkdebug: tiny cleanup
Paolo Bonzini [Wed, 6 Jun 2012 06:10:40 +0000 (08:10 +0200)]
blkdebug: tiny cleanup

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblkdebug: remove sync i/o events
Paolo Bonzini [Wed, 6 Jun 2012 06:10:39 +0000 (08:10 +0200)]
blkdebug: remove sync i/o events

These are unused, except (by mistake more or less) in QED.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: traverse pending_list from the first for each time
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:23 +0000 (07:26 +0900)]
sheepdog: traverse pending_list from the first for each time

The pending list can be modified in other coroutine context
sd_co_rw_vector, so we need to traverse the list from the first again
after we send the pending request.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: split outstanding list into inflight and pending
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:22 +0000 (07:26 +0900)]
sheepdog: split outstanding list into inflight and pending

outstanding_list_head is used for both pending and inflight requests.
This patch splits it and improves readability.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: make sure we don't free aiocb before sending all requests
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:21 +0000 (07:26 +0900)]
sheepdog: make sure we don't free aiocb before sending all requests

This patch increments the pending counter before sending requests, and
make sures that aiocb is not freed while sending them.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: use coroutine based socket functions in coroutine context
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:20 +0000 (07:26 +0900)]
sheepdog: use coroutine based socket functions in coroutine context

This removes blocking network I/Os in coroutine context.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: restart I/O when socket becomes ready in do_co_req()
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:19 +0000 (07:26 +0900)]
sheepdog: restart I/O when socket becomes ready in do_co_req()

Currently, no one reenters the yielded coroutine.  This fixes it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agosheepdog: fix dprintf format strings
MORITA Kazutaka [Tue, 26 Jun 2012 22:26:18 +0000 (07:26 +0900)]
sheepdog: fix dprintf format strings

This fixes warnings about dprintf format in debug mode.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblockdev: warn when copy_on_read=on and readonly=on
Stefan Hajnoczi [Wed, 27 Jun 2012 17:03:13 +0000 (18:03 +0100)]
blockdev: warn when copy_on_read=on and readonly=on

If the image is read-only then it's not possible to copy read data into
it.  Therefore copy-on-read is automatically disabled for read-only
images.

Up until now this behavior was silent, add a warning so the user knows
why copy-on-read is not working.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>