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] [1/3] Domgrps/SchedGrps Merge RFC: domgrps-vmm

On Feb 6, 2008, at 7:00 AM, Akio Takebe wrote:
+long do_domgrpctl(XEN_GUEST_HANDLE(xen_domgrpctl_t) u_domgrpctl)
+{
+       long ret = 0;
+       struct xen_domgrpctl curop, *op = &curop;
+       static DEFINE_SPINLOCK(domgrpctl_lock);
+       struct domain_group *grp;
+       dgid_t dgid;
+
+       if (!IS_PRIV(current->domain)) {
+               ret = -EPERM;
+               goto out;
+       }
+
+       if (copy_from_guest(op, u_domgrpctl, 1)) {
+               ret = -EFAULT;
+               goto out;
+       }
+
+       if (op->interface_version != XEN_DOMGRPCTL_INTERFACE_VERSION) {
+               ret = -EINVAL;
I think "ret = -EACESS" is right.

Ack

diff -urN xen-unstable/xen/arch/x86/setup.c xen-unstable-domgrps/ xen/arch/x86/setup.c --- xen-unstable/xen/arch/x86/setup.c 2008-01-29 12:44:24.000000000 -0500 +++ xen-unstable-domgrps/xen/arch/x86/setup.c 2008-01-29 12:53:23.000000000 -0500
@@ -3,6 +3,7 @@
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/domain.h>
+#include <xen/domgrp.h>
 #include <xen/serial.h>
 #include <xen/softirq.h>
 #include <xen/acpi.h>
@@ -969,6 +970,10 @@
     if ( opt_watchdog )
         watchdog_enable();

+    /* initialize domain groups */
+    if (init_domain_groups())
+        panic("Error creating default groups\n");
+
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, DOM0_SSIDREF);
     if ( (dom0 == NULL) || (alloc_vcpu(dom0, 0, 0) == NULL) )
@@ -977,6 +982,9 @@
     dom0->is_privileged = 1;
     dom0->target = NULL;

+    if (add_dom_to_grp(dom0, 0))
+        panic("Error adding dom0 to grp0\n");
+
     /* Grab the DOM0 command line. */
     cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
     if ( (cmdline != NULL) || (kextra != NULL) )
You change this part in the second patch

You're right. There are in fact several places where the second (schedgrps) patch goes back and changes the first (domgrps), which is confusing. It got that way b/c merging with schedgrps identified areas where changes to domgrps where needed. I'll try to separate patches more cleanly in the future.

diff -urN xen-unstable/xen/arch/x86/x86_64/entry.S xen-unstable- domgrps/xen/arch/x86/x86_64/entry.S --- xen-unstable/xen/arch/x86/x86_64/entry.S 2007-11-19 10:38:08.000000000 -0500 +++ xen-unstable-domgrps/xen/arch/x86/x86_64/entry.S 2007-11-19 18:43:06.000000000 -0500
@@ -672,6 +672,7 @@
         .quad do_sysctl             /* 35 */
         .quad do_domctl
         .quad do_kexec_op
+        .quad do_domgrpctl
         .rept NR_hypercalls-((.-hypercall_table)/8)
         .quad do_ni_hypercall
         .endr
@@ -715,7 +716,7 @@
         .byte 1 /* do_sysctl            */  /* 35 */
         .byte 1 /* do_domctl            */
         .byte 2 /* do_kexec             */
-        .byte 1 /* do_xsm_op            */
+        .byte 1 /* do_domgrpctl         */
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
Why do you remove do_xsm_op?

It's actually not removing xsm_op. There's a redundant op declaration in the x86_64 hyercall table. A bit higher in the file (it's op 27 for x86_64), xsm_op is declared where it replaced acm_op. The latter declaration was unused, so I swapped it out for domgrpctl. This fix probably should've been submitted as a separate patch to avoid confusion.

diff -urN xen-unstable/xen/include/xen/compile.h xen-unstable- domgrps/xen/include/xen/compile.h --- xen-unstable/xen/include/xen/compile.h 1969-12-31 19:00:00.000000000 -0500 +++ xen-unstable-domgrps/xen/include/xen/compile.h 2008-01-23 14:58:34.000000000 -0500
Please don't inlcude this file.

Thanks for catching my mistake, that file shouldn't be included.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel