Commit Graph

1789 Commits

Author SHA1 Message Date
Andreas Färber b5e62af8aa tests: Fix check-report-qtest-% target
Commit e253c28 ("tests: Fix how qom-test is run") introduced
$(qtest-generic-y) and used it for check-qtest-% target, but did not
update check-report-qtest-%. This causes check-report-qtest-aarch64.xml
target to fail with a gtester usage error for lack of test arguments.

Fix this by adding $(qtest-generic-y) in check-report-qtest-%.
Also add it in check-clean target, spotted by Markus.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-12-03 20:07:05 +01:00
Peter Maydell efdeb96c5a -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQEcBAABAgAGBQJWX8xEAAoJEJykq7OBq3PIY+YH/0fhpy2S0G2LtfjYX3522Q81
 3SsIC+4934+SkGLkQflnNsy8HPKvqQndkV+5FEqbzUTwJ1kjixyKapfpLyA0tvbm
 +uxvC1Mn91nVfqlfh3zwGOqprcEwPvXtfIyeOlfeq+6m72fDLWUakIwzAfNGWeV8
 REc3j2yTEw2esRPKau5kP1q3taN7w6UvIx9I8g1/cbnq89ca0ici/+AhBz/XGGb1
 gTlxtBoVWfH+k0kO2rqhZt+RLi7u22cmtPOywOTuqIt3HEYgFdaaf6S0UcZ+mgno
 CNf0hhbHuMhBCgWvXcGXDssFrI2GoSl8hEuTBbLHyOSFSHZ8pfRLFmoFuZzXW0c=
 =TtA6
 -----END PGP SIGNATURE-----

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

# gpg: Signature made Thu 03 Dec 2015 04:59:48 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"

* remotes/stefanha/tags/block-pull-request:
  iotests: Add regresion test case for write notifier assertion failure
  iotests: Add "add_drive_raw" method
  block: Don't wait serialising for non-COR read requests
  iothread: include id in thread name

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-12-03 11:08:43 +00:00
Fam Zheng 9cc0f19de2 iotests: Add regresion test case for write notifier assertion failure
The idea is to let the top level bs have a big request alignment with
blkdebug, so that the aio_write request issued from monitor will be
serialised. This tests that QEMU doesn't crash upon the read request
from the backup job's write notifier, which is a very special case of
"reentrant" request.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1448962590-2842-4-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-12-03 11:08:07 +08:00
Fam Zheng 78b666f46b iotests: Add "add_drive_raw" method
This offers full manual control over the "-drive" options.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1448962590-2842-3-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-12-03 11:08:07 +08:00
Victor Kaplansky 6d0b908a62 tests/vhost-user-bridge.c: fix fd leakage
This fixes file descriptor leakage in vhost-user-bridge
application. Whenever a new callfd or kickfd is set, the previous
one should be explicitly closed. File descriptors used to map
guest's memory are closed immediately after mmap call.

Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-02 19:27:26 +02:00
Marc-André Lureau 45ce512670 vhost-user-test: fix crash with glib < 2.36
The prepare callback needs to be implemented with glib < 2.36,
quoting glib documentation:
"Since 2.36 this may be NULL, in which case the effect is as if the
function always returns FALSE with a timeout of -1."

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-02 16:42:26 +02:00
Marc-André Lureau a899b1ea2a vhost-user-test: use unix port for migration
TCP port 1234 may be used by another process concurrently. Instead use a
temporary unix socket.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-02 16:42:26 +02:00
Marc-André Lureau 9732baf678 vhost-user-test: fix chardriver race
vhost-user-tests uses a helper thread to dispatch the vhost-user servers
sources. However the CharDriverState is not thread-safe. Therefore, when
it's given to the thread, it shouldn't be manipulated concurrently.

We dispatch cleaning the server in an idle source. By the end of the
test, we ensure not to leave anything behind by joining the thread and
finishing the sources dispatch.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-02 16:42:26 +02:00
Peter Maydell 72f75c76d8 vhost, pc: fixes for 2.5
Minor vhost fixes.  HW version tweak for PC.
 Documentation and test updates.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWVzX5AAoJECgfDbjSjVRp3UUH/jmankS57MaFIfB2plhrFlk0
 BAjMLhJ6GCLrDEAaMaes9wJXJJMQHfoZnwAqkfkvjabKbiq6yPZz2FIfjSKuV86Z
 F6XNuMxiM2qwt/HJ5IaBX0c0Bm9bsF3zQpVAs082KfLvTrmOf8SHk4b8OFOCJMvu
 asSl9J8DTo3LZwC1TNpbxvTj5k3OFhB8i16WT3lvdLv9QUxBwdUaG6WxUCZD/35C
 CJnjut7n09ZbG4dfVxAVl7KubX1llpNBopbTQEyoHaaVfOvFDL5R2Gf7/YG9G0+x
 aI4+rMmRt0KCTii7xjN63j88+YpGlTgrAZETzwxVolZGMOe74jGtCNQqlIBwPZI=
 =I1ki
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

vhost, pc: fixes for 2.5

Minor vhost fixes.  HW version tweak for PC.
Documentation and test updates.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Thu 26 Nov 2015 16:40:25 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream:
  vhost-user-test: fix migration overlap test
  Fix memory leak on error
  Revert "vhost: send SET_VRING_ENABLE at start/stop"
  tests/vhost-user-bridge: read command line arguments
  tests/vhost-user-bridge: propose GUEST_ANNOUNCE feature
  vhost-user: clarify start and enable
  vhost-user: set link down when the char device is closed
  pc: Don't set hw_version on pc-*-2.5
  osdep: Change default value of qemu_hw_version() to "2.5+"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26 16:50:59 +00:00
Michael S. Tsirkin d08e42a112 vhost-user-test: fix migration overlap test
During migration, source does GET_BASE, destination does SET_BASE.
Use that as opposed to fds being configured to detect
vhost user running on both source and destination.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-26 18:39:34 +02:00
Peter Maydell a5df35070a QMP and QObject patches
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWVsvGAAoJEDhwtADrkYZTtnwP+wcrBt/uqw3Q0k5OC4vwDa6z
 OYd8KVK60PozjbRDkiaZE7Iqu9eo47rbRCfTyta7/QFP49/ERVja7+QcFO4681Sj
 ELFQKCztU39lu8kNm4/+WYRdcTUKVTY2JQmz/d4qEDBD0EKGPnQ+r6PiCr5jS4Qn
 IScyU4dzVuNhkpzuphuJuoBnvPsnhlwNPtDkSZ1dV7At3zx52mQAlzjJID52Hr4K
 FIReQlhXQognZb3AtYrFilK/BMOA7Vj/HO5apzf72OkdL5lKYuSeSbxV/rqWB5jh
 tPyzv5Ufi6cZ+eNTQ6aDy/O8+9ktu5sAqpi4mX9IMwKsIdxu1GuqX+9MW8ecuE7M
 IOA8Clj17PjUPHKgExh29i3W32zxjryWpZAcRyNEf4ovUnbMPAYyAdEctTTTChGE
 sthkFBpqEflaEZPYIjsAMyViXMUkPtsigDzlHtkdf9BTiF6QMs3gqhHPLWgsPAzB
 gpjQc//X2e/77saaTdrwj10vy587xxRLYWF92aOVq9s7CKb5g/D3q5DuaeRpVOum
 w2WugVGxPs0Fsy2Wd0HuZFpeU6qBD9AdHfB0GMJ4TQs8K2XT9vLAc9cw6x4s3Bup
 PwbqfN+upLZHbiL0uZpXfq39w1JUr/QkH7jCMpu2xZvc0R472Nv6FGLDdyLAYJnG
 HNzLXWW9wGj4YjTPKYQD
 =YrWd
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-11-26' into staging

QMP and QObject patches

# gpg: Signature made Thu 26 Nov 2015 09:07:18 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-monitor-2015-11-26:
  qjson: Limit number of tokens in addition to total size
  qjson: surprise, allocating 6 QObjects per token is expensive
  qjson: store tokens in a GQueue
  qjson: Convert to parser to recursive descent
  qjson: replace QString in JSONLexer with GString
  qjson: Inline token_is_escape() and simplify
  qjson: Inline token_is_keyword() and simplify
  qjson: Give each of the six structural chars its own token type
  qjson: Spell out some silent assumptions
  check-qjson: Add test for JSON nesting depth limit
  qjson: Don't crash when input exceeds nesting limit
  qjson: Apply nesting limit more sanely
  monitor: Plug memory leak on QMP error

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26 16:27:26 +00:00
Peter Maydell b8b0ee0ea3 qemu-ga patch queue for 2.5
* include additional w32 MSI install components needed for
   guest-exec
 * fix 'make install' when compiling with --disable-tools
 * fix potential data corruption/loss when accessing files
   bi-directionally via guest-file-{read,write}
 * explicitly document how integer args for guest-file-seek map to
   SEEK_SET/SEEK_CUR/etc to avoid platform-specific differences
 
 v2:
 * fixed missing SoB
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWVks1AAoJEDNTyc7xCLWE0/oH/3q9DtEGB5dDUMCn3BPo+FCO
 M7R4uL1MB2CSXHPZxpoueZL2ZNlCpWJgidOEfVTyVrPUI68qsEcPm2vmKAQu5y7e
 Dxu+yD+qA3wWqgNRhH6O7X7owq+e5cM8ZZFPZ2T89wgsQbs+TwyrOfJfypIP/cAW
 cjnowxVz9kB9f0qpOJViPN0lfbtc+n5pZOm2VNluHtEWCHS8X9tqvSDtHgIU/BKV
 39y/UeSKNmvl7UlTeRi6dVUbKPo1eZSExjvHoWZjXBOu3Ky75wineVMASxuC632y
 IQG+1YIBl5vv84he29U6O5lW2rcbld6vff8QqvR8HzNIxnD8kfykkpmxHlxWDIA=
 =bIkC
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-11-25-v2-tag' into staging

qemu-ga patch queue for 2.5

* include additional w32 MSI install components needed for
  guest-exec
* fix 'make install' when compiling with --disable-tools
* fix potential data corruption/loss when accessing files
  bi-directionally via guest-file-{read,write}
* explicitly document how integer args for guest-file-seek map to
  SEEK_SET/SEEK_CUR/etc to avoid platform-specific differences

v2:
* fixed missing SoB

# gpg: Signature made Wed 25 Nov 2015 23:58:45 GMT using RSA key ID F108B584
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>"
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>"
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>"

* remotes/mdroth/tags/qga-pull-2015-11-25-v2-tag:
  qga: added another non-interactive gspawn() helper file.
  qga: Better mapping of SEEK_* in guest-file-seek
  tests: add file-write-read test
  qga: flush explicitly when needed
  qga: gspawn() console helper to Windows guest agent msi build
  makefile: fix qemu-ga make install for --disable-tools

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26 10:24:18 +00:00
Peter Maydell 7ef7ddf376 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQIcBAABAgAGBQJWVhkxAAoJEH3vgQaq/DkOx3kP/1ltX2d+EEaCTNFhaDD+RqDd
 elfkfh04gtP+8S7zcfSibe7NnbmQBYrwDZa0XfE+mDG5zNPx+e6Y3CHaRdmQ4cqS
 1mPCRBmSvSS2/tHs9QtYS6H8Qlv4BkOpuzykoKbkMdABb0w8w1IGqiH4oRghjUrn
 NTOfWoGqLStwUGj/jur2x7lXz6x5grQLflykuoWWcX7UuPp5U47UMHNUohfwvIJ3
 gN4/KaloNcxbbFMjh/CEM4fSjDdlP45eSAeRFu50x5G0pzqrnrMO/iHYC3AjXujB
 2j8f72guP3L/fdoqcQbwVyXqDNukU3aFizggNG73ob8r5SemOMj0Q85Nl5zbtsDI
 5Iq4B6y4KAh7uTH+9h9IlCi+MWo62WdHV5lNcBKw25K1SFDx37LWQT9YInlLKSkb
 xAfzOMvH2nNi8OMbwVCizQQ3XCzf3c2JJSOC0ONkdgbWB5GRk6uvuykkzXGfIYxo
 9Q8XVdHB2KN9UYBC4lcmprj28QF39UImuibL1OHaVt3jTSEjjsSUNbwEEgFrfFfg
 tCJWBI/iNFNJ/Eg6hHPSqMdqoenNJAmg+KxG26WNvmnevV0Z/182K3qrfvXFrbhb
 z39KU+ImjiWxKyk8DvvKE6VdOdiI6FsPAnjhuR5AkKcPCNwz7s+NrhZ5ahaeo2xJ
 dJDs+aE5culxKiuotb2w
 =Wvdc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

# gpg: Signature made Wed 25 Nov 2015 20:25:21 GMT using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"

* remotes/jnsnow/tags/ide-pull-request:
  ide-test: fix timeouts
  atapi: Fix code indentation
  atapi: Account for failed and invalid operations in cd_read_sector()
  ide-test: cdrom_pio_impl fixup

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26 09:44:25 +00:00
Paolo Bonzini 95385fe9ac qjson: store tokens in a GQueue
Even though we still have the "streamer" concept, the tokens can now
be deleted as they are read.  While doing so convert from QList to
GQueue, since the next step will make tokens not a QObject and we
will have to do the conversion anyway.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1448300659-23559-4-git-send-email-pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-11-26 10:07:07 +01:00
Markus Armbruster f0ae0304c7 check-qjson: Add test for JSON nesting depth limit
This would have prevented the regression mentioned in the previous
commit.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1448486613-17634-4-git-send-email-armbru@redhat.com>
2015-11-26 09:18:38 +01:00
Eric Blake 0a982b1bf3 qga: Better mapping of SEEK_* in guest-file-seek
Exposing OS-specific SEEK_ constants in our qapi was a mistake
(if the host has SEEK_CUR as 1, but the guest has it as 2, then
the semantics are unclear what should happen); if we had a time
machine, we would instead expose only a symbolic enum.  It's too
late to change the fact that we have an integer in qapi, but we
can at least document what mapping we want to enforce for all
qga clients (and luckily, it happens to be the mapping that both
Linux and Windows use); then fix the code to match that mapping.
It also helps us filter out unsupported SEEK_DATA and SEEK_HOLE.

In the future, we may wish to move our QGA_SEEK_* constants into
qga/qapi-schema.json, along with updating the schema to take an
alternate type (either the integer, or the string value of the
enum name) - but that's too much risk during hard freeze.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-25 17:56:45 -06:00
Marc-André Lureau 4eaab85cb1 tests: add file-write-read test
This test exhibits a POSIX behaviour regarding switching between write
and read. It's undefined result if the application doesn't ensure a
flush between the two operations (with glibc, the flush can be implicit
when the buffer size is relatively small). The previous commit fixes
this test.

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1210246

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-25 17:56:45 -06:00
John Snow 9c73517ca5 ide-test: fix timeouts
Use explicit timeouts instead of trying to approximate it by counting
the cumulative duration of nsleep calls.

In practice, the timeout if inb() dwarfed the nsleep delays, and as a
result the real timeout value became a lot larger than 5 seconds.

So: change the semantics from "Not sooner than 5 seconds" to "no more
than 5 seconds" to ensure we don't hang the tester for very long.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1448393771-15483-2-git-send-email-jsnow@redhat.com
2015-11-25 11:37:34 -05:00
Fam Zheng 4d7f853ff0 qemu-iotests: Add -nographic when starting QEMU in 119 and 120
Otherwise, a window flashes on my desktop (built with SDL). Add this as
other cases have it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1448245930-15031-1-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-25 14:29:39 +01:00
Kevin Wolf 7595ed7439 test-aio: Fix event notifier cleanup
One test case closed an event notifier (event_notifier_cleanup())
without first disabling it (set_event_notifier(..., NULL)). This
resulted in a leftover handle 0 that was added to each subsequent
WaitForMultipleObjects() call, causing the function to fail (invalid
handle).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-25 14:27:43 +01:00
Kevin Wolf 5e41fbffa1 tests/Makefile: Add more dependencies for test-timed-average
'make check' failed to compile the test case for mingw because of
undefined references. Pull in a few more dependencies so that it builds.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-25 14:27:43 +01:00
Victor Kaplansky 7cf32491ea tests/vhost-user-bridge: read command line arguments
Now some vhost-user-bridge parameters can be passed from the
command line:

Usage: prog [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]
        -u path to unix doman socket. default: /tmp/vubr.sock
        -l local host and port. default: 127.0.0.1:4444
        -r remote host and port. default: 127.0.0.1:5555

Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-25 13:42:38 +02:00
Victor Kaplansky 85ea9da5b8 tests/vhost-user-bridge: propose GUEST_ANNOUNCE feature
The backend has to know whether VIRTIO_NET_F_GUEST_ANNOUNCE was
negotiated, so, as a hack we propose the feature by
vhost-user-bridge during the feature negotiation.

Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-25 13:42:38 +02:00
Markus Armbruster 1d649244b3 ivshmem: Rename property memdev to x-memdev for 2.5
The device's guest interface and its QEMU user interface are
flawed^Whotly debated.  We'll resolve that in the next development
cycle, probably by deprecating the device in favour of a cleaned up,
but not quite compatible revision.

To avoid adding more baggage to the soon-to-be-deprecated interface,
mark property "memdev" as experimental, by renaming it to "x-memdev".
It's the only recent user interface change.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1448384789-14830-6-git-send-email-armbru@redhat.com>
[Update of qemu-doc.texi squashed in]
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2015-11-25 10:24:27 +01:00
Markus Armbruster 1613094766 tests/ivshmem-test: Supply missing initializer in get_device()
If the device isn't found, the assertion uses dev without
initialization.  Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1448384789-14830-4-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2015-11-25 10:24:04 +01:00
John Snow a421f3c385 ide-test: cdrom_pio_impl fixup
Final tidying: move the interrupt wait into the loop,
document that the status read clears the IRQ, and move
the final interrupt check outside of the loop.

This should be functionally equivalent to how it works
currently, but a little less ambiguous and slightly more
explicit about the state transitions.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1448060035-31973-3-git-send-email-jsnow@redhat.com
2015-11-24 14:51:43 -05:00
Peter Lieven f348daf3d5 tests: fix cdrom_pio_impl in ide-test
The check for the cleared BSY flag has to be performed
before each data transfer and not just before the
first one.

Commit 5f81724d revealed this glitch as the BSY flag
was not set in ATAPI PIO transfers before.

While at it fix the descriptions and add a comment before
the nested for loop that transfers the data.

Signed-off-by: Peter Lieven <pl@kamp.de>
Message-id: 1448029742-19771-1-git-send-email-pl@kamp.de
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-20 17:37:06 +00:00
Peter Maydell 28c3e6ee72 QOM infrastructure fixes and device conversions
* Fix for properties on objects > 4 GiB
 * Performance improvements for QOM property handling
 * Assertion cleanups
 * MAINTAINERS additions
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJWTd1wAAoJEPou0S0+fgE/v4oQAKdUcb8kDg8cb1rfjNHOGSxh
 GLrBnpCE22ePtugMJqyGRE/bM2cMrXk/NLMGy1hXeNt+46zl6eUadZSV4UCjrq8q
 I9S5/DuGpwc7NT5zw5/ZTx7b9rzCjwpvyq17Ljwme5QbKZvC86OiaZ5OjD7HZdYO
 wY1vXuDoJXuj0r8hp6uS/mkfXx7R6O3bsmnOaz1yxSZqs0gi1r9En6Y/aoOCgz1V
 bc09iWIAer0U71E9C+kinWwqBBx/PjhrkKxBGMmFEtf3O7Kd8irXpZPoafpRkgsJ
 mvvUaiHFapJaXjjsSlknRfdspXdhwrrYhoCPso8vwEDEWMB03th2eBcau2rsfFXj
 nHPAGwjxKETSQHD+/EbtCL+y94IkSbkdf1qF+TWnCiAHIF/yvoMbjRy5+7I/bsbC
 Mp+qzjP+09E/qSclbeBH/EA/4ukjF2UbDGDh17/019aEpDVt016PKjoRhAWgbOJR
 QKumj8y7+UQMvKo1jkqcOVf7pFTkKXeAsVvWjtA089X9iEczJQo6lrTxmtvLZ7K6
 PehJPZFlm7hLTEykq+xZmgQAGrhx2MdQbbEgEDM5flGPRViypmihgRzFWIAT6rBY
 WBEFRohRuHwTARDcmyP9MWeR5/hAlH3kD3O0qCYNbCZgQroXBW6bHQ913rerfwXh
 uatso/iKOJ6YOlc7scPU
 =/IfF
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

* Fix for properties on objects > 4 GiB
* Performance improvements for QOM property handling
* Assertion cleanups
* MAINTAINERS additions

# gpg: Signature made Thu 19 Nov 2015 14:32:16 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-devices-for-peter:
  MAINTAINERS: Add check-qom-{interface,proplist} to QOM
  qom: Clean up assertions to display values on failure
  qom: Replace object property list with GHashTable
  qom: Add a test case for complex property finalization
  net: Convert net filter code to use object property iterators
  ppc: Convert spapr code to use object property iterators
  vl: Convert machine help code to use object property iterators
  qmp: Convert QMP code to use object property iterators
  qom: Introduce ObjectPropertyIterator struct for iteration
  qdev: Change Property::offset field to ptrdiff_t type

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-19 17:54:46 +00:00
Peter Maydell 348c32709f vhost, pc: fixes for 2.5
Fixes all over the place.
 
 This also re-enables a test we disabled in 2.5 cycle
 now that there's a way not to get a warning from it.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWTc5PAAoJECgfDbjSjVRpCJEH/jh1CeWCG7zRBXelWK2F5Cgr
 ls+V1sCX7NvkfCa3cDZI8imGjYQUr6EiXtqxPArEVMjmUOUzEHPkOx3ICPpfMU7o
 RCVNPELav6VBhGDf3mcIVjlDDN9Syhd90xdgaD8dbeSA0UJFHRTdobNlYpYwiRmp
 OAASUawEWLGA5cG+W6MBFWiPQWChpNRK3yK3RVduL71TIe4heuHBez4qTB2QKYvF
 KM2nRvpkBY21frXJQqWPlCJ6jsdjI/Fl2xR1t4C9qv0TKcB9FESMmH3Jff2bwMQM
 8OSnTIRqYaqT6kJkk3Kns8a+porJMnn69OwBRehLmLW/rmx9HQrR2Ey7bYtgd0Y=
 =CrrY
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

vhost, pc: fixes for 2.5

Fixes all over the place.

This also re-enables a test we disabled in 2.5 cycle
now that there's a way not to get a warning from it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Thu 19 Nov 2015 13:27:43 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream:
  exec: silence hugetlbfs warning under qtest
  tests: re-enable vhost-user-test
  acpi: fix buffer overrun on migration
  vhost-user: fix log size
  vhost-user: ignore qemu-only features
  specs/vhost-user: fix spec to match reality
  tests/vhost-user-bridge: implement logging of dirty pages
  i440fx: print an error message if user tries to enable iommu
  q35: Check propery to determine if iommu is set
  vhost-user: start/stop all rings
  vhost-user: print original request on error
  vhost-user-test: support VHOST_USER_SET_VRING_ENABLE
  vhost-user: update spec description
  vhost: don't send RESET_OWNER at stop
  vhost: let SET_VRING_ENABLE message depends on protocol feature

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-19 16:26:08 +00:00
Marc-André Lureau 421f4448ce tests: re-enable vhost-user-test
Commit 7fe34ca9c2 actually disabled vhost-user-test altogether,
since CONFIG_VHOST_NET is a per-target config variable.

tests/vhost-user-test is already x86/x64 softmmu specific test, in order
to enable it correctly, kvm & vhost-net are also conditions. To check
that, set CONFIG_VHOST_NET_TEST_$target when kvm is also enabled.

Since "check-qtest-x86_64-y = $(check-qtest-i386-y)", avoid duplication
when both x86 & x64 are enabled.

Other targets than x86 aren't enabled yet, and is intentionally left as
a future improvement, since I can't easily test those.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-19 15:26:05 +02:00
Daniel P. Berrange 8c4d156c18 qom: Add a test case for complex property finalization
Devices have some quite complex object child/link relationships
which place some requirements on the object_property_del_all()
function to consider that properties can be modified while
being iterated over.

This extends the QOM property test case to replicate the
device like structure and expose any potential bugs in the
object_property_del_all() function.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:49 +01:00
Daniel P. Berrange a00c948241 qom: Introduce ObjectPropertyIterator struct for iteration
Some users of QOM need to be able to iterate over properties
defined against an object instance. Currently they are just
directly using the QTAIL macros against the object properties
data structure.

This is bad because it exposes them to changes in the data
structure used to store properties, as well as changes in
functionality such as ability to register properties against
the class.

This provides an ObjectPropertyIterator struct which will
insulate the callers from the particular data structure
used to store properties. It can be used thus

  ObjectProperty *prop;
  ObjectPropertyIterator *iter;

  iter = object_property_iter_init(obj);
  while ((prop = object_property_iter_next(iter))) {
      ... do something with prop ...
  }
  object_property_iter_free(iter);

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
[AF: Fixed examples, style cleanups]
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:38 +01:00
Peter Maydell 8f28030903 Block layer patches
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWTJkgAAoJEH8JsnLIjy/Ws8sP/0eeTsbuaYcMbyh5/G7ORqAk
 l1IjEgpKs2d9+QwZACPOcb72m2S5mhXxEQ1LvMK3qNd+GhlTgDTD9Kxiyiqw3m+D
 5EBA/wcIJUyZFgTJmWfpURmHaw1JUAUGcli6ag1HxA7lKcUG+qgl7b2EE73UwfJ8
 zyCYT8PBUm4mUFua77LTNxwCjiU+lG1r0b8BzeOgaxwj4UaUgmZiq5X6t2luznBH
 H1NEmiRi0TUZbIeQaUCrgdqHFMoPmkXIWPdXMWHVEeiB/Q2eBsX2jrR4STseW39d
 FDrjTil3+1CoLuTW1dwHbEdvqcJN9GFc2bf+vLR797WURiENUvpIP8X1ijNtnMym
 Tv1DwuW4Vd8/MPwDIrswWF0iTPLGCfLLc6xBzUKecMxInS7JiyfrYgN1uVpI55Vw
 LdLzX2UtsCExsehZL+DnMG9p5XuEtvmodE2pkQ/nznwMIhvKUm2l3voPch8CeuSI
 SJ/RFgDwED3zPDcl55brS3TdkJfLUCbjeUEObEh6L9qtEtAXbwNh2BIMXk1ZodRT
 9CvMxZN4fr4g1a9SVVtf1yyrhptPZ3U1v2gyESbQLO192etqyo/g1OPFGze/NyFn
 uX4kOfarwl8LyWMh59nYt7WEhRPvkXEmIcT2Z6hJUQI8v6ghm9rjy5sL6JONa+uO
 44YdbaFXZqDoARv8Qu6H
 =4VZP
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Wed 18 Nov 2015 15:28:32 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  block: Call external_snapshot_clean after blockdev-snapshot
  blockdev: Add missing bdrv_unref() in drive-backup
  iotests: fix race in 030
  nand: fix address overflow

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18 17:07:24 +00:00
Daniel P. Berrange 7b35030eed crypto: fix leaks in TLS x509 helper functions
The test_tls_get_ipaddr() method forgot to free the returned data
from getaddrinfo().

The test_tls_write_cert_chain() method forgot to free the allocated
buffer holding the certificate data after writing it out to a file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-18 14:56:58 +00:00
John Snow 01809194a0 iotests: fix race in 030
the stop_test case tests that we can resume a block-stream
command after it has stopped/paused due to error. We cannot
always reliably query it before it finishes after resume, though,
so make this a conditional.

The important thing is that we are still testing that it has stopped,
and that it finishes successfully after we send a resume command.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-18 15:54:15 +01:00
Victor Kaplansky 5c93c47338 tests/vhost-user-bridge: implement logging of dirty pages
During migration devices continue writing to the guest's memory.
The writes has to be reported to QEMU. This change implements
minimal support in vhost-user-bridge required for successful
migration of a guest with virtio-net device.

Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-17 15:41:13 +02:00
Alberto Garcia 40119effc5 block: make 'stats-interval' an array of ints instead of a string
This is the natural JSON representation and prevents us from having to
decode the list manually.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 0e3da8fa206f4ab534ae3ce6086e75fe84f1557e.1447665472.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:57 +08:00
Eric Blake a12e52a151 tests: Ignore recent test binaries
Commits 6c6f312d and bd797fc1 added new tests (test-blockjob-txn
and test-timed-average, respectively), but did not mark them for
exclusion in .gitignore.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1447386423-13160-1-git-send-email-eblake@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:56 +08:00
Michael S. Tsirkin 87656d5018 vhost-user-test: support VHOST_USER_SET_VRING_ENABLE
vhost-user-test is broken now: it assumes
QEMU sends RESET_OWNER, and we stopped doing that.
Wait for ENABLE_RING with 0 instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-16 14:35:05 +02:00
John Snow 917158dc3b qtest/ahci: use raw format when qemu-img is absent
If we don't have the qemu-img tool, use the raw format
for tests and skip the high-sector LBA48 tests.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1447439479-16775-4-git-send-email-jsnow@redhat.com
2015-11-13 14:31:43 -05:00
John Snow cb11e7b2f3 libqos: add qemu-img presence check
To allow tests to optionally exercise additional tests
that require the qemu-img tool that may not be present
in all builds.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1447439479-16775-3-git-send-email-jsnow@redhat.com
2015-11-13 14:31:42 -05:00
John Snow b236b61056 qtest/ahci: always specify image format
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1447439479-16775-2-git-send-email-jsnow@redhat.com
2015-11-13 14:31:42 -05:00
John Snow 6d9e7295c5 ahci/qtest: don't use tcp sockets for migration tests
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1447108074-20609-1-git-send-email-jsnow@redhat.com
2015-11-13 14:31:42 -05:00
Peter Maydell b2df6a79df Block layer patches (rebased Stefan's pull request)
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWRLF4AAoJEH8JsnLIjy/WpIcQAK+gSTtFQA8EyWqYVENyTDcI
 MTrvWI3p87XGTO11jNS8zJQIXGjenwM0jfAVoUAUHv+i9sV+/XORK1txpDZF3dhU
 Oy+16owb75e1mbBX+PYilU2SG/Uy5m81O4EX5yFXelh4xdTG1yz+ZcZjc6sKno5A
 DUJEkQDRgged5y9o2nFNjWA1jC617mGtlywmAqBRvDQA8cjO5ePF0P4jCe+RPpqW
 BRcLO59THqGkbFlB5JahSYo5gt1QwMoEGnT5YT8NGNcDUp1Cm+PfkTZrdgcv5nGj
 Or4nvmt7OuLIWG3yPeJJSfRU7HQbi2GmE6LtjEBPYWRjSzDxDMRyty3US2VtvhT2
 aIa7HDX81yclUeyyeRoLL9PFvo759D9QM9OpuY1JNOuYqcJ56DHPA7N9dX2oK3wt
 tMbPxpH1sAzD/12demj+ULrxAwcDbfyz5QvD8Sx/+6RHxRKXuUSoPxI8RN/yzyeR
 aQuKKNByymFSJfWEm3s4mHCtf/lieyESMBLUnAVyP+doZOOI3dL2+DZIBzYXFQWp
 RFndoMLmHDnSCjo72J7N3KF2l2Fc5q94aXZJcp/erpVDkAf7XOXSxcqSWmx6Swn3
 Uf18v/1Y2NJonUls7VFHpuT1AbPR2F1VYOh0VyrGzNnWqspH84ain2p2TxSXOLcV
 WkwMN5B2cXbs2nbtaqk+
 =9mKZ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches (rebased Stefan's pull request)

# gpg: Signature made Thu 12 Nov 2015 15:34:16 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream: (43 commits)
  block: Update copyright of the accounting code
  scsi-disk: Account for failed operations
  macio: Account for failed operations
  ide: Account for failed and invalid operations
  atapi: Account for failed and invalid operations
  xen_disk: Account for failed and invalid operations
  virtio-blk: Account for failed and invalid operations
  nvme: Account for failed and invalid operations
  iotests: Add test for the block device statistics
  block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode
  qemu-io: Account for failed, invalid and flush operations
  block: New option to define the intervals for collecting I/O statistics
  block: Add average I/O queue depth to BlockDeviceTimedStats
  block: Compute minimum, maximum and average I/O latencies
  block: Allow configuring whether to account failed and invalid ops
  block: Add statistics for failed and invalid I/O operations
  block: Add idle_time_ns to BlockDeviceStats
  util: Infrastructure for computing recent averages
  block: define 'clock_type' for the accounting code
  ide: Account for write operations correctly
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-12 17:22:06 +00:00
Alberto Garcia 4214face09 iotests: Add test for the block device statistics
Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 0fb8501bbf3666b3d5d3f67fa899729c88f21baf.1446044838.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-12 16:22:46 +01:00
Alberto Garcia bd797fc15b util: Infrastructure for computing recent averages
This module computes the average of a set of values within a time
window, keeping also track of the minimum and maximum values.

In order to produce more accurate results it works internally by
creating two time windows of the same period, offsetted by half of
that period. Values are accounted on both windows and the data is
always returned from the oldest one.

[Add missing util/replay.o to test-timed-average dependencies to fix the
build.
--Stefan]

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 201b09c21bbc9c329779d2b2365ee2b9c80dceeb.1446044837.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-12 16:22:45 +01:00
Stefan Hajnoczi 6c6f312dd7 tests: add BlockJobTxn unit test
The BlockJobTxn unit test verifies that both single jobs and pairs of
jobs behave as a transaction group.  Either all jobs complete
successfully or the group is cancelled.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1446765200-3054-15-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-12 16:22:44 +01:00
John Snow fc6c796ff2 iotests: 124 - transactional failure test
Use a transaction to request an incremental backup across two drives.
Coerce one of the jobs to fail, and then re-run the transaction.

Verify that no bitmap data was lost due to the partial transaction
failure.

To support the 'err-cancel' QMP argument name it's necessary for
transaction_action() to convert underscores in Python argument names
to hyphens for QMP argument names.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1446765200-3054-14-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-12 16:22:44 +01:00
John Snow 749ad5e887 iotests: add transactional incremental backup test
Test simple usage cases for using transactions to create
and synchronize incremental backups.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1446765200-3054-3-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-12 16:22:43 +01:00
Yuanhan Liu 60915dc469 vhost: rename RESET_DEVICE backto RESET_OWNER
This patch basically reverts commit d1f8b30e.

It turned out that it breaks stuff, so revert it:
    http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html

CC: "Michael S. Tsirkin" <mst@redhat.com>
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12 15:49:33 +02:00