~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208301614

« back to all changes in this revision

Viewing changes to debian/patches/0095-lxc-clone-change-uuid-on-xfs.patch

  • Committer: Serge Hallyn
  • Date: 2012-07-26 17:58:42 UTC
  • Revision ID: serge@serge-laptop-20120726175842-uvip2ssxtfakmhpq
[ Serge Hallyn ]
* lxc.lxc-net.upstart: replace the check for USE_LXC_BRIDGE (which could be
  changed from true to false after starting lxc-net) with one for the
  existence /var/run/lxc.  (LP: #1019290)
* 0095-lxc-clone-change-uuid-on-xfs.patch: give each cloned xfs-backed
  lvm partition a unique uuid so they can be mounted simultaneously.
  (LP: #1013549)
* 0096-lxc-wait-add-timeout.patch: patch submitted upstream to add a timeout
  option to lxc-wait.  (LP: #1020179)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From ccdfabfc11d0620038b7517ab35a673bf3241771 Mon Sep 17 00:00:00 2001
 
2
From: Serge Hallyn <serge.hallyn@ubuntu.com>
 
3
Date: Thu, 12 Jul 2012 16:33:14 -0500
 
4
Subject: [PATCH 1/1] lxc-clone: change uuid on xfs
 
5
 
 
6
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
 
7
---
 
8
 src/lxc/lxc-clone.in |    8 +++++++-
 
9
 1 file changed, 7 insertions(+), 1 deletion(-)
 
10
 
 
11
Index: lxc/src/lxc/lxc-clone.in
 
12
===================================================================
 
13
--- lxc.orig/src/lxc/lxc-clone.in       2012-07-26 17:38:04.928037000 +0000
 
14
+++ lxc/src/lxc/lxc-clone.in    2012-07-26 17:44:13.953353607 +0000
 
15
@@ -207,7 +207,13 @@
 
16
     if [ $lxc_size = "_unset" ]; then
 
17
         lxc_size=`lvdisplay $oldroot | grep Size | awk '{ print $3 $4 }'`
 
18
     fi
 
19
-    lvcreate -s -L $lxc_size -n ${lxc_lv_prefix}${lxc_new}_snapshot $oldroot
 
20
+    newlv="${lxc_lv_prefix}${lxc_new}_snapshot"
 
21
+    lvcreate -s -L $lxc_size -n $newlv $oldroot
 
22
+    type xfs_admin > /dev/null 2>&1 && {
 
23
+        # change filesystem UUID if it is an xfs filesystem
 
24
+        xfs_admin -u /dev/$lxc_vg/$newlv && xfs_admin -U generate /dev/$lxc_vg/$newlv
 
25
+    }
 
26
+            
 
27
     if [ $container_running = "True" ]; then
 
28
         lxc-unfreeze -n $lxc_orig
 
29
         frozen=0