[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] libxl: Retry QMP PCI device_add
- To: Jason Andryuk <jandryuk@xxxxxxxxx>
- From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Date: Tue, 26 Apr 2022 15:23:07 +0100
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Tue, 26 Apr 2022 14:23:23 +0000
- Ironport-data: A9a23:5jJiGaO/TK0V/1DvrR2Gl8FynXyQoLVcMsEvi/4bfWQNrUor0zUDn TQZDD2OafqKN2vwLtxzaNix/R9T6MeBzdI1HAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZl2NAw27BVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z2 vZAkK3zVykSYYrliu8CCglSTSFjIvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALJc/3PIQZqzd4wCvQF/oOSpHfWaTao9Rf2V/cg+gQTK2DO 5ZEOFKDajyQaQ1kIVkmUKgYhdv0g0HifDhyqUi88P9fD2/7k1UqjemF3MDuUsOObdVYmACfv G2u12b2GBYBL/SE1CGItHmrg4fnmCrhXYsIGb6Q9/h0gUaSzGgeFB0XU1SgpfCzzEW5Xrp3K UUS9jA/sKsa+0miT927VBq9yFaUsxhZV9dOHukS7ACW1rGS8wufHnIDTDNKdJohrsBeeNAx/ gbXxZWzX2Up6eDLDyLGnluJkd+sETo2IEozJjEqdlQiysvov9gjhEzPU8k2RcZZkebJMT33x jmLqg03iLMSkdMH2s2HwLzXv96/jsOXF1Bov207Skrgt1okP9D9O+RE/HCBtZ59wJClok5tV ZTus+yX96gwAJ6Ej0Rhq81dTejyt55p3NAx6GOD/qXNFRzwoxZPnqgKuVmSwXuF1e5eJFfUj Lf741852XOqFCLCgVVLS4ywEd826qPrCM7oUPvZBvIXPMUpJVTbpnkxPhXKt4wIrKTLufthU ap3jO72VSpKYUiZ5GfeqxghPU8DmXllmDK7qWHTxBW7y7uODEN5up9eWGZimtsRtfveyC2Mq o43H5LTm313Db2vCgGKoNV7BQ1bchAG6WXe9pU/mhireVE9RgnMypb5nNscRmCSt/kLxrqQo iHhCye1CjPX3BX6FOlDUVg7AJuHYHq1hShT0fAEVbpw50UeXA==
- Ironport-hdrordr: A9a23:cArWzK8qvkjJih6u9u9uk+DaI+orL9Y04lQ7vn2YSXRuE/Bws/ re+8jztCWE7Ar5N0tNpTntAsa9qDbnhPhICOoqTNKftWvdyQiVxehZhOOIqVDd8m/Fh4xgPM 9bAtFD4bbLbWSS4/yV3DWF
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxxx>
> ---
> v2:
> Only retry when a stubdom is present.
> Move pci_add_timeout initialization.
> Use pas->aodev->ao directly.
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Thanks,
--
Anthony PERARD
|