From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kg0Eq-0002Xy-Ts for qemu-devel@nongnu.org; Wed, 17 Sep 2008 12:50:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kg0Ep-0002X0-0o for qemu-devel@nongnu.org; Wed, 17 Sep 2008 12:50:48 -0400 Received: from [199.232.76.173] (port=59699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg0Eo-0002Wt-PS for qemu-devel@nongnu.org; Wed, 17 Sep 2008 12:50:46 -0400 Received: from mail.gmx.net ([213.165.64.20]:41458) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Kg0En-00087W-Oc for qemu-devel@nongnu.org; Wed, 17 Sep 2008 12:50:46 -0400 Message-ID: <48D13562.4090808@gmx.at> Date: Wed, 17 Sep 2008 18:50:42 +0200 From: Andreas Winkelbauer MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080102030302000003070701" Subject: [Qemu-devel] [PATCH] change auto filter output format of "info usbhost" (v1) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080102030302000003070701 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This patch changes the output format of the monitor command "info usbhost" for usb auto filters in usb_host_info(). The VID and PID are now printed as 4 digit hexadecimal numbers with leading zeros (which is much more usual compared to the current output format which does not print leading zeros). Signed-off-by: Andreas Winkelbauer --- bye, Andi --------------080102030302000003070701 Content-Type: text/x-patch; name="qemu-autofilter-monitor-v1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-autofilter-monitor-v1.patch" diff -uNrp trunk.orig/usb-linux.c trunk/usb-linux.c --- trunk.orig/usb-linux.c 2008-09-17 02:11:53.000000000 +0200 +++ trunk/usb-linux.c 2008-09-17 14:07:01.000000000 +0200 @@ -1462,7 +1462,7 @@ static void hex2str(int val, char *str) if (val == -1) strcpy(str, "*"); else - sprintf(str, "%x", val); + sprintf(str, "%04x", val); } void usb_host_info(void) @@ -1474,12 +1474,12 @@ void usb_host_info(void) if (usb_auto_filter) term_printf(" Auto filters:\n"); for (f = usb_auto_filter; f; f = f->next) { - char bus[10], addr[10], vid[10], pid[10]; + char bus[10], addr[10], vid[5], pid[5]; dec2str(f->bus_num, bus); dec2str(f->addr, addr); hex2str(f->vendor_id, vid); hex2str(f->product_id, pid); - term_printf(" Device %s.%s ID %s:%s\n", bus, addr, vid, pid); + term_printf(" Device %s.%s ID %s:%s\n", bus, addr, vid, pid); } } --------------080102030302000003070701--