From 38890b246d7c21d29ac50831c0792994cf289a2c Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Mon, 11 Aug 2014 14:43:46 +0900 Subject: 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 Cc: Kevin Wolf Cc: Stefan Hajnoczi Cc: Liu Yuan Cc: MORITA Kazutaka Signed-off-by: Hitoshi Mitake Signed-off-by: Stefan Hajnoczi --- block/sheepdog.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/sheepdog.c') 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; } -- cgit v1.2.3