xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [Xen-devel] [PATCH 4/9] libxl_internal: Create new lock for devices hotplug via QMP
Date: Wed, 5 Jun 2019 15:32:20 +0100	[thread overview]
Message-ID: <23799.53876.440475.866985@mariner.uk.xensource.com> (raw)
In-Reply-To: <20190605141015.GJ2126@perard.uk.xensource.com>

Anthony PERARD writes ("Re: [PATCH 4/9] libxl_internal: Create new lock for devices hotplug via QMP"):
> So, instead of that interface, how about a different one that uses the
> same C type for both kind of lock?
> 
>     libxl__lock *libxl__lock_domain_userdata(libxl__gc *, libxl_domid);
>     libxl__lock *libxl__lock_domain_qmp(libxl__gc *, libxl_domid);
>     void libxl__unlock(libxl__lock *);

I think that would be fine.

> Or maybe avoid having two functions for locking and use a #define/enum
> instead:
>     libxl__lock_domain(gc, domid, LOCK_USERDATA);
>     libxl__lock_domain(gc, domid, LOCK_QMP);

Or this.

But I think maybe this conversation will be superseded by the need to
redo the implementation which will result in a totally different API
for the slow lock, and probably a different state struct.

> What do you think? Would the first proposal be enough to avoid having to
> write `userdata' or `qmp' twice on unlock?

I don't *mind* the writing `userdata' or `qmp' twice.  I just
discounting it as a *benefit*.  I mind the duplicated implementation
code.

> > Maybe it would be better to try once with LOCK_NB, and to fork if this
> > is not successful.  But it would be simpler to always fork...
> 
> After our talk IRL, I'll go the fork route.
> Also, I'm thinking to always fork when libxl is built with "debug=y",
> and allow the optimisation of trying first with LOCK_NB when built with
> "debug=n", so the forked code will actually be tested regulary.

Good plan.

Ian.

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

  reply	other threads:[~2019-06-05 14:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 16:45 [PATCH 0/9] libxl: New slow lock + fix libxl_cdrom_insert with QEMU depriv Anthony PERARD
2019-04-09 16:45 ` [Xen-devel] " Anthony PERARD
2019-04-09 16:45 ` [PATCH 1/9] libxl_internal: Remove lost comment Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-04-10  9:18   ` Wei Liu
2019-04-10  9:18     ` [Xen-devel] " Wei Liu
2019-06-04 16:42   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 2/9] libxl: Pointer on usage of libxl__domain_userdata_lock Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 16:46   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 3/9] libxl_internal: Split out userdata lock function Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 16:55   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 4/9] libxl_internal: Create new lock for devices hotplug via QMP Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:11   ` Ian Jackson
2019-06-05 14:10     ` Anthony PERARD
2019-06-05 14:32       ` Ian Jackson [this message]
2019-04-09 16:45 ` [PATCH 5/9] libxl_disk: Reorganise libxl_cdrom_insert Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:16   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 6/9] libxl_disk: Cut libxl_cdrom_insert into steps Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:29   ` Ian Jackson
2019-06-07 17:22     ` Anthony PERARD
2019-04-09 16:45 ` [PATCH 7/9] libxl: Move qmp_parameters_* prototypes to libxl_internal.h Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:32   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 8/9] libxl_disk: Use ev_qmp in libxl_cdrom_insert Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:45   ` Ian Jackson
2019-04-09 16:45 ` [PATCH 9/9] libxl_disk: Implement missing timeout for libxl_cdrom_insert Anthony PERARD
2019-04-09 16:45   ` [Xen-devel] " Anthony PERARD
2019-06-04 17:47   ` Ian Jackson
2019-06-05 14:22     ` Anthony PERARD
2019-06-05 14:33       ` Ian Jackson
2019-06-04 10:54 ` [Xen-devel] Ping: [PATCH 0/9] libxl: New slow lock + fix libxl_cdrom_insert with QEMU depriv Anthony PERARD

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=23799.53876.440475.866985@mariner.uk.xensource.com \
    --to=ian.jackson@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).