fsdev: improve error handling of backend init

This patch changes some error messages in the backend init code and
convert backends to propagate QEMU Error objects instead of calling
error_report().

One notable improvement is that the local backend now provides a more
detailed error report when it fails to open the shared directory.

Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
Greg Kurz 2018-01-08 11:18:23 +01:00
parent 91cda4e8f3
commit 65603a801e
6 changed files with 15 additions and 14 deletions

View file

@ -104,7 +104,7 @@ void cred_init(FsCred *);
struct FileOperations
{
int (*parse_opts)(QemuOpts *, FsDriverEntry *, Error **errp);
int (*init)(FsContext *);
int (*init)(FsContext *, Error **errp);
void (*cleanup)(FsContext *);
int (*lstat)(FsContext *, V9fsPath *, struct stat *);
ssize_t (*readlink)(FsContext *, V9fsPath *, char *, size_t);