Revision 4750a96f hw/virtio-9p.c

b/hw/virtio-9p.c
180 180
    return s->ops->fstat(&s->ctx, fd, stbuf);
181 181
}
182 182

  
183
static int v9fs_do_open2(V9fsState *s, V9fsString *path, int flags, mode_t mode)
183
static int v9fs_do_open2(V9fsState *s, V9fsCreateState *vs)
184 184
{
185
    return s->ops->open2(&s->ctx, path->data, flags, mode);
185
    FsCred cred;
186
    int flags;
187

  
188
    cred_init(&cred);
189
    cred.fc_uid = vs->fidp->uid;
190
    cred.fc_mode = vs->perm & 0777;
191
    flags = omode_to_uflags(vs->mode) | O_CREAT;
192

  
193
    return s->ops->open2(&s->ctx, vs->fullname.data, flags, &cred);
186 194
}
187 195

  
188 196
static int v9fs_do_symlink(V9fsState *s, V9fsString *oldpath,
......
1815 1823
        err = v9fs_do_mksock(s, &vs->fullname);
1816 1824
        v9fs_create_post_mksock(s, vs, err);
1817 1825
    } else {
1818
        vs->fidp->fd = v9fs_do_open2(s, &vs->fullname,
1819
                                omode_to_uflags(vs->mode) | O_CREAT,
1820
                                vs->perm & 0777);
1826
        vs->fidp->fd = v9fs_do_open2(s, vs);
1821 1827
        v9fs_create_post_open2(s, vs, err);
1822 1828
    }
1823 1829

  

Also available in: Unified diff