All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jason Cooper <xen@lakedaemon.net>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: reboot driver domain, vifX.Y = NO-CARRIER?
Date: Tue, 1 May 2018 12:29:01 +0100	[thread overview]
Message-ID: <20180501112901.ecsv3b6heal4xtcq@citrix.com> (raw)
In-Reply-To: <20180427172729.GD17249@io.lakedaemon.net>

On Fri, Apr 27, 2018 at 05:27:29PM +0000, Jason Cooper wrote:
> Hi Wei Liu,
> 
> On Fri, Apr 27, 2018 at 05:58:17PM +0100, Wei Liu wrote:
> > On Fri, Apr 27, 2018 at 04:14:16PM +0000, Jason Cooper wrote:
> > > On Fri, Apr 27, 2018 at 04:52:57PM +0100, Andrew Cooper wrote:
> ...
> > > > xc_domain_create() takes a domid value by pointer.  Passing a value
> > > > other than zero will cause Xen to use that domid, rather than by
> > > > searching for the next free domid.
> > > > 
> > > > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> > > > index b5e27a7..7866092 100644
> > > > --- a/tools/libxl/libxl_create.c
> > > > +++ b/tools/libxl/libxl_create.c
> > > > @@ -583,6 +583,7 @@ int libxl__domain_make(libxl__gc *gc,
> > > > libxl_domain_config *d_config,
> > > >              goto out;
> > > >          }
> > > >  
> > > > +        *domid = atoi(getenv("OVERRIDE_DOMID") ?: "0");
> > > >          ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid,
> > > >                                 &xc_config);
> > > >          if (ret < 0) {
> > > > 
> > > > This gross hack may get you somewhere (Entirely untested).
> > > 
> > > Gah!  Yep, that's just what I needed, thanks!  I don't suppose a patch
> > > series adding a 'domid' field to the domain config file would be
> > > rejected outright?  That would allow callers of xl to use key=value for
> > > reboot scripts like mine, and also allow for a static domid setup of the
> > > driver domains if folks want that.
> > 
> > Seems a bit  hacky to me. You also need to reserve a set of domids
> > before hand?
> 
> My thought of creating a domid config file variable was to do just as
> you say, reserve specific domids for specific guests.  I could even
> trigger an error if domid is set when driver_domain isn't.
> 
> Actually, I could slightly overload driver_domain, changing from a bool
> to a 'static domid'.  0 = not a driver domain, >0 is it's static domid
> assignment.
> 
> For backwards compatibility, 1 = next domid available, and >1 would be
> the static domid.  I'm not sure if I like that though.
> 
> The racey part is when a driver domain is shut down, how does a create
> thread know that that domid is reserved?

If a driver domain shuts down and another domain gets allocated that
domain id, your whole system is hosed.

It is even worse if you consider the security implication: some
potentially malicious guest can impersonate driver domain and sees what
other guests' data.

> 
> third option, tri-state:
> 
> driver_domain = 0   # not a driver domain
> driver_domain = 1   # is a driver domain, use next avail domid
> driver_domain = 2   # is a driver domain, re-use domid
> 

Let's shelve this UI discussion for now. I will have a look at the other
subthread.

Wei.

> Honestly, I'm not really liking any of these.  Perhaps 'xl
> network-detach ...' should be doing a better job of cleaning up?  Or,
> 'xl network-attach ...' should do a better job of re-attaching?
> 
> thx,
> 
> Jason.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-05-01 11:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 15:03 reboot driver domain, vifX.Y = NO-CARRIER? Jason Cooper
2018-04-27 15:11 ` Andrew Cooper
2018-04-27 15:35   ` Jason Cooper
2018-04-27 15:52     ` Andrew Cooper
2018-04-27 16:14       ` Jason Cooper
2018-04-27 16:58         ` Wei Liu
2018-04-27 17:27           ` Jason Cooper
2018-05-01 11:29             ` Wei Liu [this message]
2018-04-27 17:02         ` Andrew Cooper
2018-04-27 17:13           ` Wei Liu
2018-04-30 15:22             ` Ian Jackson
2018-04-30 16:16               ` Jason Cooper
2018-04-30 16:26                 ` Ian Jackson
2018-04-30 18:14                   ` Jason Cooper
2018-05-01 11:20                     ` Wei Liu
2018-04-30 16:38                 ` George Dunlap
2018-04-30 18:17                   ` Jason Cooper
2018-04-30 18:23                     ` Jason Cooper
2018-05-01 10:25                     ` George Dunlap
2018-05-01 12:37                       ` Jason Cooper
2018-05-01 12:53                         ` Jason Cooper
2018-05-04 22:13                           ` Rich Persaud
2018-05-04 23:03                             ` Marek Marczykowski-Górecki
2018-05-06 15:45                               ` Jason Cooper
2018-05-07 12:04                                 ` Jason Andryuk
2018-05-01 11:50                 ` Wei Liu
2018-05-01 12:49                   ` Jason Cooper
2018-04-27 16:56       ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180501112901.ecsv3b6heal4xtcq@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xen@lakedaemon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.