From 7f6056fc4c2c9ad267da857c51e7ca09409e80fc Mon Sep 17 00:00:00 2001 From: Gao feng Date: Sun, 3 Apr 2016 12:24:08 +0800 Subject: [PATCH] create volume directory for non docker volume Signed-off-by: Gao feng --- src/container.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/container.c b/src/container.c index f78a313..ca4709b 100644 --- a/src/container.c +++ b/src/container.c @@ -78,9 +78,14 @@ static int container_setup_volume(struct hyper_container *container) return -1; } - if (vol->docker && container->initialize && - (container_populate_volume(vol->mountpoint, volume) < 0)) { - fprintf(stderr, "fail to populate volume %s\n", vol->mountpoint); + if (vol->docker) { + if (container->initialize && + (container_populate_volume(vol->mountpoint, volume) < 0)) { + fprintf(stderr, "fail to populate volume %s\n", vol->mountpoint); + return -1; + } + } else if (hyper_mkdir(volume) < 0) { + fprintf(stderr, "fail to create directroy %s\n", volume); return -1; }