- Sep 15, 2017
-
-
Eric Blake authored
Back when the test was introduced, in commit 62c39b30, the test was set up to run qemu-ga directly on the host performing the test, and defaults to limiting itself to safe commands. At the time, it was envisioned that setting QGA_TEST_SIDE_EFFECTING in the environment could cover a few more commands, while noting the potential danger of those side effects running in the host. But this has NEVER been tested: if you enable the environment variable, the test WILL fail. One obvious reason: if you are not running as root, you'll probably get a permission failure when trying to freeze the file systems, or when changing system time. Less obvious: if you run the test as root (wow, you're brave), you could end up hanging if the test tries to log things to a temporarily frozen filesystem. But the cutest reason of all: if you get past the above hurdles, the test uses invalid JSON in test_qga_fstrim() (missing '' around the dictionary key 'minimum'), and will thus fail an assertion in qmp_fd(). Rather than leave this untested time-bomb in place, rip it out. Hopefully, as originally envisioned, we can find an opportunity to test an actual sandboxed guest where the guest-agent has full permissions and will not unduly affect the host running the test - if so, 'git revert' can be used if desired, for salvaging any useful parts of this attempt. Signed-off-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
Broken with commit b4ba67d9 ("libqos: Change PCI accessors to take opaque BAR handle") a while ago, but nobody noticed since the tests are not run by default: The msix_pba_bar is not correctly initialized anymore if bir_pba has the same value as bir_table. With this fix, "make check SPEED=slow" should work fine again. Fixes: b4ba67d9 Tested-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
The user can currently still cause an abort() if running certain tests (like the prom-env-test) without setting the QTEST_QEMU_BINARY first. A similar problem has been fixed with commit 7c933ad6 already, but forgot to also take care of the qtest_get_arch() function, so let's introduce a proper wrapper around getenv("QTEST_QEMU_BINARY") that can be used in both locations now. Buglink: https://bugs.launchpad.net/qemu/+bug/1713434 Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
John Snow <jsnow@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
The problem with puv3 has been fixed with 0ac241bc ('unicore32: abort when entering "x 0" on the monitor') and the problem with tricore_testboard has been fixed with b190f477 ('qemu-system-tricore: segfault when entering "x 0" on the monitor'). Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
A lot of tests provide code for adding and removing a device via the device_add and device_del QMP commands. Maintaining this code in so many places is cumbersome and error-prone (some of the code parts check the responses for device deletion in an incorrect way, for example, we've got to deal with both, error code and DEVICE_DEL event here). So let's provide some proper generic functions for adding and removing a device instead. The code for correctly unplugging a device has been taken from a patch from Peter Xu. Reviewed-by:
Peter Xu <peterx@redhat.com> Tested-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Sep 14, 2017
-
-
Laurent Vivier authored
and add a test case of dump-guest-memory without "[begin length]" parameters. Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Message-Id: <20170913142036.2469-5-lvivier@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
- Sep 08, 2017
-
-
Marc-André Lureau authored
Commit e10e798c switched to libvhost-user which lacked support for resuming the avail_idx based on used_idx. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1485867 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>
-
- Sep 06, 2017
-
-
Eric Blake authored
Rather than open-coding our own read/write-all functions, we can make use of the recently-added qio code. It slightly changes the error message in one of the iotests. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <20170905191114.5959-4-eblake@redhat.com> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com>
-
Dr. David Alan Gilbert authored
It's legal to loadvm twice, modify the existing save/loadvm test to do it twice. Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170825141940.20740-3-dgilbert@redhat.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
Manos Pitsidianakis authored
Reviewed-by:
Alberto Garcia <berto@igalia.com> Signed-off-by:
Manos Pitsidianakis <el13635@mail.ntua.gr> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Sep 05, 2017
-
-
Juan Quintela authored
Just make sure that nr_tables is size_t not int. Once there, do the assert in the right place and be sure that we don't have a division by zero. Suggested-by:
Cédric Le Goater <clg@kaod.org> Signed-off-by:
Juan Quintela <quintela@redhat.com> Tested-by:
Cleber Rosa <crosa@redhat.com> -- Drop the s/g_new0/g_malloc0/ change. Avoid division by zero with assert (danp)
-
Juan Quintela authored
We were using -1 instead of the real size because the functions check what is bigger, size in bytes or the size of the iov. Recent gcc's barf at this. Signed-off-by:
Juan Quintela <quintela@redhat.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Tested-by:
Cleber Rosa <crosa@redhat.com> -- Remove comments about this feature. Fix missing -1.
-
Daniel P. Berrangé authored
The 194 test has a lot of code that assumes a simple image file. Rewriting this to work with luks is possible, but non-trivial, so blacklist the luks format for now. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170901105434.3288-3-berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Tested-by:
Fam Zheng <famz@redhat.com> [eblake: commit message typo fixed] Reviewed-by:
Kashyap Chamarthy <kchamart@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com>
-
Daniel P. Berrangé authored
The LUKS driver requires extra args to QEMU to setup passwords. The _launch_qemu function takes care of this, so convert the test to use this function and use correct -drive syntax Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170901105434.3288-2-berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Tested-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com>
-
Philippe Mathieu-Daudé authored
tests/vhost-user-test keeps failing on build-system since Aug 15: ERROR:tests/vhost-user-test.c:835:test_flags_mismatch: child process (/i386/vhost-user/flags-mismatch/subprocess [4836]) failed unexpectedly ... ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/x86_64/vhost-user/connect-fail/subprocess [58910]) failed unexpectedly Suggested-by:
Peter Maydell <peter.maydell@linaro.org> Suggested-by:
Daniel P. Berrange <berrange@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170905180602.28698-1-f4bug@amsat.org Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Manos Pitsidianakis authored
ThrottleGroup is converted to an object. This will allow the future throttle block filter drive easy creation and configuration of throttle groups in QMP and cli. A new QAPI struct, ThrottleLimits, is introduced to provide a shared struct for all throttle configuration needs in QMP. ThrottleGroups can be created via CLI as -object throttle-group,id=foo,x-iops-total=100,x-.. where x-* are individual limit properties. Since we can't add non-scalar properties in -object this interface must be used instead. However, setting these properties must be disabled after initialization because certain combinations of limits are forbidden and thus configuration changes should be done in one transaction. The individual properties will go away when support for non-scalar values in CLI is implemented and thus are marked as experimental. ThrottleGroup also has a `limits` property that uses the ThrottleLimits struct. It can be used to create ThrottleGroups or set the configuration in existing groups as follows: { "execute": "object-add", "arguments": { "qom-type": "throttle-group", "id": "foo", "props" : { "limits": { "iops-total": 100 } } } } { "execute" : "qom-set", "arguments" : { "path" : "foo", "property" : "limits", "value" : { "iops-total" : 99 } } } This also means a group's configuration can be fetched with qom-get. Signed-off-by:
Manos Pitsidianakis <el13635@mail.ntua.gr> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Alberto Garcia <berto@igalia.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Manos Pitsidianakis authored
timer_cb() needs to know about the current Aio context of the throttle request that is woken up. In order to make ThrottleGroupMember backend agnostic, this information is stored in an aio_context field instead of accessing it from BlockBackend. Reviewed-by:
Alberto Garcia <berto@igalia.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Manos Pitsidianakis <el13635@mail.ntua.gr> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Manos Pitsidianakis authored
This commit eliminates the 1:1 relationship between BlockBackend and throttle group state. Users will be able to create multiple throttle nodes, each with its own throttle group state, in the future. The throttle group state cannot be per-BlockBackend anymore, it must be per-throttle node. This is done by gathering ThrottleGroup membership details from BlockBackendPublic into ThrottleGroupMember and refactoring existing code to use the structure. Reviewed-by:
Alberto Garcia <berto@igalia.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Manos Pitsidianakis <el13635@mail.ntua.gr> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Daniel P. Berrangé authored
The TLS I/O channel test had mistakenly used && instead of || when checking for handshake completion. As a result it could terminate the handshake process before it had actually completed. This was harmless before but changes in GNUTLS 3.6.0 exposed this bug and caused the test suite to fail. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Daniel P. Berrangé authored
These functions wait until they are able to read / write the full requested data buffer(s). Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Stefan Hajnoczi authored
Switch from atexit.register() to a more elegant idiom of declaring resources in a with statement: with FilePath('monitor.sock') as monitor_path, VM() as vm: ... The files and VMs will be automatically cleaned up whether the test passes or fails. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170824072202.26818-4-stefanha@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Stefan Hajnoczi authored
The scratch/ (TEST_DIR) directory is not automatically cleaned up after test execution. It is the responsibility of tests to remove any files they create. A nice way of doing this is to declare files at the beginning of the test and automatically remove them with a context manager: with iotests.FilePath('test.img') as img_path: qemu_img(...) qemu_io(...) # img_path is guaranteed to be deleted here Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170824072202.26818-3-stefanha@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Sep 04, 2017
-
-
Marc-André Lureau authored
Now that all usages have been converted to user lookup helpers. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170822132255.23945-14-marcandre.lureau@redhat.com> [Rebased, superfluous local variable dropped, missing check-qom-proplist.c update added] Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-17-git-send-email-armbru@redhat.com>
-
Marc-André Lureau authored
Currently, a FOO_lookup is an array of strings terminated by a NULL sentinel. A future patch will generate enums with "holes". NULL-termination will cease to work then. To prepare for that, store the length in the FOO_lookup by wrapping it in a struct and adding a member for the length. The sentinel will be dropped next. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170822132255.23945-13-marcandre.lureau@redhat.com> [Basically redone] Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-16-git-send-email-armbru@redhat.com> [Rebased]
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Markus Armbruster authored
The next commit will put it to use. May look pointless now, but we're going to change the FOO_lookup's type, and then it'll help. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-13-git-send-email-armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Markus Armbruster authored
Currently, the FOO_lookup[] generated for QAPI enum types are terminated by a NULL sentinel. A future patch will generate enums with "holes". NULL-termination will cease to work then. To prepare for that, replace "have we reached the sentinel?" predicates by "have we reached the FOO__MAX value?" predicates. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-12-git-send-email-armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Markus Armbruster authored
The lookup tables have a sentinel, no need to make callers pass their size. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> [Rebased, commit message corrected]
-
Marc-André Lureau authored
We check that all members of the QLit list are also in the QList. We neglect to check the other direction. Fix that. While there, use QLIST_FOREACH_ENTRY() to simplify the code and break the loop on the first mismatch. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170825105913.4060-13-marcandre.lureau@redhat.com> [Commit message improved] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
We check that all members of the QLit dictionary are also in the QDict. We neglect to check the other direction. Comparing the number of members suffices, because QDict can't contain duplicate members, and putting duplicates in a QLit is a programming error. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170825105913.4060-12-marcandre.lureau@redhat.com> [Commit message improved] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170825105913.4060-11-marcandre.lureau@redhat.com> [Copyright notice correction squashed in, commit message tweaked] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
Make it more obvious about the expected return values. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-7-marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
compare_litqobj_to_qobj() lacks a qlit_ prefix. Moreover, "compare" suggests -1, 0, +1 for less than, equal and greater than. The function actually returns non-zero for equal, zero for unequal. Rename to qlit_equal_qobject(). Its return type will be cleaned up in the next patch. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-6-marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
Rename from LiteralQ to QLit. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-4-marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Marc-André Lureau authored
Fix code style issues while at it, to please checkpatch. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-3-marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Markus Armbruster authored
A command is a query if it has no side effect and yields a result. Such commands are typically named query-FOO, but there are exceptions. The basic idea is to find candidates with query-qmp-schema, filter out the ones that aren't queries with an explicit blacklist, and test the remaining ones against a QEMU with no special arguments. The current blacklist is just add-fd. The test can't do queries with arguments, because it knows nothing about the arguments. No coverage for query-cpu-model-baseline, query-cpu-model-comparison, query-cpu-model-expansion, query-rocker, query-rocker-ports, query-rocker-of-dpa-flows, and query-rocker-of-dpa-groups. Most tested commands are expected to succeed. The test does not check the return value then. query-balloon and query-vm-generation-id are expected to fail because they need a virtio-balloon / vmgenid device to succeed, and this test is too dumb to set one up. Could be addressed later. query-acpi-ospm-status and query-hotpluggable-cpus are expected to fail because they require features provided only by special machine types, and this test is too dumb to set that up. Could also be addressed later. Several commands may either be functional or stubs that always fail, depending on build configuration. Ideally, the stubs shouldn't be in query-qmp-schema, but that requires QAPI schema compile-time configuration, which we don't have, yet. Until we do, we need to figure out whether a command is a stub. When we have a suitable CONFIG_FOO preprocessor symbol is available, use that. Else, simply blacklist the command for now. We get basic test coverage for the following commands, except as noted: qom-list-types query-acpi-ospm-status (expected to fail) query-balloon (expected to fail) query-block query-block-jobs query-blockstats query-chardev query-chardev-backends query-command-line-options query-commands query-cpu-definitions (blacklisted for now) query-cpus query-dump query-dump-guest-memory-capability query-events query-fdsets query-gic-capabilities (blacklisted for now) query-hotpluggable-cpus (expected to fail) query-iothreads query-kvm query-machines query-memdev query-memory-devices query-mice query-migrate query-migrate-cache-size query-migrate-capabilities query-migrate-parameters query-name query-named-block-nodes query-pci (blacklisted for now) query-qmp-schema query-rx-filter query-spice query-status query-target query-tpm query-tpm-models query-tpm-types query-uuid query-version query-vm-generation-id (expected to fail) query-vnc query-vnc-servers query-xen-replication-status Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1502461148-10154-1-git-send-email-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> [Typos in code under #ifndef and in the commit message fixed]
-
Daniel P. Berrangé authored
The test-io-channel-tls test was mistakenly using two of the same directories as test-crypto-tlssession. This causes a sporadic failure when using make -j$BIGNUM. Reported-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Daniel P. Berrangé authored
GNUTLS 3.6.0 marked SHA1 as untrusted for certificates. Unfortunately the gnutls_x509_crt_sign() method we are using to create certificates in the test suite is fixed to always use SHA1. We must switch to a different method and explicitly ask for SHA256. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Philippe Mathieu-Daudé authored
$ make check-speed tests/benchmark-crypto-hash.c: In function 'test_hash_speed': tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Werror=format=] g_print("Testing chunk_size %ld bytes ", chunk_size); ^ tests/benchmark-crypto-hash.c: In function 'main': tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Werror=format=] snprintf(name, sizeof(name), "/crypto/hash/speed-%lu", i); ^ cc1: all warnings being treated as errors rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed make: *** [tests/benchmark-crypto-hash.o] Error 1 Reviewed-by:
Longpeng(Mike) <longpeng@huawei.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
- Sep 01, 2017
-
-
Eduardo Habkost authored
The conflict check added by commit c0644771 ("qapi: Reject alternates that can't work with keyval_parse()") doesn't work with the following declaration: { 'alternate': 'Alt', 'data': { 'one': 'bool', 'two': 'str' } } It crashes with: Traceback (most recent call last): File "./scripts/qapi-types.py", line 295, in <module> schema = QAPISchema(input_file) File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 1468, in __init__ self.exprs = check_exprs(parser.exprs) File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 958, in check_exprs check_alternate(expr, info) File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 830, in check_alternate % (name, key, types_seen[qtype])) KeyError: 'QTYPE_QSTRING' This happens because the previously-seen conflicting member ('one') can't be found at types_seen[qtype], but at types_seen['QTYPE_BOOL']. Fix the bug by moving the error check to the same loop that adds new items to types_seen, raising an exception if types_seen[qt] is already set. Add two additional test cases that can detect the bug. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170717180926.14924-1-ehabkost@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-