]> git.proxmox.com Git - mirror_qemu.git/blame - hw/9pfs/9p-synth.h
migration/postcopy: mis->have_listen_thread check will never be touched
[mirror_qemu.git] / hw / 9pfs / 9p-synth.h
CommitLineData
9db221ae 1/*
364031f1 2 * 9p
9db221ae
AK
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
121d0712
MA
14#ifndef QEMU_9P_SYNTH_H
15#define QEMU_9P_SYNTH_H
9db221ae
AK
16
17typedef struct V9fsSynthNode V9fsSynthNode;
18typedef ssize_t (*v9fs_synth_read)(void *buf, int len, off_t offset,
19 void *arg);
20typedef ssize_t (*v9fs_synth_write)(void *buf, int len, off_t offset,
21 void *arg);
22typedef struct V9fsSynthNodeAttr {
23 int mode;
24 int inode;
25 int nlink;
26 v9fs_synth_read read;
27 v9fs_synth_write write;
28} V9fsSynthNodeAttr;
29
30struct V9fsSynthNode {
31 QLIST_HEAD(, V9fsSynthNode) child;
32 QLIST_ENTRY(V9fsSynthNode) sibling;
33 char name[NAME_MAX];
34 V9fsSynthNodeAttr *attr;
35 V9fsSynthNodeAttr actual_attr;
36 void *private;
37 int open_count;
38};
39
40typedef struct V9fsSynthOpenState {
41 off_t offset;
42 V9fsSynthNode *node;
635324e8 43 struct dirent dent;
9db221ae
AK
44} V9fsSynthOpenState;
45
bc70a592
GK
46int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
47 const char *name, V9fsSynthNode **result);
48int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
49 const char *name, v9fs_synth_read read,
50 v9fs_synth_write write, void *arg);
cb9c377f 51
2893ddd5
GK
52/* qtest stuff */
53
54#define QTEST_V9FS_SYNTH_WALK_FILE "WALK%d"
82469aae 55#define QTEST_V9FS_SYNTH_LOPEN_FILE "LOPEN"
354b86f8 56#define QTEST_V9FS_SYNTH_WRITE_FILE "WRITE"
2893ddd5 57
357e2f7f
GK
58/* Any write to the "FLUSH" file is handled one byte at a time by the
59 * backend. If the byte is zero, the backend returns success (ie, 1),
60 * otherwise it forces the server to try again forever. Thus allowing
61 * the client to cancel the request.
62 */
63#define QTEST_V9FS_SYNTH_FLUSH_FILE "FLUSH"
64
cb9c377f 65#endif