summaryrefslogtreecommitdiffstats
path: root/tests/virtio-blk-test.c
Commit message (Expand)AuthorAgeFilesLines
* tests: fix virtio-blk-test ISR dependenceStefan Hajnoczi2017-06-301-10/+17
* tests: Use null-co:// instead of /dev/null as the dummy imageFam Zheng2017-05-111-1/+1
* tests: fix virtio-blk-test leaksMarc-André Lureau2017-03-011-7/+7
* tests: fix qmp response leakMarc-André Lureau2017-02-281-6/+9
* libqos: Give qvirtio_config_read*() consistent semanticsDavid Gibson2016-10-281-31/+11Star
* tests: enable virtio tests on SPAPRLaurent Vivier2016-10-281-5/+20
* tests: use qtest_pc_boot()/qtest_shutdown() in virtio testsLaurent Vivier2016-10-281-85/+63Star
* tests: rename target_big_endian() as qvirtio_is_big_endian()Laurent Vivier2016-10-281-18/+18
* tests: move QVirtioBus pointer into QVirtioDeviceLaurent Vivier2016-10-281-81/+66Star
* qtest: ask endianness of the target in qtest_init()Laurent Vivier2016-10-141-1/+1
* libqos: add PCI management in qtest_vboot()/qtest_shutdown()Laurent Vivier2016-10-061-1/+1
* Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-06-20' into...Peter Maydell2016-06-201-4/+1Star
|\
| * coccinelle: Remove unnecessary variables for function return valueEduardo Habkost2016-06-201-4/+1Star
* | libqos: add qvirtqueue_cleanup()Stefan Hajnoczi2016-06-201-5/+5
* | libqos: drop duplicated virtio_pci.h definitionsStefan Hajnoczi2016-06-201-5/+6
* | libqos: drop duplicated virtio_blk.h definitionsStefan Hajnoczi2016-06-201-34/+16Star
* | libqos: drop duplicated virtio_ring.h bit definitionsStefan Hajnoczi2016-06-201-7/+11
* | libqos: drop duplicated virtio_config.h definitionsStefan Hajnoczi2016-06-201-2/+4
* | libqos: use virtio_ids.h for device ID definitionsStefan Hajnoczi2016-06-201-3/+4
|/
* tests: Remove unnecessary glib.h includesPeter Maydell2016-06-071-1/+0Star
* tests: Clean up includesPeter Maydell2016-02-161-4/+1Star
* tests: Check QVIRTIO_F_ANY_LAYOUT flag in virtio-blk testMarc Marí2015-03-101-46/+52
* libqos: Add virtio MMIO supportMarc Marí2015-03-101-7/+76
* libqos: Remove PCI assumptions in constants of virtio driverMarc Marí2015-03-101-5/+6
* tests: Prepare virtio-blk-test for multi-arch implementationMarc Marí2015-03-101-65/+89
* libqos: Change use of pointers to uint64_t in virtioMarc Marí2015-03-101-7/+14
* qtests: Specify image format explicitlyKevin Wolf2014-12-101-2/+2
* tests: virtio-blk: Check if hot-plug/unplug worksIgor Mammedov2014-10-151-11/+38
* libqos: use microseconds instead of iterations for virtio timeoutStefan Hajnoczi2014-09-291-25/+22Star
* libqos: improve event_index test with timeoutStefan Hajnoczi2014-09-291-4/+4
* libqos: Added EVENT_IDX supportMarc Marí2014-09-081-0/+124
* libqos: Added MSI-X supportMarc Marí2014-09-081-36/+144
* libqos: Added test case for configuration changes in virtio-blk testMarc Marí2014-09-081-0/+34
* libqos: Added indirect descriptor support to virtio implementationMarc Marí2014-09-081-0/+100
* libqos: Added basic virtqueue support to virtio implementationMarc Marí2014-09-081-3/+193
* tests: Add virtio device initializationMarc Marí2014-09-081-4/+27
* tests: Functions bus_foreach and device_find from libqos virtio APIMarc Marí2014-09-081-8/+53
* tests: Add virtio-blk qtestAndreas Färber2014-03-131-0/+34
pt">} return NULL; } static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp) { /* * Use of error_report() in a function with an Error ** parameter * is suspicious. It is okay here. The parameter only exists to * make the function usable with qemu_opts_foreach(). It is not * actually used. */ const char *value; const char *id; const TPMBackendClass *be; TPMBackend *drv; Error *local_err = NULL; int i; if (!QLIST_EMPTY(&tpm_backends)) { error_report("Only one TPM is allowed."); return 1; } id = qemu_opts_id(opts); if (id == NULL) { error_report(QERR_MISSING_PARAMETER, "id"); return 1; } value = qemu_opt_get(opts, "type"); if (!value) { error_report(QERR_MISSING_PARAMETER, "type"); tpm_display_backend_drivers(); return 1; } i = qapi_enum_parse(&TpmType_lookup, value, -1, NULL); be = i >= 0 ? tpm_be_find_by_type(i) : NULL; if (be == NULL) { error_report(QERR_INVALID_PARAMETER_VALUE, "type", "a TPM backend type"); tpm_display_backend_drivers(); return 1; } /* validate backend specific opts */ if (!qemu_opts_validate(opts, be->opts, &local_err)) { error_report_err(local_err); return 1; } drv = be->create(opts); if (!drv) { return 1; } drv->id = g_strdup(id); QLIST_INSERT_HEAD(&tpm_backends, drv, list); return 0; } /* * Walk the list of TPM backend drivers that are in use and call their * destroy function to have them cleaned up. */ void tpm_cleanup(void) { TPMBackend *drv, *next; QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) { QLIST_REMOVE(drv, list); object_unref(OBJECT(drv)); } } /* * Initialize the TPM. Process the tpmdev command line options describing the * TPM backend. */ int tpm_init(void) { if (qemu_opts_foreach(qemu_find_opts("tpmdev"), tpm_init_tpmdev, NULL, NULL)) { return -1; } return 0; } /* * Parse the TPM configuration options. * To display all available TPM backends the user may use '-tpmdev help' */ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) { QemuOpts *opts; if (!strcmp(optarg, "help")) { tpm_display_backend_drivers(); return -1; } opts = qemu_opts_parse_noisily(opts_list, optarg, true); if (!opts) { return -1; } return 0; } /* * Walk the list of active TPM backends and collect information about them. */ TPMInfoList *qmp_query_tpm(Error **errp) { TPMBackend *drv; TPMInfoList *info, *head = NULL, *cur_item = NULL; QLIST_FOREACH(drv, &tpm_backends, list) { if (!drv->tpmif) { continue; } info = g_new0(TPMInfoList, 1); info->value = tpm_backend_query_tpm(drv); if (!cur_item) { head = cur_item = info; } else { cur_item->next = info; cur_item = info; } } return head; } TpmTypeList *qmp_query_tpm_types(Error **errp) { unsigned int i = 0; TpmTypeList *head = NULL, *prev = NULL, *cur_item; for (i = 0; i < TPM_TYPE__MAX; i++) { if (!tpm_be_find_by_type(i)) { continue; } cur_item = g_new0(TpmTypeList, 1); cur_item->value = i; if (prev) { prev->next = cur_item; } if (!head) { head = cur_item; } prev = cur_item; } return head; } TpmModelList *qmp_query_tpm_models(Error **errp) { TpmModelList *head = NULL, *prev = NULL, *cur_item; GSList *e, *l = object_class_get_list(TYPE_TPM_IF, false); for (e = l; e; e = e->next) { TPMIfClass *c = TPM_IF_CLASS(e->data); cur_item = g_new0(TpmModelList, 1); cur_item->value = c->model; if (prev) { prev->next = cur_item; } if (!head) { head = cur_item; } prev = cur_item; } g_slist_free(l); return head; }