From dba3432b88f925db409bb232183e7c961eb2df58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Fri, 4 Jul 2014 15:58:39 +0200 Subject: [PATCH] virt-lxc-convert: make free return values in bytes Tiny fix for virt-lxc-convert: we are setting memory values in bytes, while free may give us values in a different unit by default: force free to output bytes with -b flag. --- examples/lxcconvert/virt-lxc-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lxcconvert/virt-lxc-convert b/examples/lxcconvert/virt-lxc-convert index 722015310f..e62172eea4 100644 --- a/examples/lxcconvert/virt-lxc-convert +++ b/examples/lxcconvert/virt-lxc-convert @@ -64,7 +64,7 @@ if test -r "$fstab"; then sed 's/^\([^#]\)/lxc.mount.entry = \1/' "$fstab" >>"${conf_new}" fi -memory=$(free | sed -n '/Mem:/s/ \+/ /gp' | cut -f 2 -d ' ') +memory=$(free -b | sed -n '/Mem:/s/ \+/ /gp' | cut -f 2 -d ' ') default_tmpfs="size=$((memory/2))" # Do we have tmpfs without size param? -- GitLab