From: Hani Benhabiles <kroosec@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] usb: Fix usb-bt-dongle segfault.
Date: Tue, 17 Jun 2014 23:53:39 +0100 [thread overview]
Message-ID: <20140617225312.GA18998@Inspiron-3521> (raw)
In-Reply-To: <539EB23A.7030608@redhat.com>
On Mon, Jun 16, 2014 at 11:00:42AM +0200, Paolo Bonzini wrote:
> Il 15/06/2014 23:37, Hani Benhabiles ha scritto:
> >>>diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
> >>>index a9661d2..6d02343 100644
> >>>--- a/hw/usb/dev-bluetooth.c
> >>>+++ b/hw/usb/dev-bluetooth.c
> >>>@@ -506,6 +506,12 @@ static int usb_bt_initfn(USBDevice *dev)
> >>>
> >>> usb_desc_create_serial(dev);
> >>> usb_desc_init(dev);
> >>>+ s->dev.opaque = s;
> >>>+ s->hci = bt_new_hci(qemu_find_bt_vlan(0));
> >>>+ s->hci->opaque = s;
> >>>+ s->hci->evt_recv = usb_bt_out_hci_packet_event;
> >>>+ s->hci->acl_recv = usb_bt_out_hci_packet_acl;
> >>>+ usb_bt_handle_reset(&s->dev);
> >>
> >>
> >>All lines but the s->hci assignment should be removed from usb_bt_init too.
> >>
> >>As to s->hci, I suggest inlining usb_create_simple into usb_bt_init, and
> >>initializing s->hci there before doing the qdev_init() call.
> >>
> >>Then here you can wrap the assignment under "if (!s->hci)".
> >
> >I am afraid I don't quite understand what you want to achieve with this and why.
> >
> >Could you please explain how is usb_bt_init() relevant to this case ?
>
> usb_bt_init() ends up calling usb_bt_initfn(), via usb_create_simple. So if
> you add code to usb_bt_initfn() you can remove the corresponding lines in
> usb_bt_init().
Thanks for the clarification. I forgot about -usbdevice bt, will send v2 shortly.
prev parent reply other threads:[~2014-06-17 22:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 17:25 [Qemu-devel] [PATCH] usb: Fix usb-bt-dongle segfault Hani Benhabiles
2014-06-11 18:58 ` Paolo Bonzini
2014-06-15 21:37 ` Hani Benhabiles
2014-06-16 9:00 ` Paolo Bonzini
2014-06-17 22:53 ` Hani Benhabiles [this message]
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=20140617225312.GA18998@Inspiron-3521 \
--to=kroosec@gmail.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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.