@@ -2557,6 +2557,7 @@ static struct option options[] = {
int dom0_domid = 0;
int dom0_event = 0;
int priv_domid = 0;
+domid_t stub_domid = DOMID_INVALID;
static unsigned int get_optval_uint(const char *arg)
{
@@ -361,6 +361,7 @@ do { \
extern int dom0_domid;
extern int dom0_event;
extern int priv_domid;
+extern domid_t stub_domid;
extern bool keep_orphans;
extern struct pollfd *poll_fds;
@@ -20,6 +20,7 @@
#include "core.h"
#include "utils.h"
#include <xen/grant_table.h>
+#include <mini-os/lib.h>
void finish_daemonize(void)
{
@@ -48,6 +49,9 @@ void unmap_xenbus(void *interface)
void early_init(bool live_update, bool dofork, const char *pidfile)
{
+ stub_domid = get_domid();
+ if (stub_domid == DOMID_INVALID)
+ barf("could not get own domid");
}
void late_init(bool live_update)