From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLska-0006uW-EI for qemu-devel@nongnu.org; Mon, 16 May 2011 04:02:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLskZ-0008Qt-AL for qemu-devel@nongnu.org; Mon, 16 May 2011 04:02:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLskZ-0008Qo-2a for qemu-devel@nongnu.org; Mon, 16 May 2011 04:01:59 -0400 Message-ID: <4DD0D9EF.90409@redhat.com> Date: Mon, 16 May 2011 10:01:51 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <4DCD60AF.5090107@codemonkey.ws> In-Reply-To: <4DCD60AF.5090107@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alon Levy , Markus Armbruster , qemu-devel@nongnu.org On 05/13/11 18:47, Anthony Liguori wrote: > On 05/13/2011 11:36 AM, Markus Armbruster wrote: >> When Gerd qdevified USB, he kept legacy -usbdevice working (commit >> 0958b4cc...). What about new USB devices? Should they get a legacy >> syntax, too? Any reason to do that? We already have a number of devices which can be setup via -device only, and that is perfectly fine IMHO. Also I don't want extend the legacy syntax when adding new properties for new features to usb devices, which will add more cases where you have to use -device to use new features. >> The only existing new device is usb-ccid, and it got one in commit >> 36707144. > > What keeps -usbdevice from being a light wrapper to -device such that no > future code is needed for this? Different command line syntax. Each device (which needs/accepts parameters) has a init function to handle the -usbdevice command line, which basically does: * parse old syntax * usb_create() * qdev_set_prop_*() calls * qdev_init > I know some of the names are different but presumably we could use a map > for existing ones and pass through names for newer ones. Just the device name is easy, there is a field in USBDeviceInfo for that already, and in fact "-usbdevice tablet" acts like "-device usb-tablet" thanks to that entry ;) cheers, Gerd