From: Sergey Tovpeko Subject: Re: Experience with netchannel2 Date: Thu, 02 Jul 2009 18:41:48 +0400 Message-ID: <4A4CC72C.7000302@gmail.com> References: <20090630115331.GA8688@weybridge.uk.xensource.com> <4A4B3438.10206@gmail.com> <20090701160743.GA16252@weybridge.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000308080400070608060601" Return-path: In-Reply-To: <20090701160743.GA16252@weybridge.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Steven Smith Cc: Steven Smith , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000308080400070608060601 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, Steven! >> Moreover, the domU is starting without 'bridge' key with >> vif2 =[ '' ] >> but what i have, are >> 1. Virtual network interface is created in dom0 with name 'eth1', while >> in old netchannel1, virtual network intarface >> has the name 'vifN.M'. It's very strange that i have 'eth1' instead of >> 'vifN.M'. >> > Is it? It's easy enough to change the name of the interface, but I've > never really understood why it was desirable. > I'd like to distinguish somehow, that device named 'vif' is virtual network interface for domU, at least for testing purposes. Thank you very much for your efforts and fixes. Please, consider some minor changes in gnttab_request_version I added the return code to it., because HYPERVISOR_grant_table_op could return -EFAULT, -EINVAL additional to -ENOSYS. I attached the file. Sergey Tovpeko. --------------000308080400070608060601 Content-Type: text/x-patch; name="versions.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="versions.diff" diff --git a/drivers/xen/core/gnttab.c b/drivers/xen/core/gnttab.c index 5314932..5f27756 100644 --- a/drivers/xen/core/gnttab.c +++ b/drivers/xen/core/gnttab.c @@ -654,28 +654,31 @@ static inline unsigned int max_nr_grant_frames(void) return xen_max; } -static void gnttab_request_version(void) +static int gnttab_request_version(void) { int rc; struct gnttab_set_version gsv; + int version = 2; - gsv.version = 2; + gsv.version = version; rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, &gsv, 1); if (rc == 0) { - grant_table_version = 2; - printk("<0>Grant table version 2.\n"); + grant_table_version = version; + printk("<0>Grant table version %d.\n", grant_table_version); } else { - if (grant_table_version == 2) { + if (rc == -ENOSYS && grant_table_version == 2) { /* If we've already used version 2 features, but then suddenly discover that they're not available (e.g. migrating to an older version of Xen), almost unbounded badness can happen. */ panic("we need grant tables version 2, but only version 1 is available"); + grant_table_version = 1; + printk("<0>Grant table version 1.\n"); + rc = 0; } - grant_table_version = 1; - printk("<0>Grant table version 1.\n"); } + return rc; } #ifdef CONFIG_XEN @@ -1011,7 +1014,10 @@ EXPORT_SYMBOL(gnttab_post_map_adjust); int gnttab_resume(void) { - gnttab_request_version(); + int rc; + + if (rc = gnttab_request_version()) + return rc; if (max_nr_grant_frames() < nr_grant_frames) return -ENOSYS; return gnttab_map(0, nr_grant_frames - 1); @@ -1092,8 +1098,10 @@ int gnttab_resume(void) { unsigned int max_nr_gframes, nr_gframes; unsigned int max_nr_sframes, nr_sframes; + int rc; - gnttab_request_version(); + if (rc = gnttab_request_version()) + return rc; nr_gframes = nr_grant_frames; max_nr_gframes = max_nr_grant_frames(); --------------000308080400070608060601 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000308080400070608060601--