File 20158-revert.patch of Package xen

# HG changeset patch
# User jfehlig@localhost
# Date 1293498049 25200
# Node ID 7584dc7bc3de64340f193a0cab188e85bd50d594
# Parent  f9ce5858f7eae84bec34aa10d3585c7e6f6ca6c9
Revert 20158:f9ce5858f7ea xend: Support "bootloader" mode for "drbd:" devices

block-drbd (provided by drbd project) handles all the details that
c/s 20158 introduces within xend.  Subtleties of configuring storage
subsystems should not be handled by xend, but instead delegated to the block
script mechansim provided by the xen toool stack.

Note:  Patch submitted upstream but not (yet) accepted since xend is on
       the way out.

http://lists.xensource.com/archives/html/xen-devel/2010-12/msg01160.html

Index: xen-4.0.2-testing/tools/python/xen/util/blkif.py
===================================================================
--- xen-4.0.2-testing.orig/tools/python/xen/util/blkif.py
+++ xen-4.0.2-testing/tools/python/xen/util/blkif.py
@@ -79,13 +79,6 @@ def parse_uname(uname):
         if typ == "phy" 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)
             if taptype in ("tapdisk", "ioemu"):
Index: xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.2-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.2-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -3283,15 +3283,6 @@ class XendDomainInfo:
 
             (fn, types) = parse_uname(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)
-
             mounted_vbd_uuid = 0
             def _shouldMount(types):
                 if types[0] in ('file', 'phy'):
openSUSE Build Service is sponsored by