All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com,
	"Wei Liu (Intern)" <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	linux@eikelenboom.it,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH for-4.5] reset PCI devices on force removal even when QEMU returns error
Date: Tue, 2 Dec 2014 13:43:20 +0000	[thread overview]
Message-ID: <1417527800.24320.29.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1411281648500.14135@kaball.uk.xensource.com>

On Fri, 2014-11-28 at 16:53 +0000, Stefano Stabellini wrote:

CCing Boris because he was fixing a similar sounding issue in the same
area. Not sure if this is related to those patches or not.

> 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.

ISTR seeing a conversation along the lines of there being a better
solution which was more 4.6 material, is that right?

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

Acked-by: Ian Campbell <ian.campbell@citrix.com>

But, I'd prefer to see a version which logs when the qemu side has
failed but it is continuing. Probably just adding right after the
existing if:
        if (rc)
            LOG("Something appropriate");
would do the trick.

Also this needs RM input from Konrad.

> 
> 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;
>          }

  reply	other threads:[~2014-12-02 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=1417527800.24320.29.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux@eikelenboom.it \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.