qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Winkelbauer <andreas.winkelbauer@gmx.at>
To: aliguori@us.ibm.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] change auto filter output format of "info usbhost" (v1)
Date: Wed, 17 Sep 2008 18:50:42 +0200	[thread overview]
Message-ID: <48D13562.4090808@gmx.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

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 <andreas.winkelbauer@gmx.at>
---

bye,
Andi

[-- Attachment #2: qemu-autofilter-monitor-v1.patch --]
[-- Type: text/x-patch, Size: 960 bytes --]

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);
     }
 }
 

                 reply	other threads:[~2008-09-17 16:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48D13562.4090808@gmx.at \
    --to=andreas.winkelbauer@gmx.at \
    --cc=aliguori@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).