debuggers.hg

changeset 22697:e0db3784a4a2

tools/xend: drbd: fix things by reverting 20158

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>
author Ian Jackson <Ian.Jackson@eu.citrix.com>
date Wed Jan 05 23:31:24 2011 +0000 (2011-01-05)
parents 180ad8c642ab
children 77f1af42ca39
files tools/python/xen/util/blkif.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/util/blkif.py	Wed Jan 05 23:13:07 2011 +0000
     1.2 +++ b/tools/python/xen/util/blkif.py	Wed Jan 05 23:31:24 2011 +0000
     1.3 @@ -71,15 +71,8 @@ def _parse_uname(uname):
     1.4      if uname.find(":") != -1:
     1.5          (typ, fn) = uname.split(":", 1)
     1.6  
     1.7 -        if typ == "phy" and not fn.startswith("/"):
     1.8 +        if typ in ("phy", "drbd") and not fn.startswith("/"):
     1.9              fn = "/dev/%s" %(fn,)
    1.10 -
    1.11 -        if typ == "drbd":
    1.12 -            if not fn.startswith("drbd"):
    1.13 -                (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "sh-dev", fn])
    1.14 -                fn = drbdadmstdout.readline().strip()
    1.15 -            else:
    1.16 -                fn = "/dev/%s" %(fn,)
    1.17                 
    1.18          if typ in ("tap", "tap2"):
    1.19              (taptype, fn) = fn.split(":", 1)
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Jan 05 23:13:07 2011 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Jan 05 23:31:24 2011 +0000
     2.3 @@ -3249,16 +3249,6 @@ class XendDomainInfo:
     2.4              disk = devinfo[1]['uname']
     2.5  
     2.6              fn = blkdev_uname_to_file(disk)
     2.7 -
     2.8 -            # If this is a drbd volume, check if we need to activate it
     2.9 -            if disk.find(":") != -1:
    2.10 -                (disktype, diskname) = disk.split(':', 1)
    2.11 -                if disktype == 'drbd':
    2.12 -                    (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "state", diskname])
    2.13 -                    (state, junk) = drbdadmstdout.readline().split('/', 1)
    2.14 -                    if state == 'Secondary':
    2.15 -                        os.system('/sbin/drbdadm primary ' + diskname)
    2.16 -
    2.17              taptype = blkdev_uname_to_taptype(disk)
    2.18              mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
    2.19              mounted_vbd_uuid = 0