Received: from eggs.gnu.org ([2001:4830:134:3::10]:51262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5r6W-0001uI-56 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:52:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5r6R-0006jL-JY for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:52:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5r6R-0006ik-F3 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 03:52:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id DB61CC6A06 for ; Fri, 19 Jun 2015 07:52:42 +0000 (UTC) Date: Fri, 19 Jun 2015 09:52:40 +0200 From: "Michael S. Tsirkin" Message-ID: <20150619094927-mutt-send-email-mst@redhat.com> References: <1434620035-10808-1-git-send-email-kraxel@redhat.com> <1434620035-10808-2-git-send-email-kraxel@redhat.com> <20150618113745-mutt-send-email-mst@redhat.com> <1434642288.4968.51.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434642288.4968.51.camel@redhat.com> Subject: Re: [Qemu-devel] [PULL 1/1] virtio-input: evdev passthrough List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On Thu, Jun 18, 2015 at 05:44:48PM +0200, Gerd Hoffmann wrote: > Hi, > > > > +static Property virtio_input_host_pci_properties[] = { > > > + DEFINE_VIRTIO_INPUT_PROPERTIES(VirtIOInputPCI, vdev.input), > > > + DEFINE_PROP_STRING("evdev", VirtIOInputHostPCI, vdev.evdev), > > > + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), > > > + DEFINE_PROP_END_OF_LIST(), > > > +}; > > > + > > > > Hmm I only noticed this now: I think properties > > should all move into virtio input, there is > > no reason to make them pci specific. > > Hmm, looking into this. Can't figure how this works. For virtio-net a > bunch of properties are defined for virtio-net-device. But they show up > (using -device $dev,?) on both virtio-net-device and virtio-net-pci. > > Trying to do the same for the (already merged) virtio-input hid devices. > Not working. Patch below. Any clues? > > thanks, > Gerd > I think the missing magic is virtio_instance_init_common which calls qdev_alias_all_properties. > diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c > index f7c6bc9..55998a2 100644 > --- a/hw/input/virtio-input-hid.c > +++ b/hw/input/virtio-input-hid.c > @@ -337,10 +337,17 @@ static void virtio_input_hid_handle_status(VirtIOInput *vinput, > } > } > > +static Property virtio_input_hid_properties[] = { > + DEFINE_VIRTIO_INPUT_PROPERTIES(VirtIOInput, input), > + DEFINE_PROP_END_OF_LIST(), > +}; > + > static void virtio_input_hid_class_init(ObjectClass *klass, void *data) > { > + DeviceClass *dc = DEVICE_CLASS(klass); > VirtIOInputClass *vic = VIRTIO_INPUT_CLASS(klass); > > + dc->props = virtio_input_hid_properties; > vic->realize = virtio_input_hid_realize; > vic->unrealize = virtio_input_hid_unrealize; > vic->change_active = virtio_input_hid_change_active; > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index 2c053c7..46dc77a 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -1901,7 +1901,6 @@ static const TypeInfo virtio_rng_pci_info = { > /* virtio-input-pci */ > > static Property virtio_input_hid_pci_properties[] = { > - DEFINE_VIRTIO_INPUT_PROPERTIES(VirtIOInputPCI, vdev.input), > DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), > DEFINE_PROP_END_OF_LIST(), > };