scsi-generic: keep VPD page list sorted
[qemu/ar7.git] / tests / virtio-9p-test.c
bloba2b31085f6d857762058622d5ab63b442e6c1be9
1 /*
2 * QTest testcase for VirtIO 9P
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
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.
8 */
10 #include "qemu/osdep.h"
11 #include "libqtest.h"
12 #include "qemu-common.h"
13 #include "libqos/libqos-pc.h"
14 #include "libqos/libqos-spapr.h"
15 #include "libqos/virtio.h"
16 #include "libqos/virtio-pci.h"
17 #include "standard-headers/linux/virtio_ids.h"
18 #include "standard-headers/linux/virtio_pci.h"
19 #include "hw/9pfs/9p.h"
20 #include "hw/9pfs/9p-synth.h"
22 #define QVIRTIO_9P_TIMEOUT_US (10 * 1000 * 1000)
24 static const char mount_tag[] = "qtest";
26 typedef struct {
27 QVirtioDevice *dev;
28 QOSState *qs;
29 QVirtQueue *vq;
30 } QVirtIO9P;
32 static QVirtIO9P *qvirtio_9p_start(const char *driver)
34 const char *arch = qtest_get_arch();
35 const char *cmd = "-fsdev synth,id=fsdev0 "
36 "-device %s,fsdev=fsdev0,mount_tag=%s";
37 QVirtIO9P *v9p = g_new0(QVirtIO9P, 1);
39 if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
40 v9p->qs = qtest_pc_boot(cmd, driver, mount_tag);
41 } else if (strcmp(arch, "ppc64") == 0) {
42 v9p->qs = qtest_spapr_boot(cmd, driver, mount_tag);
43 } else {
44 g_printerr("virtio-9p tests are only available on x86 or ppc64\n");
45 exit(EXIT_FAILURE);
47 global_qtest = v9p->qs->qts;
49 return v9p;
52 static void qvirtio_9p_stop(QVirtIO9P *v9p)
54 qtest_shutdown(v9p->qs);
55 g_free(v9p);
58 static QVirtIO9P *qvirtio_9p_pci_start(void)
60 QVirtIO9P *v9p = qvirtio_9p_start("virtio-9p-pci");
61 QVirtioPCIDevice *dev = qvirtio_pci_device_find(v9p->qs->pcibus,
62 VIRTIO_ID_9P);
63 g_assert_nonnull(dev);
64 g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_9P);
65 v9p->dev = (QVirtioDevice *) dev;
67 qvirtio_pci_device_enable(dev);
68 qvirtio_reset(v9p->dev);
69 qvirtio_set_acknowledge(v9p->dev);
70 qvirtio_set_driver(v9p->dev);
72 v9p->vq = qvirtqueue_setup(v9p->dev, v9p->qs->alloc, 0);
74 qvirtio_set_driver_ok(v9p->dev);
76 return v9p;
79 static void qvirtio_9p_pci_stop(QVirtIO9P *v9p)
81 qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->qs->alloc);
82 qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev));
83 qvirtio_pci_device_free((QVirtioPCIDevice *)v9p->dev);
84 qvirtio_9p_stop(v9p);
87 static void pci_config(QVirtIO9P *v9p)
89 size_t tag_len = qvirtio_config_readw(v9p->dev, 0);
90 char *tag;
91 int i;
93 g_assert_cmpint(tag_len, ==, strlen(mount_tag));
95 tag = g_malloc(tag_len);
96 for (i = 0; i < tag_len; i++) {
97 tag[i] = qvirtio_config_readb(v9p->dev, i + 2);
99 g_assert_cmpmem(tag, tag_len, mount_tag, tag_len);
100 g_free(tag);
103 #define P9_MAX_SIZE 4096 /* Max size of a T-message or R-message */
105 typedef struct {
106 QVirtIO9P *v9p;
107 uint16_t tag;
108 uint64_t t_msg;
109 uint32_t t_size;
110 uint64_t r_msg;
111 /* No r_size, it is hardcoded to P9_MAX_SIZE */
112 size_t t_off;
113 size_t r_off;
114 uint32_t free_head;
115 } P9Req;
117 static void v9fs_memwrite(P9Req *req, const void *addr, size_t len)
119 memwrite(req->t_msg + req->t_off, addr, len);
120 req->t_off += len;
123 static void v9fs_memskip(P9Req *req, size_t len)
125 req->r_off += len;
128 static void v9fs_memread(P9Req *req, void *addr, size_t len)
130 memread(req->r_msg + req->r_off, addr, len);
131 req->r_off += len;
134 static void v9fs_uint16_write(P9Req *req, uint16_t val)
136 uint16_t le_val = cpu_to_le16(val);
138 v9fs_memwrite(req, &le_val, 2);
141 static void v9fs_uint16_read(P9Req *req, uint16_t *val)
143 v9fs_memread(req, val, 2);
144 le16_to_cpus(val);
147 static void v9fs_uint32_write(P9Req *req, uint32_t val)
149 uint32_t le_val = cpu_to_le32(val);
151 v9fs_memwrite(req, &le_val, 4);
154 static void v9fs_uint64_write(P9Req *req, uint64_t val)
156 uint64_t le_val = cpu_to_le64(val);
158 v9fs_memwrite(req, &le_val, 8);
161 static void v9fs_uint32_read(P9Req *req, uint32_t *val)
163 v9fs_memread(req, val, 4);
164 le32_to_cpus(val);
167 /* len[2] string[len] */
168 static uint16_t v9fs_string_size(const char *string)
170 size_t len = strlen(string);
172 g_assert_cmpint(len, <=, UINT16_MAX - 2);
174 return 2 + len;
177 static void v9fs_string_write(P9Req *req, const char *string)
179 int len = strlen(string);
181 g_assert_cmpint(len, <=, UINT16_MAX);
183 v9fs_uint16_write(req, (uint16_t) len);
184 v9fs_memwrite(req, string, len);
187 static void v9fs_string_read(P9Req *req, uint16_t *len, char **string)
189 uint16_t local_len;
191 v9fs_uint16_read(req, &local_len);
192 if (len) {
193 *len = local_len;
195 if (string) {
196 *string = g_malloc(local_len);
197 v9fs_memread(req, *string, local_len);
198 } else {
199 v9fs_memskip(req, local_len);
203 typedef struct {
204 uint32_t size;
205 uint8_t id;
206 uint16_t tag;
207 } QEMU_PACKED P9Hdr;
209 static P9Req *v9fs_req_init(QVirtIO9P *v9p, uint32_t size, uint8_t id,
210 uint16_t tag)
212 P9Req *req = g_new0(P9Req, 1);
213 uint32_t total_size = 7; /* 9P header has well-known size of 7 bytes */
214 P9Hdr hdr = {
215 .id = id,
216 .tag = cpu_to_le16(tag)
219 g_assert_cmpint(total_size, <=, UINT32_MAX - size);
220 total_size += size;
221 hdr.size = cpu_to_le32(total_size);
223 g_assert_cmpint(total_size, <=, P9_MAX_SIZE);
225 req->v9p = v9p;
226 req->t_size = total_size;
227 req->t_msg = guest_alloc(v9p->qs->alloc, req->t_size);
228 v9fs_memwrite(req, &hdr, 7);
229 req->tag = tag;
230 return req;
233 static void v9fs_req_send(P9Req *req)
235 QVirtIO9P *v9p = req->v9p;
237 req->r_msg = guest_alloc(v9p->qs->alloc, P9_MAX_SIZE);
238 req->free_head = qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, false,
239 true);
240 qvirtqueue_add(v9p->vq, req->r_msg, P9_MAX_SIZE, true, false);
241 qvirtqueue_kick(v9p->dev, v9p->vq, req->free_head);
242 req->t_off = 0;
245 static const char *rmessage_name(uint8_t id)
247 return
248 id == P9_RLERROR ? "RLERROR" :
249 id == P9_RVERSION ? "RVERSION" :
250 id == P9_RATTACH ? "RATTACH" :
251 id == P9_RWALK ? "RWALK" :
252 id == P9_RLOPEN ? "RLOPEN" :
253 id == P9_RWRITE ? "RWRITE" :
254 id == P9_RFLUSH ? "RFLUSH" :
255 "<unknown>";
258 static void v9fs_req_wait_for_reply(P9Req *req, uint32_t *len)
260 QVirtIO9P *v9p = req->v9p;
262 qvirtio_wait_used_elem(v9p->dev, v9p->vq, req->free_head, len,
263 QVIRTIO_9P_TIMEOUT_US);
266 static void v9fs_req_recv(P9Req *req, uint8_t id)
268 P9Hdr hdr;
270 v9fs_memread(req, &hdr, 7);
271 hdr.size = ldl_le_p(&hdr.size);
272 hdr.tag = lduw_le_p(&hdr.tag);
274 g_assert_cmpint(hdr.size, >=, 7);
275 g_assert_cmpint(hdr.size, <=, P9_MAX_SIZE);
276 g_assert_cmpint(hdr.tag, ==, req->tag);
278 if (hdr.id != id) {
279 g_printerr("Received response %d (%s) instead of %d (%s)\n",
280 hdr.id, rmessage_name(hdr.id), id, rmessage_name(id));
282 if (hdr.id == P9_RLERROR) {
283 uint32_t err;
284 v9fs_uint32_read(req, &err);
285 g_printerr("Rlerror has errno %d (%s)\n", err, strerror(err));
288 g_assert_cmpint(hdr.id, ==, id);
291 static void v9fs_req_free(P9Req *req)
293 QVirtIO9P *v9p = req->v9p;
295 guest_free(v9p->qs->alloc, req->t_msg);
296 guest_free(v9p->qs->alloc, req->r_msg);
297 g_free(req);
300 /* size[4] Rlerror tag[2] ecode[4] */
301 static void v9fs_rlerror(P9Req *req, uint32_t *err)
303 v9fs_req_recv(req, P9_RLERROR);
304 v9fs_uint32_read(req, err);
305 v9fs_req_free(req);
308 /* size[4] Tversion tag[2] msize[4] version[s] */
309 static P9Req *v9fs_tversion(QVirtIO9P *v9p, uint32_t msize, const char *version,
310 uint16_t tag)
312 P9Req *req;
313 uint32_t body_size = 4;
314 uint16_t string_size = v9fs_string_size(version);
316 g_assert_cmpint(body_size, <=, UINT32_MAX - string_size);
317 body_size += string_size;
318 req = v9fs_req_init(v9p, body_size, P9_TVERSION, tag);
320 v9fs_uint32_write(req, msize);
321 v9fs_string_write(req, version);
322 v9fs_req_send(req);
323 return req;
326 /* size[4] Rversion tag[2] msize[4] version[s] */
327 static void v9fs_rversion(P9Req *req, uint16_t *len, char **version)
329 uint32_t msize;
331 v9fs_req_recv(req, P9_RVERSION);
332 v9fs_uint32_read(req, &msize);
334 g_assert_cmpint(msize, ==, P9_MAX_SIZE);
336 if (len || version) {
337 v9fs_string_read(req, len, version);
340 v9fs_req_free(req);
343 /* size[4] Tattach tag[2] fid[4] afid[4] uname[s] aname[s] n_uname[4] */
344 static P9Req *v9fs_tattach(QVirtIO9P *v9p, uint32_t fid, uint32_t n_uname,
345 uint16_t tag)
347 const char *uname = ""; /* ignored by QEMU */
348 const char *aname = ""; /* ignored by QEMU */
349 P9Req *req = v9fs_req_init(v9p, 4 + 4 + 2 + 2 + 4, P9_TATTACH, tag);
351 v9fs_uint32_write(req, fid);
352 v9fs_uint32_write(req, P9_NOFID);
353 v9fs_string_write(req, uname);
354 v9fs_string_write(req, aname);
355 v9fs_uint32_write(req, n_uname);
356 v9fs_req_send(req);
357 return req;
360 typedef char v9fs_qid[13];
362 /* size[4] Rattach tag[2] qid[13] */
363 static void v9fs_rattach(P9Req *req, v9fs_qid *qid)
365 v9fs_req_recv(req, P9_RATTACH);
366 if (qid) {
367 v9fs_memread(req, qid, 13);
369 v9fs_req_free(req);
372 /* size[4] Twalk tag[2] fid[4] newfid[4] nwname[2] nwname*(wname[s]) */
373 static P9Req *v9fs_twalk(QVirtIO9P *v9p, uint32_t fid, uint32_t newfid,
374 uint16_t nwname, char *const wnames[], uint16_t tag)
376 P9Req *req;
377 int i;
378 uint32_t body_size = 4 + 4 + 2;
380 for (i = 0; i < nwname; i++) {
381 uint16_t wname_size = v9fs_string_size(wnames[i]);
383 g_assert_cmpint(body_size, <=, UINT32_MAX - wname_size);
384 body_size += wname_size;
386 req = v9fs_req_init(v9p, body_size, P9_TWALK, tag);
387 v9fs_uint32_write(req, fid);
388 v9fs_uint32_write(req, newfid);
389 v9fs_uint16_write(req, nwname);
390 for (i = 0; i < nwname; i++) {
391 v9fs_string_write(req, wnames[i]);
393 v9fs_req_send(req);
394 return req;
397 /* size[4] Rwalk tag[2] nwqid[2] nwqid*(wqid[13]) */
398 static void v9fs_rwalk(P9Req *req, uint16_t *nwqid, v9fs_qid **wqid)
400 uint16_t local_nwqid;
402 v9fs_req_recv(req, P9_RWALK);
403 v9fs_uint16_read(req, &local_nwqid);
404 if (nwqid) {
405 *nwqid = local_nwqid;
407 if (wqid) {
408 *wqid = g_malloc(local_nwqid * 13);
409 v9fs_memread(req, *wqid, local_nwqid * 13);
411 v9fs_req_free(req);
414 /* size[4] Tlopen tag[2] fid[4] flags[4] */
415 static P9Req *v9fs_tlopen(QVirtIO9P *v9p, uint32_t fid, uint32_t flags,
416 uint16_t tag)
418 P9Req *req;
420 req = v9fs_req_init(v9p, 4 + 4, P9_TLOPEN, tag);
421 v9fs_uint32_write(req, fid);
422 v9fs_uint32_write(req, flags);
423 v9fs_req_send(req);
424 return req;
427 /* size[4] Rlopen tag[2] qid[13] iounit[4] */
428 static void v9fs_rlopen(P9Req *req, v9fs_qid *qid, uint32_t *iounit)
430 v9fs_req_recv(req, P9_RLOPEN);
431 if (qid) {
432 v9fs_memread(req, qid, 13);
433 } else {
434 v9fs_memskip(req, 13);
436 if (iounit) {
437 v9fs_uint32_read(req, iounit);
439 v9fs_req_free(req);
442 /* size[4] Twrite tag[2] fid[4] offset[8] count[4] data[count] */
443 static P9Req *v9fs_twrite(QVirtIO9P *v9p, uint32_t fid, uint64_t offset,
444 uint32_t count, const void *data, uint16_t tag)
446 P9Req *req;
447 uint32_t body_size = 4 + 8 + 4;
449 g_assert_cmpint(body_size, <=, UINT32_MAX - count);
450 body_size += count;
451 req = v9fs_req_init(v9p, body_size, P9_TWRITE, tag);
452 v9fs_uint32_write(req, fid);
453 v9fs_uint64_write(req, offset);
454 v9fs_uint32_write(req, count);
455 v9fs_memwrite(req, data, count);
456 v9fs_req_send(req);
457 return req;
460 /* size[4] Rwrite tag[2] count[4] */
461 static void v9fs_rwrite(P9Req *req, uint32_t *count)
463 v9fs_req_recv(req, P9_RWRITE);
464 if (count) {
465 v9fs_uint32_read(req, count);
467 v9fs_req_free(req);
470 /* size[4] Tflush tag[2] oldtag[2] */
471 static P9Req *v9fs_tflush(QVirtIO9P *v9p, uint16_t oldtag, uint16_t tag)
473 P9Req *req;
475 req = v9fs_req_init(v9p, 2, P9_TFLUSH, tag);
476 v9fs_uint32_write(req, oldtag);
477 v9fs_req_send(req);
478 return req;
481 /* size[4] Rflush tag[2] */
482 static void v9fs_rflush(P9Req *req)
484 v9fs_req_recv(req, P9_RFLUSH);
485 v9fs_req_free(req);
488 static void fs_version(QVirtIO9P *v9p)
490 const char *version = "9P2000.L";
491 uint16_t server_len;
492 char *server_version;
493 P9Req *req;
495 req = v9fs_tversion(v9p, P9_MAX_SIZE, version, P9_NOTAG);
496 v9fs_req_wait_for_reply(req, NULL);
497 v9fs_rversion(req, &server_len, &server_version);
499 g_assert_cmpmem(server_version, server_len, version, strlen(version));
501 g_free(server_version);
504 static void fs_attach(QVirtIO9P *v9p)
506 P9Req *req;
508 fs_version(v9p);
509 req = v9fs_tattach(v9p, 0, getuid(), 0);
510 v9fs_req_wait_for_reply(req, NULL);
511 v9fs_rattach(req, NULL);
514 static void fs_walk(QVirtIO9P *v9p)
516 char *wnames[P9_MAXWELEM];
517 uint16_t nwqid;
518 v9fs_qid *wqid;
519 int i;
520 P9Req *req;
522 for (i = 0; i < P9_MAXWELEM; i++) {
523 wnames[i] = g_strdup_printf(QTEST_V9FS_SYNTH_WALK_FILE, i);
526 fs_attach(v9p);
527 req = v9fs_twalk(v9p, 0, 1, P9_MAXWELEM, wnames, 0);
528 v9fs_req_wait_for_reply(req, NULL);
529 v9fs_rwalk(req, &nwqid, &wqid);
531 g_assert_cmpint(nwqid, ==, P9_MAXWELEM);
533 for (i = 0; i < P9_MAXWELEM; i++) {
534 g_free(wnames[i]);
537 g_free(wqid);
540 static void fs_walk_no_slash(QVirtIO9P *v9p)
542 char *const wnames[] = { g_strdup(" /") };
543 P9Req *req;
544 uint32_t err;
546 fs_attach(v9p);
547 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
548 v9fs_req_wait_for_reply(req, NULL);
549 v9fs_rlerror(req, &err);
551 g_assert_cmpint(err, ==, ENOENT);
553 g_free(wnames[0]);
556 static void fs_walk_dotdot(QVirtIO9P *v9p)
558 char *const wnames[] = { g_strdup("..") };
559 v9fs_qid root_qid, *wqid;
560 P9Req *req;
562 fs_version(v9p);
563 req = v9fs_tattach(v9p, 0, getuid(), 0);
564 v9fs_req_wait_for_reply(req, NULL);
565 v9fs_rattach(req, &root_qid);
567 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
568 v9fs_req_wait_for_reply(req, NULL);
569 v9fs_rwalk(req, NULL, &wqid); /* We now we'll get one qid */
571 g_assert_cmpmem(&root_qid, 13, wqid[0], 13);
573 g_free(wqid);
574 g_free(wnames[0]);
577 static void fs_lopen(QVirtIO9P *v9p)
579 char *const wnames[] = { g_strdup(QTEST_V9FS_SYNTH_LOPEN_FILE) };
580 P9Req *req;
582 fs_attach(v9p);
583 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
584 v9fs_req_wait_for_reply(req, NULL);
585 v9fs_rwalk(req, NULL, NULL);
587 req = v9fs_tlopen(v9p, 1, O_WRONLY, 0);
588 v9fs_req_wait_for_reply(req, NULL);
589 v9fs_rlopen(req, NULL, NULL);
591 g_free(wnames[0]);
594 static void fs_write(QVirtIO9P *v9p)
596 static const uint32_t write_count = P9_MAX_SIZE / 2;
597 char *const wnames[] = { g_strdup(QTEST_V9FS_SYNTH_WRITE_FILE) };
598 char *buf = g_malloc0(write_count);
599 uint32_t count;
600 P9Req *req;
602 fs_attach(v9p);
603 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
604 v9fs_req_wait_for_reply(req, NULL);
605 v9fs_rwalk(req, NULL, NULL);
607 req = v9fs_tlopen(v9p, 1, O_WRONLY, 0);
608 v9fs_req_wait_for_reply(req, NULL);
609 v9fs_rlopen(req, NULL, NULL);
611 req = v9fs_twrite(v9p, 1, 0, write_count, buf, 0);
612 v9fs_req_wait_for_reply(req, NULL);
613 v9fs_rwrite(req, &count);
614 g_assert_cmpint(count, ==, write_count);
616 g_free(buf);
617 g_free(wnames[0]);
620 static void fs_flush_success(QVirtIO9P *v9p)
622 char *const wnames[] = { g_strdup(QTEST_V9FS_SYNTH_FLUSH_FILE) };
623 P9Req *req, *flush_req;
624 uint32_t reply_len;
625 uint8_t should_block;
627 fs_attach(v9p);
628 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
629 v9fs_req_wait_for_reply(req, NULL);
630 v9fs_rwalk(req, NULL, NULL);
632 req = v9fs_tlopen(v9p, 1, O_WRONLY, 0);
633 v9fs_req_wait_for_reply(req, NULL);
634 v9fs_rlopen(req, NULL, NULL);
636 /* This will cause the 9p server to try to write data to the backend,
637 * until the write request gets cancelled.
639 should_block = 1;
640 req = v9fs_twrite(v9p, 1, 0, sizeof(should_block), &should_block, 0);
642 flush_req = v9fs_tflush(v9p, req->tag, 1);
644 /* The write request is supposed to be flushed: the server should just
645 * mark the write request as used and reply to the flush request.
647 v9fs_req_wait_for_reply(req, &reply_len);
648 g_assert_cmpint(reply_len, ==, 0);
649 v9fs_req_free(req);
650 v9fs_rflush(flush_req);
652 g_free(wnames[0]);
655 static void fs_flush_ignored(QVirtIO9P *v9p)
657 char *const wnames[] = { g_strdup(QTEST_V9FS_SYNTH_FLUSH_FILE) };
658 P9Req *req, *flush_req;
659 uint32_t count;
660 uint8_t should_block;
662 fs_attach(v9p);
663 req = v9fs_twalk(v9p, 0, 1, 1, wnames, 0);
664 v9fs_req_wait_for_reply(req, NULL);
665 v9fs_rwalk(req, NULL, NULL);
667 req = v9fs_tlopen(v9p, 1, O_WRONLY, 0);
668 v9fs_req_wait_for_reply(req, NULL);
669 v9fs_rlopen(req, NULL, NULL);
671 /* This will cause the write request to complete right away, before it
672 * could be actually cancelled.
674 should_block = 0;
675 req = v9fs_twrite(v9p, 1, 0, sizeof(should_block), &should_block, 0);
677 flush_req = v9fs_tflush(v9p, req->tag, 1);
679 /* The write request is supposed to complete. The server should
680 * reply to the write request and the flush request.
682 v9fs_req_wait_for_reply(req, NULL);
683 v9fs_rwrite(req, &count);
684 g_assert_cmpint(count, ==, sizeof(should_block));
685 v9fs_rflush(flush_req);
687 g_free(wnames[0]);
690 typedef void (*v9fs_test_fn)(QVirtIO9P *v9p);
692 static void v9fs_run_pci_test(gconstpointer data)
694 v9fs_test_fn fn = data;
695 QVirtIO9P *v9p = qvirtio_9p_pci_start();
697 if (fn) {
698 fn(v9p);
700 qvirtio_9p_pci_stop(v9p);
703 static void v9fs_qtest_pci_add(const char *path, v9fs_test_fn fn)
705 qtest_add_data_func(path, fn, v9fs_run_pci_test);
708 int main(int argc, char **argv)
710 g_test_init(&argc, &argv, NULL);
711 v9fs_qtest_pci_add("/virtio/9p/pci/nop", NULL);
712 v9fs_qtest_pci_add("/virtio/9p/pci/config", pci_config);
713 v9fs_qtest_pci_add("/virtio/9p/pci/fs/version/basic", fs_version);
714 v9fs_qtest_pci_add("/virtio/9p/pci/fs/attach/basic", fs_attach);
715 v9fs_qtest_pci_add("/virtio/9p/pci/fs/walk/basic", fs_walk);
716 v9fs_qtest_pci_add("/virtio/9p/pci/fs/walk/no_slash", fs_walk_no_slash);
717 v9fs_qtest_pci_add("/virtio/9p/pci/fs/walk/dotdot_from_root",
718 fs_walk_dotdot);
719 v9fs_qtest_pci_add("/virtio/9p/pci/fs/lopen/basic", fs_lopen);
720 v9fs_qtest_pci_add("/virtio/9p/pci/fs/write/basic", fs_write);
721 v9fs_qtest_pci_add("/virtio/9p/pci/fs/flush/success", fs_flush_success);
722 v9fs_qtest_pci_add("/virtio/9p/pci/fs/flush/ignored", fs_flush_ignored);
724 return g_test_run();