[sheepdog] [PATCH stable-0.7] sheep: return default copy number as formated

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Tue Oct 29 02:58:38 CET 2013

From: Liu Yuan <namei.unix at gmail.com>

We should return cinfo.nr_copies, which is the number as formated, for
get_vdi_copy_number() if copy number isn't found during init.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>


The conflict was manually solved by Hitoshi Mitake.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
 sheep/vdi.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 11644e0..1e05e4f 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -100,8 +100,9 @@ int get_vdi_copy_number(uint32_t vid)
 	if (!entry) {
-		sd_err("No VDI copy entry for %" PRIx32 " found", vid);
-		return 0;
+		sd_alert("copy number for %" PRIx32 " not found, set %d", vid,
+			 sys->cinfo.nr_copies);
+		return sys->cinfo.nr_copies;
 	return entry->nr_copies;

More information about the sheepdog mailing list