diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-05-16 11:00:25 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-05-28 14:28:47 +0200 |
commit | efde4b625216b7066b56707d70ae3212edad0eea (patch) | |
tree | e21db423afd2b3b90b268f52afd3518005522654 /block/sheepdog.c | |
parent | e67c399363e39a4b78fa43f9cd0324ea1a7813bc (diff) |
block/sheepdog: Fix silent sd_open(), sd_create() failures
Open and create methods must set an error when they fail.
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 6e2f9812fe..7bf1275546 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1412,6 +1412,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, ret = parse_vdiname(s, filename, vdi, &snapid, tag); } if (ret < 0) { + error_setg(errp, "Can't parse filename"); goto out; } s->fd = get_sheep_fd(s, errp); @@ -1453,6 +1454,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, closesocket(fd); if (ret) { + error_setg(errp, "Can't read snapshot inode"); goto out; } @@ -1654,6 +1656,7 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, ret = parse_vdiname(s, filename, s->name, &snapid, tag); } if (ret < 0) { + error_setg(errp, "Can't parse filename"); goto out; } @@ -1677,6 +1680,8 @@ static int sd_create(const char *filename, QEMUOptionParameter *options, if (options->value.s) { ret = parse_redundancy(s, options->value.s); if (ret < 0) { + error_setg(errp, "Invalid redundancy mode: '%s'", + options->value.s); goto out; } } |