From: Wei Liu <wei.liu2@citrix.com>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
xen-devel@lists.xen.org
Subject: Re: [PATCH 2/3] libxl: attach PCI device to qemu only after setting pciback/pcifront
Date: Wed, 19 Oct 2016 10:37:59 +0100 [thread overview]
Message-ID: <20161019093759.GF2639@citrix.com> (raw)
In-Reply-To: <1476755613-3921-3-git-send-email-marmarek@invisiblethingslab.com>
On Tue, Oct 18, 2016 at 03:53:32AM +0200, 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.
>
> It is possible to handle this case in mini-os code, by delaying
> "pci-ins" handling until pcifront_thread finishes devices discovery. But
> the same problem most likely will apply to any other stubdomain
> implementations when they come (Rumprun, Linux) - so better handle this
> at libxl level.
>
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mostly some coding style issues.
> ---
> 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 2ae1bc4..3805d30 100644
> --- a/tools/libxl/libxl_pci.c
> +++ b/tools/libxl/libxl_pci.c
> @@ -1195,6 +1195,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;
> @@ -1249,6 +1250,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 */
Hmm... I don't think we have written down style requirement for code
comment, but I would like this comment to be formatted a bit.
/* Wait for the device actually being connected, otherwise device model
* running there will fail to find the device. */
That is to capitalise the first word and make it a proper sentence.
> + 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));
Please indent this a bit.
> + if ( rc )
Not really your problem. This file is ridden with such style violation.
Can you please remove the space before and after "rc"?
Wei.
> + goto out;
> }
>
> orig_vdev = pcidev->vdevfn & ~7U;
> --
> 2.5.5
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-10-19 9:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 1:53 [PATCH 0/3] Fix PCI passthrough for HVM with stubdomain Marek Marczykowski-Górecki
2016-10-18 1:53 ` [PATCH 1/3] libxl: attach xen-pciback only to PV domains Marek Marczykowski-Górecki
2016-10-18 20:52 ` Konrad Rzeszutek Wilk
2016-10-18 21:03 ` Marek Marczykowski-Górecki
2016-10-19 9:37 ` Wei Liu
2016-10-19 20:46 ` Konrad Rzeszutek Wilk
2016-10-19 22:42 ` Marek Marczykowski-Górecki
2016-10-25 13:10 ` Konrad Rzeszutek Wilk
2016-10-25 19:22 ` Marek Marczykowski-Górecki
2016-10-25 19:42 ` Andrew Cooper
2016-10-18 1:53 ` [PATCH 2/3] libxl: attach PCI device to qemu only after setting pciback/pcifront Marek Marczykowski-Górecki
2016-10-19 9:37 ` Wei Liu [this message]
2016-10-18 1:53 ` [PATCH 3/3] libxl: don't try to manipulate json config for stubdomain Marek Marczykowski-Górecki
2016-10-19 9:38 ` Wei Liu
2016-10-19 10:32 ` Marek Marczykowski-Górecki
2016-10-18 18:44 ` [PATCH 0/3] Fix PCI passthrough for HVM with stubdomain Samuel Thibault
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=20161019093759.GF2639@citrix.com \
--to=wei.liu2@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=marmarek@invisiblethingslab.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=xen-devel@lists.xen.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).