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.
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();
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|