[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: A few blktap2 fixes



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1275891583 -3600
# Node ID 7ff0e885b5c30cc8573b52144b274509e04759fd
# Parent  9c98ae6e23b2baf1a335563189e9fd45c68aec89
xend: A few blktap2 fixes

1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
already connected." (xenstore does not clean after DomU stoped)
2. Bug fix for error: "File 'vhd:/path/.../disk.img' doesn't exist."
(not correct parsing)
3. Bug fix for error: "Error: Device 51952 not connected" (in config
file for DomU we should be use prefix "tap2:tapdisk:xxx" for devices
from (aio, ram, qcow, vhd, remus) or "tap:tapdisk:xxx" for devices
from (sync, vmdk, qcow2, ioemu))
4. Bug fix for error: "Disk is not accessible" (if use 'tap2'-device
type, then '/dev/xpvd' may not be accessible immediately after its
creation)

Signed-off-by: eXeC001er <execooler@xxxxxxxxx>
---
 tools/python/xen/util/blkif.py          |    2 +-
 tools/python/xen/xend/XendBootloader.py |   13 +++++++++----
 tools/python/xen/xend/XendDomainInfo.py |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff -r 9c98ae6e23b2 -r 7ff0e885b5c3 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py    Mon Jun 07 07:16:43 2010 +0100
+++ b/tools/python/xen/util/blkif.py    Mon Jun 07 07:19:43 2010 +0100
@@ -87,7 +87,7 @@ def _parse_uname(uname):
                 fn = "/dev/%s" %(fn,)
                
         if typ in ("tap", "tap2"):
-            (taptype, fn) = fn.split(":", 1)
+            (taptype, fn) = fn.split(":", 2)[1:3]
     return (fn, taptype)
 
 def blkdev_uname_to_file(uname):
diff -r 9c98ae6e23b2 -r 7ff0e885b5c3 tools/python/xen/xend/XendBootloader.py
--- a/tools/python/xen/xend/XendBootloader.py   Mon Jun 07 07:16:43 2010 +0100
+++ b/tools/python/xen/xend/XendBootloader.py   Mon Jun 07 07:19:43 2010 +0100
@@ -38,10 +38,15 @@ def bootloader(blexec, disk, dom, quiet 
         msg = "Bootloader isn't executable"
         log.error(msg)
         raise VmError(msg)
-    if not os.access(disk, os.R_OK):
-        msg = "Disk isn't accessible"
-        log.error(msg)
-        raise VmError(msg)
+    attempt = 0
+    while True:
+        if not os.access(disk, os.R_OK) and attempt > 3:
+            msg = "Disk isn't accessible"
+            log.error(msg)
+            raise VmError(msg)
+        else:
+            break
+        attempt = attempt + 1
 
     if os.uname()[0] == "NetBSD" and disk.startswith('/dev/'):
        disk = disk.replace("/dev/", "/dev/r")
diff -r 9c98ae6e23b2 -r 7ff0e885b5c3 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Jun 07 07:16:43 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Jun 07 07:19:43 2010 +0100
@@ -3299,7 +3299,7 @@ class XendDomainInfo:
                     log.info("Unmounting %s from %s." %
                              (fn, BOOTLOADER_LOOPBACK_DEVICE))
 
-                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+                    dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE, 
force = True)
 
             if blcfg is None:
                 msg = "Had a bootloader specified, but can't find disk"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.