Revision 131dcb25 hw/virtio-9p.c

b/hw/virtio-9p.c
21 21
int dotu = 1;
22 22
int debug_9p_pdu;
23 23

  
24
static int v9fs_do_lstat(V9fsState *s, V9fsString *path, struct stat *stbuf)
25
{
26
    return s->ops->lstat(&s->ctx, path->data, stbuf);
27
}
28

  
29
static int v9fs_do_setuid(V9fsState *s, uid_t uid)
30
{
31
    return s->ops->setuid(&s->ctx, uid);
32
}
33

  
34
static ssize_t v9fs_do_readlink(V9fsState *s, V9fsString *path, V9fsString *buf)
35
{
36
    ssize_t len;
37

  
38
    buf->data = qemu_malloc(1024);
39

  
40
    len = s->ops->readlink(&s->ctx, path->data, buf->data, 1024 - 1);
41
    if (len > -1) {
42
        buf->size = len;
43
        buf->data[len] = 0;
44
    }
45

  
46
    return len;
47
}
48

  
49
static int v9fs_do_close(V9fsState *s, int fd)
50
{
51
    return s->ops->close(&s->ctx, fd);
52
}
53

  
54
static int v9fs_do_closedir(V9fsState *s, DIR *dir)
55
{
56
    return s->ops->closedir(&s->ctx, dir);
57
}
58

  
24 59
static void v9fs_string_init(V9fsString *str)
25 60
{
26 61
    str->data = NULL;
......
437 472
    (void) v9fs_string_sprintf;
438 473
    (void) v9fs_string_copy;
439 474
    (void) v9fs_string_size;
440

  
441

  
475
    (void) v9fs_do_lstat;
476
    (void) v9fs_do_setuid;
477
    (void) v9fs_do_readlink;
478
    (void) v9fs_do_close;
479
    (void) v9fs_do_closedir;
442 480
}
481

  
443 482
static void v9fs_version(V9fsState *s, V9fsPDU *pdu)
444 483
{
445 484
    if (debug_9p_pdu) {

Also available in: Unified diff