All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH v2 2/4] libxl: attach PCI device to qemu only after setting pciback/pcifront
Date: Sat, 26 Jan 2019 03:24:20 +0100	[thread overview]
Message-ID: <20190126022420.GN1429@mail-itl> (raw)
In-Reply-To: <20190117102959.4yghre2psqjsi3x6@mac>


[-- Attachment #1.1: Type: text/plain, Size: 2395 bytes --]

On Thu, Jan 17, 2019 at 11:29:59AM +0100, Roger Pau Monné wrote:
> On Tue, Jan 15, 2019 at 04:36:29PM +0100, Marek Marczykowski-Górecki wrote:
> > When qemu is running in stubdomain, handling "pci-ins" command will fail
> > if pcifront is not initialized already. Fix this by sending such command
> > only after confirming that pciback/front is running.
> > 
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > ---
> > Changes in v2:
> > - Fixed code style since previous version.
> > ---
> >  tools/libxl/libxl_pci.c |  9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
> > index 3b6b23c..1bde537 100644
> > --- a/tools/libxl/libxl_pci.c
> > +++ b/tools/libxl/libxl_pci.c
> > @@ -1191,6 +1191,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
> >  {
> >      libxl_ctx *ctx = libxl__gc_owner(gc);
> >      unsigned int orig_vdev, pfunc_mask;
> > +    char *be_path;
> >      libxl_device_pci *assigned;
> >      int num_assigned, i, rc;
> >      int stubdomid = 0;
> > @@ -1245,6 +1246,14 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide
> >          rc = do_pci_add(gc, stubdomid, &pcidev_s, 0);
> >          if ( rc )
> >              goto out;
> > +        /* Wait for the device actually being connected, otherwise device model
> > +         * running there will fail to find the device. */
> > +        be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0",
> > +                                 libxl__xs_get_dompath(gc, 0), stubdomid);
> > +        rc = libxl__wait_for_backend(gc, be_path,
> > +                                     GCSPRINTF("%d", XenbusStateConnected));
> > +        if (rc)
> > +            goto out;
> 
> I think it would be better to use the async libxl functionality here,
> see libxl__xswait_start. I will leave for the toolstack maintainers to
> decide. Apart from that the change seems correct.

libxl__device_pci_add() is not async-aware right now and it looks like
converting it is quite a bit of work. I'd leave it out of scope for this
patch series...

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

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

  reply	other threads:[~2019-01-26  2:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 15:36 [PATCH v2 0/4] Fix PCI passthrough for HVM with stubdomain Marek Marczykowski-Górecki
2019-01-15 15:36 ` [PATCH v2 1/4] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use Marek Marczykowski-Górecki
2019-01-16 16:47   ` Roger Pau Monné
2019-01-16 17:00     ` Marek Marczykowski-Górecki
2019-01-17  9:21       ` Roger Pau Monné
2019-01-17 13:32         ` Marek Marczykowski-Górecki
2019-01-15 15:36 ` [PATCH v2 2/4] libxl: attach PCI device to qemu only after setting pciback/pcifront Marek Marczykowski-Górecki
2019-01-17 10:29   ` Roger Pau Monné
2019-01-26  2:24     ` Marek Marczykowski-Górecki [this message]
2019-01-15 15:36 ` [PATCH v2 3/4] libxl: don't try to manipulate json config for stubdomain Marek Marczykowski-Górecki
2019-01-17 10:44   ` Roger Pau Monné
2019-01-15 15:36 ` [PATCH v2 4/4] xen/x86: Allow stubdom access to irq created for msi Marek Marczykowski-Górecki
2019-01-16  9:21   ` Roger Pau Monné
2019-01-16 10:52     ` Marek Marczykowski-Górecki
2019-01-16 12:20       ` Roger Pau Monné
     [not found]         ` <94C5C3AC020000F30063616D@prv1-mh.provo.novell.com>
2019-01-16 12:57           ` Jan Beulich
2019-01-16 13:07             ` Roger Pau Monné
2019-01-16 13:49         ` Marek Marczykowski-Górecki
2019-01-17  8:57           ` Roger Pau Monné
     [not found]             ` <FB0C9893020000480063616D@prv1-mh.provo.novell.com>
2019-01-17 11:52               ` Jan Beulich
2019-01-17 11:56                 ` Roger Pau Monné
2019-01-17 12:20                   ` Jan Beulich
2019-01-17 12:32                     ` Roger Pau Monné
     [not found]                       ` <21B633D80200008F0063616D@prv1-mh.provo.novell.com>
2019-01-17 13:12                         ` Jan Beulich
2019-01-25 19:43       ` Marek Marczykowski-Górecki
2019-01-25 20:04         ` Marek Marczykowski-Górecki

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=20190126022420.GN1429@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@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 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.