diff options
author | Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> | 2014-08-11 14:43:46 +0900 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-08-29 10:46:57 +0100 |
commit | 38890b246d7c21d29ac50831c0792994cf289a2c (patch) | |
tree | d6ee5f87fbc9884a38a59ebd1dd587de82f2f1c1 /block/sheepdog.c | |
parent | 1dbfafed7f0478fde29de7b69692c4d58b9e6c25 (diff) | |
download | qemu-38890b246d7c21d29ac50831c0792994cf289a2c.tar.gz qemu-38890b246d7c21d29ac50831c0792994cf289a2c.tar.bz2 qemu-38890b246d7c21d29ac50831c0792994cf289a2c.zip |
sheepdog: improve error handling for a case of failed lock
Recently, sheepdog revived its VDI locking functionality. This patch
updates sheepdog driver of QEMU for this feature. It changes an error
code for a case of failed locking. -EBUSY is a suitable one.
Reported-by: Valerio Pachera <sirio81@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Liu Yuan <namei.unix@gmail.com>
Cc: MORITA Kazutaka <morita.kazutaka@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 93c0266fea..49a9a9e5eb 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1115,6 +1115,8 @@ static int find_vdi_name(BDRVSheepdogState *s, const char *filename, sd_strerror(rsp->result), filename, snapid, tag); if (rsp->result == SD_RES_NO_VDI) { ret = -ENOENT; + } else if (rsp->result == SD_RES_VDI_LOCKED) { + ret = -EBUSY; } else { ret = -EIO; } |