Small requirements on "new" features have percolated to virtio-9p-local.c.
In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD
and flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments
so that virtio-9p-local.c will not use AT_* constants.
At the same time, fail local_ioc_getversion if the ioctl is not supported
by the host.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char buffer[PATH_MAX];
char *path = fs_path->data;
- return qemu_utimensat(AT_FDCWD, rpath(s, path, buffer), buf,
- AT_SYMLINK_NOFOLLOW);
+ return qemu_utimens(rpath(s, path, buffer), buf);
}
static int local_remove(FsContext *ctx, const char *path)
mode_t st_mode, uint64_t *st_gen)
{
int err;
+#ifdef FS_IOC_GETVERSION
V9fsFidOpenState fid_open;
/*
}
err = ioctl(fid_open.fd, FS_IOC_GETVERSION, st_gen);
local_close(ctx, &fid_open);
+#else
+ err = -ENOTTY;
+#endif
return err;
}
return ret;
}
-int qemu_utimensat(int dirfd, const char *path, const struct timespec *times,
- int flags)
+int qemu_utimens(const char *path, const struct timespec *times)
{
struct timeval tv[2], tv_now;
struct stat st;
#ifdef CONFIG_UTIMENSAT
int ret;
- ret = utimensat(dirfd, path, times, flags);
+ ret = utimensat(AT_FDCWD, path, times, AT_SYMLINK_NOFOLLOW);
if (ret != -1 || errno != ENOSYS) {
return ret;
}
#endif
#endif
typedef struct timespec qemu_timespec;
-int qemu_utimensat(int dirfd, const char *path, const qemu_timespec *times,
- int flags);
+int qemu_utimens(const char *path, const qemu_timespec *times);
#endif