qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f53a82: nbd: Drop BDS backpointer


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] f53a82: nbd: Drop BDS backpointer
Date: Tue, 24 Feb 2015 06:00:10 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f53a829bb9ef14be800556cbc02d8b20fc1050a7
      
https://github.com/qemu/qemu/commit/f53a829bb9ef14be800556cbc02d8b20fc1050a7
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c
    M include/block/nbd.h
    M nbd.c

  Log Message:
  -----------
  nbd: Drop BDS backpointer

Before this patch, the "opaque" pointer in an NBD BDS points to a
BDRVNBDState, which contains an NbdClientSession object, which in turn
contains a pointer to the BDS. This pointer may become invalid due to
bdrv_swap(), so drop it, and instead pass the BDS directly to the
nbd-client.c functions which then retrieve the NbdClientSession object
from there.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ea82aa42835e3f56b3649c92764ac40552aac789
      
https://github.com/qemu/qemu/commit/ea82aa42835e3f56b3649c92764ac40552aac789
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/qemu-iotests/common.qemu

  Log Message:
  -----------
  iotests: Add "wait" functionality to _cleanup_qemu

The qemu process does not always need to be killed, just waiting for it
can be fine, too. This introduces a way to do so.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 21c7f3f74959f18c5feb9b44511cb1a965c25a36
      
https://github.com/qemu/qemu/commit/21c7f3f74959f18c5feb9b44511cb1a965c25a36
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    A tests/qemu-iotests/094
    A tests/qemu-iotests/094.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: Add test for drive-mirror with NBD target

When the drive-mirror block job is completed, it will call bdrv_swap()
on the source and the target BDS; this should obviously not result in a
segmentation fault.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: af77f2cd7af1fa65a414c86767366bae95892e69
      
https://github.com/qemu/qemu/commit/af77f2cd7af1fa65a414c86767366bae95892e69
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/malloc-pc.c
    M tests/libqos/malloc.c
    M tests/libqos/malloc.h

  Log Message:
  -----------
  libqos: Split apart pc_alloc_init

Move the list-specific initialization over into
malloc.c, to keep all of the list implementation
details within the same file.

The allocation and freeing of these structures are
now both back within the same layer.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 90fc5e097534765f30b11e34cc00aa6c6629e3ea
      
https://github.com/qemu/qemu/commit/90fc5e097534765f30b11e34cc00aa6c6629e3ea
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    A tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: Create ahci.h

Extract defines and other information to ahci.h, to be shared with other
tests if they so please.

At the very least, reduce clutter in the test file itself.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: dd0029c0f44d5121c64a02d3aa0440283fb72fcd
      
https://github.com/qemu/qemu/commit/dd0029c0f44d5121c64a02d3aa0440283fb72fcd
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/Makefile
    M tests/ahci-test.c
    M tests/libqos/ahci.h
    A tests/libqos/libqos.c
    A tests/libqos/libqos.h

  Log Message:
  -----------
  libqos: create libqos.c

The intent of this file is to serve as a misc. utilities file to be
shared amongst tests that are utilizing libqos facilities.

In a later patch, migration test helpers will be added to libqos.c that
will allow simplified testing of migration cases where libqos is
"Just Enough OS" for migrations testing.

The addition of the AHCIQState structure will also allow us to eliminate
global variables inside of qtests to manage allocators and test instances
in a better, more functional way.

libqos.c:
  - Add qtest_boot
  - Add qtest_shutdown

libqos.h:
  - Create QOSState structure for allocator and QTestState.

ahci-test.c:
  - Move qtest_boot and qtest_shutdown to libqos.c/h
  - Create AHCIQState to interface with new qtest_boot/shutdown prototypes
  - Modify tests slightly to use new types.

For now, the new object file is only linked to ahci-test, because it still
relies on pc architecture specific code in libqos. The next two patches will
reorganize the code to be more general.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f1518d1192a1a9387f881919897fbb0101ad3426
      
https://github.com/qemu/qemu/commit/f1518d1192a1a9387f881919897fbb0101ad3426
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/libqos.c
    M tests/libqos/libqos.h

  Log Message:
  -----------
  libqos: add qtest_vboot

Add a va_list variant of the qtest_boot function.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: fa02e6084f727191e15fc6b2d1328c4fae874741
      
https://github.com/qemu/qemu/commit/fa02e6084f727191e15fc6b2d1328c4fae874741
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/malloc-pc.c
    M tests/libqos/malloc.c
    M tests/libqos/malloc.h

  Log Message:
  -----------
  libqos: add alloc_init_flags

Allow a generic interface to alloc_init_flags,
not just through pc_alloc_init_flags.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f6f363c1f4f962aee9f69c67ab2f3ff58c30f8c1
      
https://github.com/qemu/qemu/commit/f6f363c1f4f962aee9f69c67ab2f3ff58c30f8c1
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/malloc-pc.c
    M tests/libqos/malloc.c
    M tests/libqos/malloc.h

  Log Message:
  -----------
  libqos: Update QGuestAllocator to be opaque

To avoid the architecture-specific implementations of the generic qtest
allocator having to know about fields within the allocator, add a
page_size setter method for users or arch specializations to use.
The allocator will assume a default page_size for general use, but it
can always be overridden.

Since this was the last instance of code directly using properties of the
QGuestAllocator object directly, modify the type to be opaque and move
the structure inside of malloc.c.

mlist_new, which was previously exported, is made static local to malloc.c,
as it has no external users.

[Peter Maydell <address@hidden> reported the following clang
warning:
  tests/libqos/malloc.c:35:3: warning:
  redefinition of typedef 'QGuestAllocator' is a C11 feature
  [-Wtypedef-redefinition]
  } QGuestAllocator;

I converted typedef struct ... QGuestAllocator; to struct ...;
--Stefan]

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Marc MarĂ­ <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466
      
https://github.com/qemu/qemu/commit/90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/Makefile
    M tests/ahci-test.c
    A tests/libqos/libqos-pc.c
    A tests/libqos/libqos-pc.h
    M tests/libqos/libqos.c
    M tests/libqos/libqos.h

  Log Message:
  -----------
  libqos: add pc specific interface

Create an operations structure so that the libqos interface can be
architecture agnostic, and create a pc-specific interface to functions
like qtest_boot.

Move the libqos object in the Makefile from being ahci-test only to
being linked with all tests that utilize the libqos features.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6100ddb0f9776555b581455be4707f2077eee42f
      
https://github.com/qemu/qemu/commit/6100ddb0f9776555b581455be4707f2077eee42f
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: Store hba_base in AHCIQState

Store the HBA memory base address in the new state object, to simplify
function prototypes and encourage a more functional testing style.

This causes a lot of churn, but this patch is as "simplified" as I could
get it to be. This patch is therefore fairly mechanical and straightforward:
Any case where we pass "hba_base" has been consolidated into the AHCIQState
object and we pass the one unified parameter.

Any case where we reference "ahci" and "hba_state" have been modified to use
"ahci->dev" for the PCIDevice and "ahci->hba_state" to get at the base memory
address, accordingly.

Notes:

 - A needless return is removed from start_ahci_device.

 - For ease of reviewing, this patch can be reproduced (mostly) by:
   # Replace (ahci, hba_base) prototypes with unified parameter
   's/(QPCIDevice \*ahci, void \*\?\*hba_base/(AHCIQState *ahci/'

   # Replace (ahci->dev, hba_base) calls with unified parameter
   's/(ahci->dev, &\?hba_base)/(ahci)/'

   # Replace calls to PCI config space using "ahci" with "ahci->dev"
   's/qpci_config_\(read\|write\)\(.\)(ahci,/qpci_config_\1\2(ahci->dev,/'

   After these, the remaining differences are easy to review by hand.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 8d5eeceddcb6464c7db3b4504c14766453db091e
      
https://github.com/qemu/qemu/commit/8d5eeceddcb6464c7db3b4504c14766453db091e
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: finalize AHCIQState consolidation

Move barsize, ahci_fingerprint and capabilities registers into
the AHCIQState object, removing global ahci-related state
from the ahci-test.c file.

More churn, less globals.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 7f410456652463db7312bc839d45396bf48a849e
      
https://github.com/qemu/qemu/commit/7f410456652463db7312bc839d45396bf48a849e
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: remove pcibus global

Rely on the PCI Device's bus pointer instead.
One less global to worry about.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c12e8293b8ed29d98f9ef563e997c9de8ff10e23
      
https://github.com/qemu/qemu/commit/c12e8293b8ed29d98f9ef563e997c9de8ff10e23
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: remove guest_malloc global

Make helper routines rely on the earmarked
guest allocator object with AHCIQState/QOSSTate instead.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4882f359493cd02d7a5caa7b85d2e1bc4b2f8177
      
https://github.com/qemu/qemu/commit/4882f359493cd02d7a5caa7b85d2e1bc4b2f8177
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Functional register helpers

Introduce a set of "static inline" register helpers that are intended to
replace the current set of macros with more functional versions that are
better suited to inclusion in libqos than porcelain macros.

As a stopgap measure before eliminating the porcelain macros, define them
to use the new functions defined in the ahci.h header.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1a8bba4ddce44cff33bfd3d4976fb33923c06a1b
      
https://github.com/qemu/qemu/commit/1a8bba4ddce44cff33bfd3d4976fb33923c06a1b
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: remove getter/setter macros

These macros were a bad idea: They relied upon certain arguments being
present locally with a specific name.

With the endgoal being to factor out AHCI helper functions outside of
the test file itself, these have to be replaced by more explicit helper
setter/getter functions.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f3dd2da4cc8c17921cb50920600adafb02959abf
      
https://github.com/qemu/qemu/commit/f3dd2da4cc8c17921cb50920600adafb02959abf
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: Bookmark FB and CLB pointers

Instead of re-querying the AHCI device for the FB and CLB buffers, save
the pointer we gave to the device during initialization and reference
these values instead.

[Peter Maydell <address@hidden> reported the following clang
compiler warnings:

  tests/libqos/ahci.c:256:40: warning: format specifies type 'unsigned
      long' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
  g_test_message("CLB: 0x%08lx", ahci->port[i].clb);
  tests/libqos/ahci.c:264:39: warning: format specifies type 'unsigned
      long' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
  g_test_message("FB: 0x%08lx", ahci->port[i].fb);

The commit moved from uint32_t to uint64_t, so PRIx64 should be used for
the format specifier.
--Stefan]

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 9a75b0a037e3a8030992244353f17b62f6daf2ab
      
https://github.com/qemu/qemu/commit/9a75b0a037e3a8030992244353f17b62f6daf2ab
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/Makefile
    M tests/ahci-test.c
    A tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: create libqos/ahci.c

With global state removed, code responsible for booting up,
verifying, and initializing the AHCI HBA is extracted and
inserted into libqos/ahci.c, which would allow for other
qtests in the future to quickly grab a meaningfully initialized
reference to an AHCI HBA.

Even without other users, functionalizing and isolating the code
assists future AHCI tests that exercise Q35 migration.

For now, libqos/ahci.o will be PC-only, but can be expanded into
something arch-agnostic in the future, if needed.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b0e5d90ebc3edb5cfc1d5d33dd3334482dee6d46
      
https://github.com/qemu/qemu/commit/b0e5d90ebc3edb5cfc1d5d33dd3334482dee6d46
  Author: Cornelia Huck <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M hw/block/dataplane/virtio-blk.c
    M hw/scsi/virtio-scsi-dataplane.c
    M hw/virtio/Makefile.objs
    M hw/virtio/dataplane/Makefile.objs
    M hw/virtio/dataplane/vring.c
    A include/hw/virtio/dataplane/vring-accessors.h
    M include/hw/virtio/dataplane/vring.h

  Log Message:
  -----------
  dataplane: endianness-aware accesses

The vring.c code currently assumes that guest and host endianness match,
which is not true for a number of cases:

- emulating targets with a different endianness than the host
- bi-endian targets, where the correct endianness depends on the virtio
  device
- upcoming support for the virtio-1 standard mandates little-endian
  accesses even for big-endian targets and hosts

Make sure to use accessors that depend on the virtio device.

Note that dataplane now needs to be built per-target.

Cc: Stefan Hajnoczi <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Fam Zheng <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Tested-by: David Gibson <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e77448a385dc72fa671752ec11c84c931f316d09
      
https://github.com/qemu/qemu/commit/e77448a385dc72fa671752ec11c84c931f316d09
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_port_select helper

This helper identifies which port of the
AHCI HBA has a device we may run tests on.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e83fd96bfab90298beaa8c8a31e48a905564180e
      
https://github.com/qemu/qemu/commit/e83fd96bfab90298beaa8c8a31e48a905564180e
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_port_clear helper

Add a helper that assists in clearing out potentially old error and FIS
information from an AHCI port's data structures. This ensures we always
start with a blank slate for interrupt and FIS receipt information.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c7f9c570b908a844aee393d93d01c332aea2a5a5
      
https://github.com/qemu/qemu/commit/c7f9c570b908a844aee393d93d01c332aea2a5a5
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: rename 'Command' to 'CommandHeader'

The structure name is a bit of a misnomer; the structure currently named
command is actually the commandheader. A future patch in this series
will add an actual "Command" structure, so we'll rename it now before the
rest of the functions in this series try to use it.

In addition, rename the "b1" and "b2" fields
to be a unified uint16_t named "flags."

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6cae27a6af159ab44f7c265d7f22d9e95880db25
      
https://github.com/qemu/qemu/commit/6cae27a6af159ab44f7c265d7f22d9e95880db25
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add command header helpers

Adds command header helper functions:
-ahci_command_header_set
-ahci_command_header_get,
-ahci_command_destroy, and
-ahci_cmd_pick

These helpers help to quickly manage the command header information in
the AHCI device.

ahci_command_header_set and get will store or retrieve an AHCI command
header, respectively.

ahci_cmd_pick chooses the first available but least recently used
command slot to allow us to cycle through the available command slots.

ahci_command_destroy obliterates all information contained within a
given slot's command header, and frees its associated command table,
but not its DMA buffer!

Lastly, the command table pointer fields (dba and dbau) are merged into
a single 64bit value to make managing 64bit tests simpler.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 85c34e9395a97e49def6697537417ead2077c096
      
https://github.com/qemu/qemu/commit/85c34e9395a97e49def6697537417ead2077c096
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_port_check_error helper

ahci_port_check_error checks a given port's error registers and asserts
that everything from the port-level view is still OK.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5bf99aa1cf67a210dd441ae4edf1e26df05360d5
      
https://github.com/qemu/qemu/commit/5bf99aa1cf67a210dd441ae4edf1e26df05360d5
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_port_check_interrupts helper

A helper that compares a given port's current interrupts and checks them
against a supplied list of expected interrupt bits, and throws an error
if they do not match.

The helper then resets the requested interrupts on this port, and asserts
that the interrupt register is now empty.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 89a46723668a35db3eac5cb59b32ba67948dee0d
      
https://github.com/qemu/qemu/commit/89a46723668a35db3eac5cb59b32ba67948dee0d
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add port_check_nonbusy helper

A simple helper that asserts a given port is not busy processing any
commands via the TFD, Command Issue and SACT registers.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d1ef883894f0661f9994bc937ba09077a32a8bee
      
https://github.com/qemu/qemu/commit/d1ef883894f0661f9994bc937ba09077a32a8bee
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add cmd response sanity check helpers

This patch adds a few helpers to help sanity-check the response of the
AHCI device after a command.

ahci_d2h_check_sanity inspects the D2H Register FIS,
ahci_pio_check_sanity inspects the PIO Setup FIS, and
ahci_cmd_check_sanity inspects the command header.

To support the PIO sanity check, a new structure is added for the
PIO Setup FIS type. Existing FIS types (H2D and D2H) have had their
members renamed slightly to condense reserved members into fewer
fields; and LBA fields are now represented by arrays of 8 byte chunks
instead of independent variables.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 36e367261c15f0fa9acfbe9f4301c96e19be7f52
      
https://github.com/qemu/qemu/commit/36e367261c15f0fa9acfbe9f4301c96e19be7f52
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: Demagic ahci tests.

Add human-readable command names and other miscellaneous #defines
to help make the code more readable.

Some of these definitions are not yet used in this current series,
but for convenience and sanity they have been lumped together here,
as it's more trouble than it is worth in a test suite to hand-pick,
one-by-one, which preprocessor definitions are useful per-each test.

These definitions include:

ATA Command Mnemonics
Current expected AHCI sector size
FIS magic bytes
REG_H2D_FIS flags
Command Header flags

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 52515766f1e18b596a6dc31421ca14a63114c9eb
      
https://github.com/qemu/qemu/commit/52515766f1e18b596a6dc31421ca14a63114c9eb
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  qtest/ahci: add ahci_write_fis

Similar to ahci_set_command_header, add a helper that takes an
in-memory representation of a command FIS and writes it to guest
memory, handling endianness as-needed.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 716b64079ceaa6fede724f8a24a24b0209fa5173
      
https://github.com/qemu/qemu/commit/716b64079ceaa6fede724f8a24a24b0209fa5173
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/ahci.c

  Log Message:
  -----------
  libqos/ahci: Add ide cmd properties

Add a structure that defines some properties of various IDE commands.
These will be used to simplify the interface to the libqos AHCI calls,
lessening the redundancy of specifying and respecifying properties of
commands to various helper functions.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 64a5a272e31c99cfb348f908d71c98d2eb83ba28
      
https://github.com/qemu/qemu/commit/64a5a272e31c99cfb348f908d71c98d2eb83ba28
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: add ahci command functions

This patch adds the AHCICommand structure, and a set of functions to
operate on the structure.

ahci_command_create - Initialize and create a new AHCICommand in memory
ahci_command_free - Destroy this object.
ahci_command_set_buffer - Set where the guest memory DMA buffer is.
ahci_command_commit - Write this command to the AHCI HBA.
ahci_command_issue - Issue the committed command synchronously.
ahci_command_issue_async - Issue the committed command asynchronously.
ahci_command_wait - Wait for an asynchronous command to finish.
ahci_command_slot - Get the number of the command slot we committed to.

Helpers:
size_to_prdtl       - Calculate the required minimum PRDTL size from
                a buffer size.
ahci_command_find   - Given an ATA command mnemonic, look it up in the
                properties table to obtain info about the command.
command_header_init - Initialize the command header with sane values.
command_table_init  - Initialize the command table with sane values.

[Peter Maydell <address@hidden> reported the following clang
warning:

  tests/libqos/ahci.c:598:3: warning: redefinition
  of typedef 'AHCICommand' is a C11 feature
      [-Wtypedef-redefinition]
  } AHCICommand;

I have replaced typedef struct ... AHCICommand; with struct ... ;
--Stefan]

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ea41deb6022c1468de094dac12610de74220e4b0
      
https://github.com/qemu/qemu/commit/ea41deb6022c1468de094dac12610de74220e4b0
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: add ahci command verify

Helps to verify that a command completed successfully.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: cbc97569dcce317f7bb32d766d4dfcbeb7fd3013
      
https://github.com/qemu/qemu/commit/cbc97569dcce317f7bb32d766d4dfcbeb7fd3013
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: add ahci command size setters

Adds setters for size, prd_size and both via set_sizes.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 113221956cb819837dda5350e3f9d52819183805
      
https://github.com/qemu/qemu/commit/113221956cb819837dda5350e3f9d52819183805
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_guest_io

ahci_guest_io is a shorthand function that will, in one shot,
execute a data command on the guest to the specified guest buffer
location, in the requested amount.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ae029620173239f3643925299790ecc5e1d72db1
      
https://github.com/qemu/qemu/commit/ae029620173239f3643925299790ecc5e1d72db1
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h

  Log Message:
  -----------
  libqos/ahci: add ahci_io

ahci_io is a wrapper around ahci_guest_io that takes a pointer to host
memory instead, and will create a guest memory buffer and copy the data
to/from as needed and as appropriate for a read/write command, such that
after a read, the guest data will be in a host buffer, and for a write,
the data will be transmitted to guest memory prior to the block operation.

Now that we have all the syntactic sugar functions in place for AHCI,
we can convert the identify test to be very, very short.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 259342d34dbdfb304374f569feec26317edd97c9
      
https://github.com/qemu/qemu/commit/259342d34dbdfb304374f569feec26317edd97c9
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c
    M tests/libqos/ahci.c
    M tests/libqos/ahci.h
    M tests/libqos/malloc.c
    M tests/libqos/malloc.h

  Log Message:
  -----------
  libqos/ahci: Add ahci_clean_mem

Clean up guest memory being used in ahci_clean_mem, to be
called during ahci_shutdown. With all guest memory leaks removed,
add an option to the allocator to throw an assertion if a leak
occurs.

This test adds some sanity to both the AHCI library and the
allocator.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 122482a398db9f02287efce9eec26e08dac82bcd
      
https://github.com/qemu/qemu/commit/122482a398db9f02287efce9eec26e08dac82bcd
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: Assert sector size in identify test

A minor sanity check to assert that the sector size is 512.
The current block layer code deeply assumes that the IDE
sector size will be 512 bytes, so we carry forward that assumption
here.

This is useful for the DMA tests, which currently assume that
a sector will always be 512 bytes.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 81705ee4850b55ef4879c941e4a7703efd3cb760
      
https://github.com/qemu/qemu/commit/81705ee4850b55ef4879c941e4a7703efd3cb760
  Author: John Snow <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/ahci-test.c

  Log Message:
  -----------
  qtest/ahci: Adding simple dma read-write test

Adds a test case for AHCI wherein we write a 4K
block of a changing pattern to sector 0, then
read back that 4K and compare the transmit and
receive buffers.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 141cabe6f144a1acb128186caf686f8fbde0a7e4
      
https://github.com/qemu/qemu/commit/141cabe6f144a1acb128186caf686f8fbde0a7e4
  Author: Bin Wu <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  nbd: fix the co_queue multi-adding bug

When we tested the VM migartion between different hosts with NBD
devices, we found if we sent a cancel command after the drive_mirror
was just started, a coroutine re-enter error would occur. The stack
was as follow:

(gdb) bt
00)  0x00007fdfc744d885 in raise () from /lib64/libc.so.6
01)  0x00007fdfc744ee61 in abort () from /lib64/libc.so.6
02)  0x00007fdfca467cc5 in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
at qemu-coroutine.c:118
03)  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedb400) at
qemu-coroutine-lock.c:59
04)  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
to=0x7fdfcaedb400) at qemu-coroutine.c:96
05)  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
at qemu-coroutine.c:123
06)  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedbdc0) at
qemu-coroutine-lock.c:59
07)  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
to=0x7fdfcaedbdc0) at qemu-coroutine.c:96
08)  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedbdc0, opaque=0x0)
at qemu-coroutine.c:123
09)  0x00007fdfca4a1fa4 in nbd_recv_coroutines_enter_all (s=0x7fdfcaef7dd0) at
block/nbd-client.c:41
10) 0x00007fdfca4a1ff9 in nbd_teardown_connection (client=0x7fdfcaef7dd0) at
block/nbd-client.c:50
11) 0x00007fdfca4a20f0 in nbd_reply_ready (opaque=0x7fdfcaef7dd0) at
block/nbd-client.c:92
12) 0x00007fdfca45ed80 in aio_dispatch (ctx=0x7fdfcae15e90) at aio-posix.c:144
13) 0x00007fdfca45ef1b in aio_poll (ctx=0x7fdfcae15e90, blocking=false) at
aio-posix.c:222
14) 0x00007fdfca448c34 in aio_ctx_dispatch (source=0x7fdfcae15e90, callback=0x0,
user_data=0x0) at async.c:212
15) 0x00007fdfc8f2f69a in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
16) 0x00007fdfca45c391 in glib_pollfds_poll () at main-loop.c:190
17) 0x00007fdfca45c489 in os_host_main_loop_wait (timeout=1483677098) at
main-loop.c:235
18) 0x00007fdfca45c57b in main_loop_wait (nonblocking=0) at main-loop.c:484
19) 0x00007fdfca25f403 in main_loop () at vl.c:2249
20) 0x00007fdfca266fc2 in main (argc=42, argv=0x7ffff517d638,
envp=0x7ffff517d790) at vl.c:4814

We find the nbd_recv_coroutines_enter_all function (triggered by a cancel
command or a network connection breaking down) will enter a coroutine which
is waiting for the sending lock. If the lock is still held by another coroutine,
the entering coroutine will be added into the co_queue again. Latter, when the
lock is released, a coroutine re-enter error will occur.

This bug can be fixed simply by delaying the setting of recv_coroutine as
suggested by paolo. After applying this patch, we have tested the cancel
operation in mirror phase looply for more than 5 hous and everything is fine.
Without this patch, a coroutine re-enter error will occur in 5 minutes.

Signed-off-by: Bn Wu <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5d80448c3fc566e505adfa2b566ec8074442c8e1
      
https://github.com/qemu/qemu/commit/5d80448c3fc566e505adfa2b566ec8074442c8e1
  Author: Kevin Wolf <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M savevm.c

  Log Message:
  -----------
  savevm: Improve error message for blocked migration

If an internal snapshot can't be saved because migration is blocked
(most commonly probably because of AHCI), we had a really bad error
message:

$ echo -e "savevm foo\nquit" | qemu -M q35 /tmp/test.qcow2 -monitor stdio
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) savevm foo
Error -22 while writing VM
(qemu) quit

This patch converts qemu_savevm_state() to the Error infrastructure so
that a useful error pointing to the problematic device is produced now:

$ echo -e "savevm foo\nquit" | qemu -M q35 /tmp/test.qcow2 -monitor stdio
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) savevm foo
State blocked by non-migratable device '0000:00:1f.2/ich9_ahci'
(qemu) quit

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a7be17bee855f26c317e99aa6582e1dc9b8ebd71
      
https://github.com/qemu/qemu/commit/a7be17bee855f26c317e99aa6582e1dc9b8ebd71
  Author: Jeff Cody <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  block: vmdk - fixed sizeof() error

The size compared should be PATH_MAX, rather than sizeof(char *).

Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: efef88b3d9ad4325172ed288032807fa88d683cc
      
https://github.com/qemu/qemu/commit/efef88b3d9ad4325172ed288032807fa88d683cc
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M cpus.c

  Log Message:
  -----------
  qtest: Fix deadloop by running main loop AIO context's timers

qemu_clock_run_timers() only takes care of main_loop_tlg, we shouldn't
forget aio timer list groups.

Currently, the qemu_clock_deadline_ns_all (a few lines above) counts all
the timergroups of this clock type, including aio tlg, but we don't fire
them, so they are never cleared, which makes a dead loop.

For example, this function hangs when trying to drive throttled block
request queue with qtest clock_step.

Signed-off-by: Fam Zheng <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a91f9584565901635295b08f98d5f3048981c2f5
      
https://github.com/qemu/qemu/commit/a91f9584565901635295b08f98d5f3048981c2f5
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io: Account IO by aio_read and aio_write

This will enable accounting of aio requests issued from qemu-io aio
read/write commands.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a628daa42db50a3fc1203dd81bba5a2879b76656
      
https://github.com/qemu/qemu/commit/a628daa42db50a3fc1203dd81bba5a2879b76656
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    A scripts/qtest.py

  Log Message:
  -----------
  qtest: Add scripts/qtest.py

This adds scripts/qtest.py as a python library for qtest protocol.

This is a skeleton with a basic "cmd" method to execute a command,
reading and parsing of qtest output could be added later on demand.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ed338bb07504091dbf36d9cc741e8363f1962a74
      
https://github.com/qemu/qemu/commit/ed338bb07504091dbf36d9cc741e8363f1962a74
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Add VM method qtest() to iotests.py

This will allow test cases to run command in qtest protocol. It's
write-only for now.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: df89d112279779609d50db93b024ed71f0402854
      
https://github.com/qemu/qemu/commit/df89d112279779609d50db93b024ed71f0402854
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Allow caller to disable underscore convertion for qmp

QMP command "block_set_io_throttle" expects underscores in parameters
instead of dashes: {iops,bps}_{rd,wr,max}.

Add optional argument conv_keys (defaults to True, backward compatible),
it will be used in IO throttling test case.

Reviewed-by: Benoit Canet <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: fb13bbf2fd5292d0aab617709017a4032f328730
      
https://github.com/qemu/qemu/commit/fb13bbf2fd5292d0aab617709017a4032f328730
  Author: Fam Zheng <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    A tests/qemu-iotests/093
    A tests/qemu-iotests/093.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  qemu-iotests: Add 093 for IO throttling

This case utilizes qemu-io command "aio_{read,write} -q" to verify the
effectiveness of IO throttling options.

It's implemented by driving the vm timer from qtest protocol, so the
throttling timers are signaled with determinied time duration. Then we
verify the completed IO requests are within 10% error of bps and iops
limits.

"null" protocol is used as the disk backend so that no actual disk IO is
performed on host, this will make the blockstats much more
deterministic. Both "null-aio" and "null-co" are covered, which is also
a simple cross validation test for the driver code.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 2e024cde1f632d7098f5da742e54186156c6aca9
      
https://github.com/qemu/qemu/commit/2e024cde1f632d7098f5da742e54186156c6aca9
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Fix qemu-img convert -n

If -n is specified, it does not matter whether the output format and
protocol support image creation; building the creation options should
simply be skipped.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 723bfab5cb229436ab31498a19aed931723cd3be
      
https://github.com/qemu/qemu/commit/723bfab5cb229436ab31498a19aed931723cd3be
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    A tests/qemu-iotests/123
    A tests/qemu-iotests/123.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: Add test for qemu-img convert to NBD

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1ef01253eb90d0c69129c817e85fa92f9d45602a
      
https://github.com/qemu/qemu/commit/1ef01253eb90d0c69129c817e85fa92f9d45602a
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block: Lift some BDS functions to the BlockBackend

Create the blk_* counterparts for the following bdrv_* functions (which
make sense to call on the BlockBackend level):
- bdrv_co_write_zeroes()
- bdrv_write_compressed()
- bdrv_truncate()
- bdrv_nb_sectors()
- bdrv_discard()
- bdrv_load_vmstate()
- bdrv_save_vmstate()

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ca49a4fdb39d7b00b20e8500cba11aedc87755bd
      
https://github.com/qemu/qemu/commit/ca49a4fdb39d7b00b20e8500cba11aedc87755bd
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block: Add blk_new_open()

blk_new_with_bs() creates a BlockBackend with an empty BlockDriverState
attached to it. Empty BDSs are not nice, therefore add an alternative
function which combines blk_new_with_bs() with bdrv_open().

Note: In contrast to bdrv_open() which takes a BlockDriver parameter,
blk_new_open() does not take such a parameter. This is because
bdrv_open() opens a BlockDriverState, therefore it is natural to be able
to set the BlockDriver for that BDS. The fact that bdrv_open() can open
more than a single BDS is merely some form of a byproduct.

blk_new_open() on the other hand is intended to be used to create a
whole tree of BlockDriverStates. Therefore, setting a single BlockDriver
does not make much sense. Instead, the drivers to be used for each of
the nodes must be configured through the "options" QDict; including the
driver of the root BDS.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b65a5e12a4136b20f9d06675d597b52d64ac903c
      
https://github.com/qemu/qemu/commit/b65a5e12a4136b20f9d06675d597b52d64ac903c
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block.c
    M block/sheepdog.c
    M include/block/block.h
    M qemu-img.c
    M tests/qemu-iotests/051.out

  Log Message:
  -----------
  block: Add Error parameter to bdrv_find_protocol()

The argument given to bdrv_find_protocol() is just a file name, which
makes it difficult for the caller to reconstruct what protocol
bdrv_find_protocol() was hoping to find. This patch adds an Error
parameter to that function to solve this issue.

Suggested-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 80495fdf44ff7e44bafe9f4d8367700a197f1106
      
https://github.com/qemu/qemu/commit/80495fdf44ff7e44bafe9f4d8367700a197f1106
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.out

  Log Message:
  -----------
  iotests: Add test for driver=qcow2, format=qcow2

While specifying a different driver and format is obviously invalid,
specifying the same driver once through driver and once through format
is invalid as well. Add a test for it.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e4342ce5a2bc7742c7193d1a3291ae513ca4857a
      
https://github.com/qemu/qemu/commit/e4342ce5a2bc7742c7193d1a3291ae513ca4857a
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M blockdev.c
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/087.out

  Log Message:
  -----------
  blockdev: Use blk_new_open() in blockdev_init()

Due to different error propagation, this breaks tests 051 and 087; fix
their output.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 9a925356e3a109c412240721890c1e6c1a86d286
      
https://github.com/qemu/qemu/commit/9a925356e3a109c412240721890c1e6c1a86d286
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M hw/block/xen_disk.c

  Log Message:
  -----------
  block/xen: Use blk_new_open() in blk_connect()

As part of the required changes, this fixes a bug where specifying an
invalid driver would result in the block layer probing the image format;
now it will result in an error, unless "<unset>" is specified as the
driver name. Fixing this would require further work on the xen_disk code
which does not seem worth it (at this point and for this patch).

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5bd313266bc5874dae9833be95e5dcfce787f1b7
      
https://github.com/qemu/qemu/commit/5bd313266bc5874dae9833be95e5dcfce787f1b7
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Use blk_new_open() in img_open()

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 644483d97e6f7a740b5a82156fe32944573a0ed1
      
https://github.com/qemu/qemu/commit/644483d97e6f7a740b5a82156fe32944573a0ed1
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Use blk_new_open() in img_rebase()

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f1d3cd792b93a7f4446517213b02c6f050a47e9d
      
https://github.com/qemu/qemu/commit/f1d3cd792b93a7f4446517213b02c6f050a47e9d
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Use BlockBackend as far as possible

Although qemu-img already creates BlockBackends, it does not do accesses
to the images through them. This patch converts all of the bdrv_* calls
for which this is currently possible to blk_* calls. Most of the
remaining calls will probably stay bdrv_* calls because they really do
operate on the BDS level instead of the BB level.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4fbec260aec4cda50f399377b18c844113751146
      
https://github.com/qemu/qemu/commit/4fbec260aec4cda50f399377b18c844113751146
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-nbd.c

  Log Message:
  -----------
  qemu-nbd: Use blk_new_open() in main()

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1b58b43802a0158d74f4ea7e52f852363e63fe2f
      
https://github.com/qemu/qemu/commit/1b58b43802a0158d74f4ea7e52f852363e63fe2f
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: Use blk_new_open() in openfile()

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 10d9d75ce4cfb568b4845d8c4d0e65968f740edf
      
https://github.com/qemu/qemu/commit/10d9d75ce4cfb568b4845d8c4d0e65968f740edf
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M qemu-io.c
    R tests/qemu-iotests/016
    R tests/qemu-iotests/016.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  qemu-io: Remove "growable" option

Remove "growable" option from the "open" command and from the qemu-io
command line. qemu-io is about to be converted to BlockBackend which
will make sure that no request exceeds the image size, so the only way
to keep "growable" would be to use BlockBackend if it is not given and
to directly access the BDS if it is.

qemu-io is a debugging tool, therefore removing a rarely used option
will have only a very small impact, if any. There was only one
qemu-iotest which used the option; since it is not critical, this patch
just removes it.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4c7b7e9b94b4e81aa85de7c13e209017fc7f61dc
      
https://github.com/qemu/qemu/commit/4c7b7e9b94b4e81aa85de7c13e209017fc7f61dc
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M hmp.c
    M include/qemu-io.h
    M qemu-io-cmds.c
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: Use BlockBackend

qemu-io should behave like a guest, therefore it should use BlockBackend
to access the block layer.

There are a couple of places where that is infeasible: First, the
bdrv_debug_* functions could theoretically be mirrored in the
BlockBackend, but since these are functions internal to the block layer,
they should not be visible externally (qemu-io as a test tool is exempt
from this).

Second, bdrv_get_info() and bdrv_get_specific_info() work on a single
BDS alone, therefore they should stay BDS-specific.

Third, bdrv_is_allocated() mainly works on a single BDS as well. Some
data may be passed through from the BDS's file (if sectors which are
apparently allocated in the file are not really allocated there but just
zero).

[Fixed conflicts around block_acct_start() usage from Fam Zheng's
"qemu-io: Account IO by aio_read and aio_write" commit.  Use
BlockBackend and blk_get_stats() instead of BlockDriverState.
--Stefan]

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e7f7d676c1397291ef7d2892f86045d79ee1a1ec
      
https://github.com/qemu/qemu/commit/e7f7d676c1397291ef7d2892f86045d79ee1a1ec
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block: Clamp BlockBackend requests

BlockBackend is used as the interface between the block layer and guest
devices. It should therefore assure that all requests are clamped to the
image size.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: c0191e763b2f77cc5311d3aa6e487f3fe8a4c96f
      
https://github.com/qemu/qemu/commit/c0191e763b2f77cc5311d3aa6e487f3fe8a4c96f
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block.c
    M block/qcow2.c
    M block/raw-posix.c
    M block/raw-win32.c
    M block/sheepdog.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Remove "growable" from BDS

Now that request clamping is done in the BlockBackend, the "growable"
field can be removed from the BlockDriverState. All BDSs are now treated
as being "growable" (that is, they are allowed to grow; they are not
necessarily actually able to).

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b9c649470ba0d4056b2d486105a0f8fb982654ae
      
https://github.com/qemu/qemu/commit/b9c649470ba0d4056b2d486105a0f8fb982654ae
  Author: Max Reitz <address@hidden>
  Date:   2015-02-16 (Mon, 16 Feb 2015)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Keep bdrv_check*_request()'s return value

Do not throw away the value returned by bdrv_check_request() and
bdrv_check_byte_request().

Fix up some coding style issues in the proximity of the affected hunks.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3dc10613c313a042a111e46a977733411495ea8c
      
https://github.com/qemu/qemu/commit/3dc10613c313a042a111e46a977733411495ea8c
  Author: Peter Maydell <address@hidden>
  Date:   2015-02-24 (Tue, 24 Feb 2015)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c
    M block/qcow2.c
    M block/raw-posix.c
    M block/raw-win32.c
    M block/sheepdog.c
    M block/vmdk.c
    M blockdev.c
    M cpus.c
    M hmp.c
    M hw/block/dataplane/virtio-blk.c
    M hw/block/xen_disk.c
    M hw/scsi/virtio-scsi-dataplane.c
    M hw/virtio/Makefile.objs
    M hw/virtio/dataplane/Makefile.objs
    M hw/virtio/dataplane/vring.c
    M include/block/block.h
    M include/block/block_int.h
    M include/block/nbd.h
    A include/hw/virtio/dataplane/vring-accessors.h
    M include/hw/virtio/dataplane/vring.h
    M include/qemu-io.h
    M include/sysemu/block-backend.h
    M nbd.c
    M qemu-img.c
    M qemu-io-cmds.c
    M qemu-io.c
    M qemu-nbd.c
    M savevm.c
    A scripts/qtest.py
    M tests/Makefile
    M tests/ahci-test.c
    A tests/libqos/ahci.c
    A tests/libqos/ahci.h
    A tests/libqos/libqos-pc.c
    A tests/libqos/libqos-pc.h
    A tests/libqos/libqos.c
    A tests/libqos/libqos.h
    M tests/libqos/malloc-pc.c
    M tests/libqos/malloc.c
    M tests/libqos/malloc.h
    R tests/qemu-iotests/016
    R tests/qemu-iotests/016.out
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/087.out
    A tests/qemu-iotests/093
    A tests/qemu-iotests/093.out
    A tests/qemu-iotests/094
    A tests/qemu-iotests/094.out
    A tests/qemu-iotests/123
    A tests/qemu-iotests/123.out
    M tests/qemu-iotests/common.qemu
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

Pull request

v2:
 * Fix C11 typedef redefinitions in ahci and libqos malloc [Peter]
 * Fix lx -> PRIx64 format specifiers in ahci [Peter]

# gpg: Signature made Mon Feb 16 15:45:53 2015 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/block-pull-request: (65 commits)
  block: Keep bdrv_check*_request()'s return value
  block: Remove "growable" from BDS
  block: Clamp BlockBackend requests
  qemu-io: Use BlockBackend
  qemu-io: Remove "growable" option
  qemu-io: Use blk_new_open() in openfile()
  qemu-nbd: Use blk_new_open() in main()
  qemu-img: Use BlockBackend as far as possible
  qemu-img: Use blk_new_open() in img_rebase()
  qemu-img: Use blk_new_open() in img_open()
  block/xen: Use blk_new_open() in blk_connect()
  blockdev: Use blk_new_open() in blockdev_init()
  iotests: Add test for driver=qcow2, format=qcow2
  block: Add Error parameter to bdrv_find_protocol()
  block: Add blk_new_open()
  block: Lift some BDS functions to the BlockBackend
  iotests: Add test for qemu-img convert to NBD
  qemu-img: Fix qemu-img convert -n
  qemu-iotests: Add 093 for IO throttling
  qemu-iotests: Allow caller to disable underscore convertion for qmp
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/3dd2d1a33976...3dc10613c313

reply via email to

[Prev in Thread] Current Thread [Next in Thread]