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

[Xen-changelog] [xen stable-4.2] libxl: don't launch more than one tapdisk process for each disk



commit 1a438e0e124523fa62628620c7e6f877a9e4ed11
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Mon Apr 15 18:04:35 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Apr 15 18:07:43 2013 +0100

    libxl: don't launch more than one tapdisk process for each disk
    
    When adding a disk don't launch multiple tapdisk instances for the
    same disk, if transaction fails in device_disk_add reuse the same
    tapdisk for further tries instead of creating a new instance each
    time a transaction fails.
    
    Reported-by: Darren Shepherd <darren.s.shepherd@xxxxxxxxx>
    Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
    Tested-by: Darren Shepherd <darren.s.shepherd@xxxxxxxxx>
    
    Backport-requested-by: Pasi Karkkainen <pasik@xxxxxx>
    (cherry picked from commit ec398660e89ca18bb8d061d5047d682bd383778a)
    Conflicts:
        tools/libxl/libxl.c
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 5783cd2..3a58ef4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1783,7 +1783,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t 
domid,
     STATE_AO_GC(aodev->ao);
     flexarray_t *front = NULL;
     flexarray_t *back = NULL;
-    char *dev, *script;
+    char *dev = NULL, *script;
     libxl__device *device;
     int rc;
     libxl_ctx *ctx = gc->owner;
@@ -1858,12 +1858,15 @@ static void device_disk_add(libxl__egc *egc, uint32_t 
domid,
                 break;
 
             case LIBXL_DISK_BACKEND_TAP:
-                dev = libxl__blktap_devpath(gc, disk->pdev_path, disk->format);
-                if (!dev) {
-                    LOG(ERROR, "failed to get blktap devpath for %p\n",
-                        disk->pdev_path);
-                    rc = ERROR_FAIL;
-                    goto out_free;
+                if (dev == NULL) {
+                    dev = libxl__blktap_devpath(gc, disk->pdev_path,
+                                                disk->format);
+                    if (!dev) {
+                        LOG(ERROR, "failed to get blktap devpath for %p\n",
+                            disk->pdev_path);
+                        rc = ERROR_FAIL;
+                        goto out_free;
+                    }
                 }
                 flexarray_append(back, "tapdisk-params");
                 flexarray_append(back, libxl__sprintf(gc, "%s:%s",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.