]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/megasas-test.c
2 * QTest testcase for LSI MegaRAID
4 * Copyright (c) 2017 Red Hat Inc.
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
10 #include "qemu/osdep.h"
12 #include "qemu/bswap.h"
13 #include "libqos/libqos-pc.h"
14 #include "libqos/libqos-spapr.h"
16 static QOSState
*qmegasas_start(const char *extra_opts
)
18 const char *arch
= qtest_get_arch();
19 const char *cmd
= "-drive id=hd0,if=none,file=null-co://,format=raw "
20 "-device megasas,id=scsi0,addr=04.0 "
21 "-device scsi-hd,bus=scsi0.0,drive=hd0 %s";
23 if (strcmp(arch
, "i386") == 0 || strcmp(arch
, "x86_64") == 0) {
24 return qtest_pc_boot(cmd
, extra_opts
? : "");
27 g_printerr("virtio-scsi tests are only available on x86 or ppc64\n");
31 static void qmegasas_stop(QOSState
*qs
)
36 /* Tests only initialization so far. TODO: Replace with functional tests */
37 static void pci_nop(void)
41 qs
= qmegasas_start(NULL
);
45 int main(int argc
, char **argv
)
47 g_test_init(&argc
, &argv
, NULL
);
48 qtest_add_func("/megasas/pci/nop", pci_nop
);