All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, qemu-devel@nongnu.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [Qemu-devel] [Xen-devel] [PATCH RFC 1 6/8] xen/pt: Make xen_pt_unregister_device idempotent
Date: Thu, 2 Jul 2015 14:54:10 -0400	[thread overview]
Message-ID: <20150702185410.GA14197@andromeda.dapyr.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1507011502340.17378@kaball.uk.xensource.com>

> > @@ -858,15 +863,20 @@ static void xen_pt_unregister_device(PCIDevice *d)
> >                             machine_irq, errno);
> >              }
> >          }
> > +        s->machine_irq = 0;
> >      }
> >  
> >      /* delete all emulated config registers */
> >      xen_pt_config_delete(s);
> >  
> > -    memory_listener_unregister(&s->memory_listener);
> > -    memory_listener_unregister(&s->io_listener);
> > -
> > -    xen_host_pci_device_put(&s->real_device);
> > +    if (s->listener_set) {
> > +        memory_listener_unregister(&s->memory_listener);
> > +        memory_listener_unregister(&s->io_listener);
> > +        s->listener_set = false;
> 
> If you call QTAILQ_INIT on memory_listener and io_listener, then you
> simply check on QTAILQ_EMPTY and remove listener_set.

No dice. For that to work they need to be QTAIL_HEAD while
they are of QTAILQ_ENTRY.

That is, the include/exec/memory.h:
struct MemoryListener {
 ...
	AddressSpace *address_space_filter;
	QTAILQ_ENTRY(MemoryListener) link;
}

And the QTAILQ_EMPTY checks for '>tqh_first' while the
QTAILQ_ENTRY only defines two pointers: tqe_next and tqe_prev.

  reply	other threads:[~2015-07-02 18:54 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 21:01 [Qemu-devel] [PATCH RFC v1] Sync dev.config with XenPTReg->data field Konrad Rzeszutek Wilk
2015-06-29 21:01 ` [Qemu-devel] [PATCH RFC 1 1/8] xen/pt: Use xen_host_pci_get_[byte|word] instead of dev.config Konrad Rzeszutek Wilk
2015-06-29 21:01   ` Konrad Rzeszutek Wilk
2015-07-01 13:28   ` Stefano Stabellini
2015-07-01 13:28   ` [Qemu-devel] " Stefano Stabellini
2015-06-29 21:01 ` [Qemu-devel] [PATCH RFC 1 2/8] xen/pt: Sync up the dev.config and data values Konrad Rzeszutek Wilk
2015-06-29 21:01   ` Konrad Rzeszutek Wilk
2015-07-01 13:48   ` [Qemu-devel] " Stefano Stabellini
2015-07-01 13:48   ` Stefano Stabellini
2015-06-29 21:02 ` [Qemu-devel] [PATCH RFC 1 3/8] xen/pt: Check if reg->init is past the reg->size Konrad Rzeszutek Wilk
2015-06-29 21:02   ` Konrad Rzeszutek Wilk
2015-07-01 13:54   ` Stefano Stabellini
2015-07-01 13:54   ` [Qemu-devel] " Stefano Stabellini
2015-06-29 21:02 ` [PATCH RFC 1 4/8] xen/pt: Log xen_host_pci_get in two init functions Konrad Rzeszutek Wilk
2015-06-29 21:02 ` [Qemu-devel] " Konrad Rzeszutek Wilk
2015-07-01 13:56   ` Stefano Stabellini
2015-07-01 13:56   ` Stefano Stabellini
2015-06-29 21:02 ` [PATCH RFC 1 5/8] xen/pt: Log xen_host_pci_get/set errors in MSI code Konrad Rzeszutek Wilk
2015-06-29 21:02 ` [Qemu-devel] " Konrad Rzeszutek Wilk
2015-07-01 13:58   ` Stefano Stabellini
2015-07-01 13:58   ` Stefano Stabellini
2015-06-29 21:02 ` [PATCH RFC 1 6/8] xen/pt: Make xen_pt_unregister_device idempotent Konrad Rzeszutek Wilk
2015-06-29 21:02 ` [Qemu-devel] " Konrad Rzeszutek Wilk
2015-07-01 14:04   ` Stefano Stabellini
2015-07-01 14:04   ` [Qemu-devel] " Stefano Stabellini
2015-07-02 18:54     ` Konrad Rzeszutek Wilk [this message]
2015-07-14 11:38       ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2015-07-14 11:38       ` Stefano Stabellini
2015-07-02 18:54     ` Konrad Rzeszutek Wilk
2015-06-29 21:02 ` [Qemu-devel] [PATCH RFC 1 7/8] xen/pt: Move bulk of xen_pt_unregister_device in its own routine Konrad Rzeszutek Wilk
2015-06-29 21:02   ` Konrad Rzeszutek Wilk
2015-07-01 14:05   ` Stefano Stabellini
2015-07-01 14:05   ` [Qemu-devel] " Stefano Stabellini
2015-06-29 21:02 ` [Qemu-devel] [PATCH RFC 1 8/8] xen/pt: Check for return values for xen_host_pci_[get|set] in init Konrad Rzeszutek Wilk
2015-06-29 21:02   ` Konrad Rzeszutek Wilk
2015-07-01 14:06   ` Stefano Stabellini
2015-07-01 14:06   ` [Qemu-devel] " Stefano Stabellini

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=20150702185410.GA14197@andromeda.dapyr.net \
    --to=konrad@darnok.org \
    --cc=konrad.wilk@oracle.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --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.