WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel][PATCH] ioemu: ignore the arg of tapdisk

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel][PATCH] ioemu: ignore the arg of tapdisk
From: "Zhang, Yang" <yang.zhang@xxxxxxxxx>
Date: Fri, 19 Jun 2009 12:28:33 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Keir, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 18 Jun 2009 21:31:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <10C63FAD690C13458F0B32BCED571F14026DAFAA47@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <10C63FAD690C13458F0B32BCED571F14026DAFAA47@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcnosxWisvORi9EPSzKCpJpLoB0MbgH4wfcw
Thread-topic: [Xen-devel][PATCH] ioemu: ignore the arg of tapdisk
hi Ian, If the patch is fine to you, can you help me to check in it. Or else 
when use "tap:tapdisk:qcow2" which introduced by blktap2 at config file will 
raise error in qemu.


Best Regards
--yang

-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Zhang, Yang
Sent: 2009年6月9日 11:34
To: Ian Jackson
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; Keir Fraser
Subject: [Xen-devel][PATCH] ioemu: ignore the arg of tapdisk

The new blktap implemention changes arg of tap driver type from 'tap:qcow' to 
'tap:tapdisk:qcow'.
qemu need change the way to read these params.

Signed-off-by: Yang Zhang <yan.zhang@xxxxxxxxx>

diff --git a/xenstore.c b/xenstore.c
index d2f38d2..6dc613e 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -405,13 +405,16 @@ void xenstore_parse_domain_config(int hvm_domid)
             continue;
         /* Obtain blktap sub-type prefix */
         if (!strcmp(drv, "tap") && params[0]) {
-            char *offset = strchr(params, ':'); 
+            char *params_old = params;
+            if (!strncmp(params, "tapdisk:", 8))
+                params_old += 8;
+            char *offset = strchr(params_old, ':'); 
             if (!offset)
                 continue ;
            free(drv);
-           drv = malloc(offset - params + 1);
-           memcpy(drv, params, offset - params);
-           drv[offset - params] = '\0';
+           drv = malloc(offset - params_old + 1);
+           memcpy(drv, params_old, offset - params_old);
+           drv[offset - params_old] = '\0';
            if (!strcmp(drv, "aio"))
                /* qemu does aio anyway if it can */
                format = &bdrv_raw;
-- 
1.6.0.rc1

Best Regards
--yang
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel