All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Marczykowski <marmarek@mimuw.edu.pl>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] libxl: do not try to detach pci device when none attached
Date: Fri, 10 Jun 2011 13:14:10 +0200	[thread overview]
Message-ID: <4DF1FC82.6050707@mimuw.edu.pl> (raw)
In-Reply-To: <alpine.DEB.2.00.1106101201190.12963@kaball-desktop>


[-- Attachment #1.1: Type: text/plain, Size: 1889 bytes --]

On 10.06.2011 13:03, Stefano Stabellini wrote:
> On Fri, 10 Jun 2011, Marek Marczykowski wrote:
>> On 10.06.2011 12:44, Stefano Stabellini wrote:
>>> On Fri, 10 Jun 2011, Marek Marczykowski wrote:
>>>> # HG changeset patch
>>>> # User Marek Marczykowski <marmarek@mimuw.edu.pl>
>>>> # Date 1307662302 -7200
>>>> # Node ID 88f67b423c89f4bd604837b9eae2483dad5ebb0d
>>>> # Parent  4b392511ae0840fba66c40aa2788dc1ff402b6e8
>>>> libxl: do not try to detach pci device when none attached
>>>>
>>>> Fixes SEGV on domain destroy
>>>>
>>>> Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
>>>>
>>>> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
>>>> --- a/tools/libxl/libxl_pci.c
>>>> +++ b/tools/libxl/libxl_pci.c
>>>> @@ -1039,6 +1039,8 @@ int libxl_device_pci_shutdown(libxl_ctx 
>>>>      rc = libxl_device_pci_list_assigned(ctx, &pcidevs, domid, &num);
>>>>      if ( rc )
>>>>          return rc;
>>>> +    if ( num == 0 )
>>>> +        return 0;
>>>>      for (i = 0; i < num; i++) {
>>>>          /* Force remove on shutdown since, on HVM, qemu will not always
>>>>           * respond to SCI interrupt because the guest kernel has shut down the
>>>
>>> Is the problem here that num is 0 and pcidevs is uninitialized?
>>> If so, would this patch solve the problem you are seeing?
>>
>> No, when there is no PCI devs, libxl_device_pci_list_assigned exists
>> earlier - before allocating memory for pcidevs.
> 
> Sorry, but I still don't understand.
> 
> If num is 0, it won't enter the following loop anyway, the only
> other operation in libxl_device_pci_shutdown is free(pcidevs) and
> pcidevs should be NULL so nothing bad should happen.

Ah, ok. So your patch should also works.

-- 
Pozdrawiam / Best Regards,
Marek Marczykowski         | RLU #390519
marmarek at mimuw edu pl   | xmpp:marmarek at staszic waw pl


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-06-10 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 23:33 [PATCH] libxl: do not try to detach pci device when none attached Marek Marczykowski
2011-06-10 10:44 ` Stefano Stabellini
2011-06-10 10:48   ` Marek Marczykowski
2011-06-10 11:03     ` Stefano Stabellini
2011-06-10 11:14       ` Marek Marczykowski [this message]
2011-06-21 16:36         ` Ian Jackson
2011-06-21 16:34   ` Ian Jackson

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=4DF1FC82.6050707@mimuw.edu.pl \
    --to=marmarek@mimuw.edu.pl \
    --cc=stefano.stabellini@eu.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.