[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 15/16] LXC from native: map block filesystems



---
 src/lxc/lxc_native.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 1c0f325..5ba6f94 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -471,6 +471,7 @@ lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab, unsigned long memory)
     bool readonly;
     int type = VIR_DOMAIN_FS_TYPE_MOUNT;
     unsigned long long usage = 0;
+    struct stat sb;
 
     if (fstab->dst[0] != '/') {
         if (virAsprintf(&dst, "/%s", fstab->dst) < 0)
@@ -501,6 +502,10 @@ lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab, unsigned long memory)
     } else if (VIR_STRDUP(src, fstab->src) < 0)
         goto error;
 
+    /* Is it a block device that needs special favor? */
+    if (stat(fstab->src, &sb) >= 0 && S_ISBLK(sb.st_mode))
+        type = VIR_DOMAIN_FS_TYPE_BLOCK;
+
     /* Do we have ro in options? */
     readonly = virStringArrayHasString(options, "ro");
 
-- 
1.8.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]