]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
tools/xend: drbd: fix things by reverting 20158
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 5 Jan 2011 23:31:24 +0000 (23:31 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 5 Jan 2011 23:31:24 +0000 (23:31 +0000)
drbd's block-drbd script handles all of the details that c/s 20158
introduces within xend :-(.  This c/s should be reverted as it causes
a regression.  Jim Fehlig tested drbd without 20158 and it works fine.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Jim Fehlig <jfehlig@novell.com>
tools/python/xen/util/blkif.py
tools/python/xen/xend/XendDomainInfo.py

index 92c8f3f4fdd09e69ff58eb74066c5c7b7b4dd33c..d68423c4c30b83126156f69efb981b3f2e2042e7 100644 (file)
@@ -71,15 +71,8 @@ def _parse_uname(uname):
     if uname.find(":") != -1:
         (typ, fn) = uname.split(":", 1)
 
-        if typ == "phy" and not fn.startswith("/"):
+        if typ in ("phy", "drbd") and not fn.startswith("/"):
             fn = "/dev/%s" %(fn,)
-
-        if typ == "drbd":
-            if not fn.startswith("drbd"):
-                (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "sh-dev", fn])
-                fn = drbdadmstdout.readline().strip()
-            else:
-                fn = "/dev/%s" %(fn,)
                
         if typ in ("tap", "tap2"):
             (taptype, fn) = fn.split(":", 1)
index 6c4b04447831bf40adf5e838c69ff37ed7edbcc2..89403be7d68627fa18af790b4c286b74c82be82d 100644 (file)
@@ -3249,16 +3249,6 @@ class XendDomainInfo:
             disk = devinfo[1]['uname']
 
             fn = blkdev_uname_to_file(disk)
-
-            # If this is a drbd volume, check if we need to activate it
-            if disk.find(":") != -1:
-                (disktype, diskname) = disk.split(':', 1)
-                if disktype == 'drbd':
-                    (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "state", diskname])
-                    (state, junk) = drbdadmstdout.readline().split('/', 1)
-                    if state == 'Secondary':
-                        os.system('/sbin/drbdadm primary ' + diskname)
-
             taptype = blkdev_uname_to_taptype(disk)
             mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
             mounted_vbd_uuid = 0