All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Wei Liu" <wl@xen.org>, "Juergen Gross" <jgross@suse.com>
Subject: Re: [PATCH v2] libxl: Retry QMP PCI device_add
Date: Tue, 26 Apr 2022 15:23:07 +0100	[thread overview]
Message-ID: <YmgAS9jZ/at06PIU@perard.uk.xensource.com> (raw)
In-Reply-To: <20220422140703.13614-1-jandryuk@gmail.com>

On Fri, Apr 22, 2022 at 10:07:03AM -0400, Jason Andryuk wrote:
> PCI device assignment to an HVM with stubdom is potentially racy.  First
> the PCI device is assigned to the stubdom via the PV PCI protocol.  Then
> QEMU is sent a QMP command to attach the PCI device to QEMU running
> within the stubdom.  However, the sysfs entries within the stubdom may
> not have appeared by the time QEMU receives the device_add command
> resulting in errors like:
> 
> libxl_qmp.c:1838:qmp_ev_parse_error_messages:Domain 10:Could not open '/sys/bus/pci/devices/0000:00:1f.3/config': No such file or directory
> 
> This patch retries the device assignment up to 10 times with a 1 second
> delay between.  That roughly matches the overall hotplug timeout for
> pci_add_timeout.  pci_add_timeout's initialization is moved to
> do_pci_add since retries call into pci_add_qmp_device_add again.
> 
> The qmp_ev_parse_error_messages error is still printed since it happens
> at a lower level than the pci code controlling the retries.  With that,
> the "Retrying PCI add %d" message is also printed at ERROR level to
> clarify what is happening.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2:
> Only retry when a stubdom is present.
> Move pci_add_timeout initialization.
> Use pas->aodev->ao directly.

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


      reply	other threads:[~2022-04-26 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 14:07 [PATCH v2] libxl: Retry QMP PCI device_add Jason Andryuk
2022-04-26 14:23 ` Anthony PERARD [this message]

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=YmgAS9jZ/at06PIU@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=jandryuk@gmail.com \
    --cc=jgross@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=wl@xen.org \
    --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.