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

[Xen-changelog] [xen-unstable] xenstored: add --priv-domid parameter



# HG changeset patch
# User Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
# Date 1328812416 0
# Node ID a298150d23a04346668324aebc0c47d5f939b3d7
# Parent  98f45814fbacaa844a204693529d806d4f9c7c05
xenstored: add --priv-domid parameter

This parameter identifies an alternative service domain which has
superuser access to the xenstore database, which is currently required
to set up a new domain's xenstore entries.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 98f45814fbac -r a298150d23a0 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu Feb 09 18:33:35 2012 +0000
+++ b/tools/xenstore/xenstored_core.c   Thu Feb 09 18:33:36 2012 +0000
@@ -1752,6 +1752,7 @@
        { "event", 1, NULL, 'e' },
        { "help", 0, NULL, 'H' },
        { "no-fork", 0, NULL, 'N' },
+       { "priv-domid", 1, NULL, 'p' },
        { "output-pid", 0, NULL, 'P' },
        { "entry-size", 1, NULL, 'S' },
        { "trace-file", 1, NULL, 'T' },
@@ -1765,6 +1766,7 @@
 
 extern void dump_conn(struct connection *conn); 
 int dom0_event = 0;
+int priv_domid = 0;
 
 int main(int argc, char *argv[])
 {
@@ -1825,6 +1827,9 @@
                case 'e':
                        dom0_event = strtol(optarg, NULL, 10);
                        break;
+               case 'p':
+                       priv_domid = strtol(optarg, NULL, 10);
+                       break;
                }
        }
        if (optind != argc)
diff -r 98f45814fbac -r a298150d23a0 tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h   Thu Feb 09 18:33:35 2012 +0000
+++ b/tools/xenstore/xenstored_core.h   Thu Feb 09 18:33:36 2012 +0000
@@ -169,6 +169,7 @@
 
 extern int event_fd;
 extern int dom0_event;
+extern int priv_domid;
 
 /* Map the kernel's xenstore page. */
 void *xenbus_map(void);
diff -r 98f45814fbac -r a298150d23a0 tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Thu Feb 09 18:33:35 2012 +0000
+++ b/tools/xenstore/xenstored_domain.c Thu Feb 09 18:33:36 2012 +0000
@@ -259,7 +259,7 @@
 
 bool domain_is_unprivileged(struct connection *conn)
 {
-       return (conn && conn->domain && conn->domain->domid != 0);
+       return (conn && conn->domain && conn->domain->domid != 0 && 
conn->domain->domid != priv_domid);
 }
 
 bool domain_can_write(struct connection *conn)

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