All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.5] reset PCI devices on force removal even when QEMU returns error
@ 2014-11-28 16:53 Stefano Stabellini
  2014-12-02 13:43 ` Ian Campbell
  2014-12-12 15:13 ` Sander Eikelenboom
  0 siblings, 2 replies; 9+ messages in thread
From: Stefano Stabellini @ 2014-11-28 16:53 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu (Intern), Ian Campbell, Stefano Stabellini, Ian Jackson,
	linux

On do_pci_remove when QEMU returns error, we just bail out early without
resetting the device. On domain shutdown we are racing with QEMU exiting
and most often QEMU closes the QMP connection before executing the
requested command.

In these cases if force=1, it makes sense to go ahead with rest of the
PCI device removal, that includes resetting the device and calling
xc_deassign_device. Otherwise we risk not resetting the device properly
on domain shutdown.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 316643c..0ac0b93 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1243,7 +1245,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
             rc = ERROR_INVAL;
             goto out_fail;
         }
-        if (rc) {
+        if (rc && !force) {
             rc = ERROR_FAIL;
             goto out_fail;
         }

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-06 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 16:53 [PATCH for-4.5] reset PCI devices on force removal even when QEMU returns error Stefano Stabellini
2014-12-02 13:43 ` Ian Campbell
2014-12-02 15:09   ` Boris Ostrovsky
2014-12-12 15:13 ` Sander Eikelenboom
2014-12-12 16:50   ` Konrad Rzeszutek Wilk
2014-12-15 11:13     ` Stefano Stabellini
2014-12-17 21:07       ` Konrad Rzeszutek Wilk
2015-01-06 11:45         ` Ian Campbell
2015-01-06 14:02           ` Sander Eikelenboom

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.