[sheepdog] [PATCH 2/3] sheep: return default copy number as formated

Liu Yuan namei.unix at gmail.com
Fri Aug 30 13:43:39 CEST 2013


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>
---
 sheep/vdi.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 532db93..e1667ef 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -76,8 +76,9 @@ int get_vdi_copy_number(uint32_t vid)
 	sd_unlock(&vdi_state_lock);
 
 	if (!entry) {
-		sd_alert("No VDI copy entry for %" PRIx32 " found", vid);
-		return SD_DEFAULT_COPIES;
+		sd_alert("copy number for %" PRIx32 " not found, set %d", vid,
+			 sys->cinfo.nr_copies);
+		return sys->cinfo.nr_copies;
 	}
 
 	return entry->nr_copies;
-- 
1.7.9.5




More information about the sheepdog mailing list