mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v7] usbip: make remote list honor parsable output
@ 2026-09-07  8:36 Jason Colapietro
  2026-09-14 17:43 ` Jason Colapietro
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Colapietro @ 2026-09-07  8:36 UTC (permalink / raw)
  To: shuah, skhan, valentina.manea.m; +Cc: greg, i, linux-usb, linux-kernel

The -p option is accepted in every list mode and `usbip help list`
documents it as "Parsable list format", but it only ever reached the
local (-l) and gadget (-d) paths. list_exported_devices() never took
the flag, so -r ignores it and always prints the human-readable report.

Both commands below pass -p, and only the local one honors it:

  $ usbip list -p -l
  busid=1-2#usbid=1a86:55d4#
  busid=2-1#usbid=0627:0001#

  $ usbip list -p -r localhost
  Exportable USB devices
  ======================
   - localhost
          2-3: ATECH FLASH TECHNOLOGY : Kingston SNA-DC/U (11b0:6298)
             : /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-3
             : (Defined at Interface level) (00/00/00)

`usbip list -r <host>` and `usbip list -p -r <host>` produce
byte-identical output, so a script has to scrape the decorated report
instead: the column padding, the " - <host>" banner, the blank line
between devices and the per-interface lines. That is what the reporter
hit in bugzilla 219502.

Use one file-scope flag for the list command and honor it in the remote
listing path. Emit the same busid and usbid record used for local
devices while continuing to consume every interface record from the
server. After the change -r produces the record shape -l already does:

  $ usbip list -p -r 127.0.0.1
  busid=1-1#usbid=0781:5583#
  busid=1-2#usbid=046d:c52b#

so the obvious loop works against a remote host:

  for b in $(usbip list -p -r "$host" | sed 's/^busid=//; s/#.*//'); do
          usbip attach -r "$host" -b "$b"
  done

Without -p the remote output is unchanged.

Fixes: e9837bbb3e69 ("staging: usbip: userspace tools v1.0.0")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219502
Assisted-by: Codex:gpt-5
Signed-off-by: Jason Colapietro <jasoncola1@gmail.com>
---
v6 -> v7:
- Fix the Assisted-by trailer to use the required
  AGENT_NAME:MODEL_VERSION format.
- No code changes; the diff is identical to v6.

v5 -> v6:
- Fold a condensed before/after into the commit message, as Shuah asked
  for on v2. No code changes; the diff is identical to v5.
- Restore the Assisted-by tag. v7 corrects its format.

Tooling disclosure, per Documentation/process/generated-content.rst: an
AI coding assistant was used for the original code change, and in this
series to rewrite the commit message so it carries the before/after
requested on v2 and to correct the trailer format in v7. The code is
byte-identical to v6. checkpatch.pl --strict reports no errors, and the
patch applies cleanly with git am onto mainline.

v4 -> v5:
- Drop Cc: stable@vger.kernel.org. This changes the user-visible output
  of "usbip list -r -p", so it is not a stable backport candidate.

v3 -> v4:
- Make parsable file-scope instead of passing it through list helpers.
- Drop the option-ordering change to preserve existing behavior.

Two behaviours I checked beyond the output quoted above:

- The connection stays in sync. Interface records are still read from
  the socket in parsable mode, only the printf is suppressed. To confirm
  that rather than assert it, I had the test server withhold the final
  4-byte usbip_usb_interface record for 3 seconds: the patched client
  with -p blocks for the full 3 seconds, so it really is draining every
  record.

- With no exported devices, -p prints nothing on stdout ("no exportable
  devices found on <host>" still goes to stderr), so stdout stays clean.

Testing disclosure: my checkout is on macOS, so I have not run a native
USB/IP stack end to end. The output above comes from building the real
usbip_list.c, usbip_network.c, usbip_common.c and names.c against a stub
libudev -- the remote path never calls udev, and the stubs abort if
reached -- and pointing that binary at a small mock usbipd answering
OP_REQ_DEVLIST with a real OP_REP_DEVLIST payload. The -p -l side is a
second build with a fake udev backend presenting the same devices. So it
is the real listing path over a real socket, but not usbip-host or
usbip-vudc on hardware. I am happy to redo the runs on a Linux box, or
to wait for someone with a usbip setup to confirm, before this goes in.

v5: https://lore.kernel.org/r/20260816041518.48053-1-jasoncola1@gmail.com
v4: https://lore.kernel.org/r/20260812210326.21485-1-jasoncola1@gmail.com
 tools/usb/usbip/src/usbip_list.c | 48 +++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/tools/usb/usbip/src/usbip_list.c b/tools/usb/usbip/src/usbip_list.c
index 3d810bcc..482f11d7 100644
--- a/tools/usb/usbip/src/usbip_list.c
+++ b/tools/usb/usbip/src/usbip_list.c
@@ -36,6 +36,8 @@ static const char usbip_list_usage_string[] =
 	"    -l, --local            List the local USB devices\n"
 	"    -d, --device           List the local USB gadgets bound to usbip-vudc\n";

+static bool parsable;
+
 void usbip_list_usage(void)
 {
 	printf("usage: %s", usbip_list_usage_string);
@@ -80,9 +82,11 @@ static int get_exported_devices(char *host, int sockfd)
 		return 0;
 	}

-	printf("Exportable USB devices\n");
-	printf("======================\n");
-	printf(" - %s\n", host);
+	if (!parsable) {
+		printf("Exportable USB devices\n");
+		printf("======================\n");
+		printf(" - %s\n", host);
+	}

 	for (i = 0; i < reply.ndev; i++) {
 		memset(&udev, 0, sizeof(udev));
@@ -98,9 +102,14 @@ static int get_exported_devices(char *host, int sockfd)
 		usbip_names_get_class(class_name, sizeof(class_name),
 				      udev.bDeviceClass, udev.bDeviceSubClass,
 				      udev.bDeviceProtocol);
-		printf("%11s: %s\n", udev.busid, product_name);
-		printf("%11s: %s\n", "", udev.path);
-		printf("%11s: %s\n", "", class_name);
+		if (parsable) {
+			printf("busid=%s#usbid=%04x:%04x#\n", udev.busid,
+			       udev.idVendor, udev.idProduct);
+		} else {
+			printf("%11s: %s\n", udev.busid, product_name);
+			printf("%11s: %s\n", "", udev.path);
+			printf("%11s: %s\n", "", class_name);
+		}

 		for (j = 0; j < udev.bNumInterfaces; j++) {
 			rc = usbip_net_recv(sockfd, &uintf, sizeof(uintf));
@@ -116,10 +125,12 @@ static int get_exported_devices(char *host, int sockfd)
 					uintf.bInterfaceClass,
 					uintf.bInterfaceSubClass,
 					uintf.bInterfaceProtocol);
-			printf("%11s: %2d - %s\n", "", j, class_name);
+			if (!parsable)
+				printf("%11s: %2d - %s\n", "", j, class_name);
 		}

-		printf("\n");
+		if (!parsable)
+			printf("\n");
 	}

 	return 0;
@@ -150,7 +161,7 @@ static int list_exported_devices(char *host)
 }

 static void print_device(const char *busid, const char *vendor,
-			 const char *product, bool parsable)
+			 const char *product)
 {
 	if (parsable)
 		printf("busid=%s#usbid=%.4s:%.4s#", busid, vendor, product);
@@ -158,13 +169,13 @@ static void print_device(const char *busid,
const char *vendor,
 		printf(" - busid %s (%.4s:%.4s)\n", busid, vendor, product);
 }

-static void print_product_name(char *product_name, bool parsable)
+static void print_product_name(char *product_name)
 {
 	if (!parsable)
 		printf("   %s\n", product_name);
 }

-static int list_devices(bool parsable)
+static int list_devices(void)
 {
 	struct udev *udev;
 	struct udev_enumerate *enumerate;
@@ -229,8 +240,8 @@ static int list_devices(bool parsable)
 					strtol(idProduct, NULL, 16));

 		/* Print information. */
-		print_device(busid, idVendor, idProduct, parsable);
-		print_product_name(product_name, parsable);
+		print_device(busid, idVendor, idProduct);
+		print_product_name(product_name);

 		printf("\n");

@@ -246,7 +257,7 @@ err_out:
 	return ret;
 }

-static int list_gadget_devices(bool parsable)
+static int list_gadget_devices(void)
 {
 	int ret = -1;
 	struct udev *udev;
@@ -307,8 +318,8 @@ static int list_gadget_devices(bool parsable)
 					le16toh(idProduct));

 		/* Print information. */
-		print_device(busid, idVendor_buf, idProduct_buf, parsable);
-		print_product_name(product_name, parsable);
+		print_device(busid, idVendor_buf, idProduct_buf);
+		print_product_name(product_name);

 		printf("\n");

@@ -333,7 +344,6 @@ int usbip_list(int argc, char *argv[])
 		{ NULL,       0,                 NULL,  0  }
 	};

-	bool parsable = false;
 	int opt;
 	int ret = -1;

@@ -354,10 +364,10 @@ int usbip_list(int argc, char *argv[])
 			ret = list_exported_devices(optarg);
 			goto out;
 		case 'l':
-			ret = list_devices(parsable);
+			ret = list_devices();
 			goto out;
 		case 'd':
-			ret = list_gadget_devices(parsable);
+			ret = list_gadget_devices();
 			goto out;
 		default:
 			goto err_out;

-- 
2.50.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-09-07  8:36 [PATCH v7] usbip: make remote list honor parsable output Jason Colapietro
@ 2026-09-14 17:43 ` Jason Colapietro
  2026-09-23  8:44   ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Colapietro @ 2026-09-14 17:43 UTC (permalink / raw)
  To: shuah, skhan, valentina.manea.m; +Cc: greg, i, linux-usb, linux-kernel

Hi all,

Friendly ping on v7, sent September 7. The code remains identical to
v6; v7 only corrected the Assisted-by trailer format. Please let me
know if any further changes or native Linux/USB-IP testing would help
move this forward.

Thanks,
Jason

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-09-14 17:43 ` Jason Colapietro
@ 2026-09-23  8:44   ` Shuah Khan
  2026-09-27  4:00     ` Jason Colapietro
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2026-09-23  8:44 UTC (permalink / raw)
  To: Jason Colapietro, shuah, valentina.manea.m
  Cc: greg, i, linux-usb, linux-kernel, Shuah Khan

On 9/14/26 11:43, Jason Colapietro wrote:
> Hi all,
> 
> Friendly ping on v7, sent September 7. The code remains identical to
> v6; v7 only corrected the Assisted-by trailer format. Please let me
> know if any further changes or native Linux/USB-IP testing would help
> move this forward.
> 

Sorry. It is important to test end to end on a Linux machine to verify
patches. I can't accept patches that aren't tested on macOS - it just
doesn't make sense to do so.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-09-23  8:44   ` Shuah Khan
@ 2026-09-27  4:00     ` Jason Colapietro
  2026-10-01 12:49       ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Colapietro @ 2026-09-27  4:00 UTC (permalink / raw)
  To: Shuah Khan, shuah, valentina.manea.m; +Cc: greg, i, linux-usb, linux-kernel

Hi Shuah and all,

The exact v7 patch has now been built and tested with a native Linux
USB/IP stack.

Test setup: Alpine Linux 3.23.4 on aarch64, kernel 6.18.53-0-lts,
usbip-utils 2.0. A QEMU USB mass-storage device (46f4:0001, busid 2-1)
was bound to usbip-host and exported by usbipd. The client connected
to 127.0.0.1:3240.

With the unpatched client, "usbip list -p -r 127.0.0.1" still printed
the human-readable "Exportable USB devices" report, reproducing the
bug. With the v7 client, the same command returned:

    busid=2-1#usbid=46f4:0001#

"usbip list -r 127.0.0.1" retained its human-readable output,
including the device path and interface details. After unbinding the
device, the parsable command exited successfully with zero bytes on
stdout; rebinding restored the record.

I also attached busid 2-1 through the v7 client. "usbip port" showed
it imported through vhci_hcd at port 08, and lsusb showed the device
on both the original and virtual host buses. Detach succeeded, leaving
no imported port. The build, list, attach, and detach commands all
exited successfully.

This was one Linux VM with an emulated USB device and TCP loopback. I
have not tested physical USB hardware or two separate machines. The
existing option-order behavior is unchanged: -p must precede -r.

Thanks,
Jason

On Wed, 23 Sep 2026 02:44:58 -0600, Shuah Khan
<skhan@linuxfoundation.org> wrote:
> On 9/14/26 11:43, Jason Colapietro wrote:
> > Hi all,
> >
> > Friendly ping on v7, sent September 7. The code remains identical to
> > v6; v7 only corrected the Assisted-by trailer format. Please let me
> > know if any further changes or native Linux/USB-IP testing would help
> > move this forward.
> >
>
> Sorry. It is important to test end to end on a Linux machine to verify
> patches. I can't accept patches that aren't tested on macOS - it just
> doesn't make sense to do so.
>
> thanks,
> -- Shuah

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-09-27  4:00     ` Jason Colapietro
@ 2026-10-01 12:49       ` Shuah Khan
  2026-10-01 12:53         ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2026-10-01 12:49 UTC (permalink / raw)
  To: Jason Colapietro, shuah, valentina.manea.m
  Cc: greg, i, linux-usb, linux-kernel, Shuah Khan

On 9/26/26 22:00, Jason Colapietro wrote:
> Hi Shuah and all,
> 
> The exact v7 patch has now been built and tested with a native Linux
> USB/IP stack.
> 
> Test setup: Alpine Linux 3.23.4 on aarch64, kernel 6.18.53-0-lts,
> usbip-utils 2.0. A QEMU USB mass-storage device (46f4:0001, busid 2-1)
> was bound to usbip-host and exported by usbipd. The client connected
> to 127.0.0.1:3240.
> 
> With the unpatched client, "usbip list -p -r 127.0.0.1" still printed
> the human-readable "Exportable USB devices" report, reproducing the
> bug. With the v7 client, the same command returned:
> 
>      busid=2-1#usbid=46f4:0001#
> 
> "usbip list -r 127.0.0.1" retained its human-readable output,
> including the device path and interface details. After unbinding the
> device, the parsable command exited successfully with zero bytes on
> stdout; rebinding restored the record.
> 
> I also attached busid 2-1 through the v7 client. "usbip port" showed
> it imported through vhci_hcd at port 08, and lsusb showed the device
> on both the original and virtual host buses. Detach succeeded, leaving
> no imported port. The build, list, attach, and detach commands all
> exited successfully.
> 
> This was one Linux VM with an emulated USB device and TCP loopback. I
> have not tested physical USB hardware or two separate machines. The
> existing option-order behavior is unchanged: -p must precede -r.

Please test this with two systems hots running on one and client on the
other. Send me before and after output that shows the bug and that it is
fixed by your change.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-10-01 12:49       ` Shuah Khan
@ 2026-10-01 12:53         ` Shuah Khan
  2026-10-01 16:13           ` jasoncola1
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2026-10-01 12:53 UTC (permalink / raw)
  To: Jason Colapietro, shuah, valentina.manea.m
  Cc: greg, i, linux-usb, linux-kernel, Shuah Khan

On 10/1/26 06:49, Shuah Khan wrote:
> On 9/26/26 22:00, Jason Colapietro wrote:
>> Hi Shuah and all,
>>
>> The exact v7 patch has now been built and tested with a native Linux
>> USB/IP stack.
>>
>> Test setup: Alpine Linux 3.23.4 on aarch64, kernel 6.18.53-0-lts,
>> usbip-utils 2.0. A QEMU USB mass-storage device (46f4:0001, busid 2-1)
>> was bound to usbip-host and exported by usbipd. The client connected
>> to 127.0.0.1:3240.
>>
>> With the unpatched client, "usbip list -p -r 127.0.0.1" still printed
>> the human-readable "Exportable USB devices" report, reproducing the
>> bug. With the v7 client, the same command returned:
>>
>>      busid=2-1#usbid=46f4:0001#
>>
>> "usbip list -r 127.0.0.1" retained its human-readable output,
>> including the device path and interface details. After unbinding the
>> device, the parsable command exited successfully with zero bytes on
>> stdout; rebinding restored the record.
>>
>> I also attached busid 2-1 through the v7 client. "usbip port" showed
>> it imported through vhci_hcd at port 08, and lsusb showed the device
>> on both the original and virtual host buses. Detach succeeded, leaving
>> no imported port. The build, list, attach, and detach commands all
>> exited successfully.
>>
>> This was one Linux VM with an emulated USB device and TCP loopback. I
>> have not tested physical USB hardware or two separate machines. The
>> existing option-order behavior is unchanged: -p must precede -r.
> 
> Please test this with two systems hots running on one and client on the
> other. Send me before and after output that shows the bug and that it is
> fixed by your change.

Another thing. This needs to be reproduced and tested on the latest kenel,
Linux 7.3-rc5

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7] usbip: make remote list honor parsable output
  2026-10-01 12:53         ` Shuah Khan
@ 2026-10-01 16:13           ` jasoncola1
  0 siblings, 0 replies; 7+ messages in thread
From: jasoncola1 @ 2026-10-01 16:13 UTC (permalink / raw)
  To: Shuah Khan, shuah, valentina.manea.m; +Cc: greg, i, linux-usb, linux-kernel

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

Hi Shuah and all,

I tested the exact v7 patch with the host and client on two separate
x86_64 QEMU VMs, both running Linux 7.3.0-rc5, built from the official
v7.3-rc5 tag (72d3fcf802c45d00b300f25b848a93c3a2bd7c7e).

The host was 192.0.2.1 and the client 192.0.2.2. A QEMU USB mass-storage
device (46f4:0001, busid 2-1) was bound to usbip-host and exported by
the real usbipd on port 3240. Both client binaries were built from the
same 7.3-rc5 usbip-utils 2.0 sources; only the v7 change differs.

Before, on the client:
$ /opt/usbip-before/usbip list -p -r 192.0.2.1
Exportable USB devices
======================
 - 192.0.2.1
        2-1: QEMU : QEMU USB mass storage (46f4:0001)
           : /sys/devices/pci0000:00/0000:00:03.0/usb2/2-1
           : (Defined at Interface level) (00/00/00)
exit=0

After, on the same client against the same host:
$ /opt/usbip-after/usbip list -p -r 192.0.2.1
busid=2-1#usbid=46f4:0001#
exit=0

The output without -p was byte-identical before and after. The v7
client also attached the device at VHCI port 08, enumerated it as
/dev/sda, and read the full 1 MiB disk. Its SHA-256 matched the source:
87b755d14716cb3fd1622fae9c5dc5f7e2b758fb1b4c2575234839ba2f7d6b03
Detach succeeded and left no imported port. Unbinding on the host made
the parsable list exit 0 with zero bytes on stdout; rebinding restored
the record. All commands passed. The attached report records exact
commands, output, exit codes, source identifiers, and test limitations.

These were two VMs on one physical host, with emulated USB hardware,
not two physical machines. No code changes were made to v7; -p still
precedes -r. Codex assisted with test orchestration and this report.

Thanks,
Jason


On Thu, 01 Oct 2026 06:53:52 -0600, Shuah Khan
<skhan@linuxfoundation.org> wrote:
> On 10/1/26 06:49, Shuah Khan wrote:
> > On 9/26/26 22:00, Jason Colapietro wrote:
> >> Hi Shuah and all,
> >>
> >> The exact v7 patch has now been built and tested with a native Linux
> >> USB/IP stack.
> >>
> >> Test setup: Alpine Linux 3.23.4 on aarch64, kernel 6.18.53-0-lts,
> >> usbip-utils 2.0. A QEMU USB mass-storage device (46f4:0001, busid 2-1)
> >> was bound to usbip-host and exported by usbipd. The client connected
> >> to 127.0.0.1:3240.
> >>
> >> With the unpatched client, "usbip list -p -r 127.0.0.1" still printed
> >> the human-readable "Exportable USB devices" report, reproducing the
> >> bug. With the v7 client, the same command returned:
> >>
> >>      busid=2-1#usbid=46f4:0001#
> >>
> >> "usbip list -r 127.0.0.1" retained its human-readable output,
> >> including the device path and interface details. After unbinding the
> >> device, the parsable command exited successfully with zero bytes on
> >> stdout; rebinding restored the record.
> >>
> >> I also attached busid 2-1 through the v7 client. "usbip port" showed
> >> it imported through vhci_hcd at port 08, and lsusb showed the device
> >> on both the original and virtual host buses. Detach succeeded, leaving
> >> no imported port. The build, list, attach, and detach commands all
> >> exited successfully.
> >>
> >> This was one Linux VM with an emulated USB device and TCP loopback. I
> >> have not tested physical USB hardware or two separate machines. The
> >> existing option-order behavior is unchanged: -p must precede -r.
> >
> > Please test this with two systems hots running on one and client on the
> > other. Send me before and after output that shows the bug and that it is
> > fixed by your change.
>
> Another thing. This needs to be reproduced and tested on the latest kenel,
> Linux 7.3-rc5
>
> thanks,
> -- Shuah

[-- Attachment #2: Suede-Linux-USBIP-Two-System-Test-2026-10-01.md --]
[-- Type: text/markdown, Size: 6390 bytes --]

# Linux USB/IP v7: two-system verification — October 1, 2026

**Result: PASS.** The exact submitted v7 patch was tested across two separate Linux 7.3-rc5 systems. The original client reproduced the ignored `-p` flag; the patched client returned the parsable record. All 25 captured command groups exited 0 and all harness assertions passed.

## Environment and provenance

- Two independent x86_64 QEMU 8.2.2 guests, using TCG and a private Ethernet link. Host `192.0.2.1/24`; client `192.0.2.2/24`. USB/IP traffic traversed the guests' TCP stacks; no loopback or mock USB/IP server was used.
- Official Linux tag `v7.3-rc5`, commit `72d3fcf802c45d00b300f25b848a93c3a2bd7c7e`. Kernel sources matched that Git tree with no tracked-file differences. Custom kernel configuration is included.
- Real `usbip-host`, `usbipd`, and `vhci_hcd`; usbip-utils 2.0 built with real libudev, without TCP wrappers. The original and patched client builds share the same source base and configuration. Only `src/usbip_list.c` differs, by the exact September 7 v7 email patch.
- Device: QEMU USB mass-storage `46f4:0001`, busid `2-1`, 1 MiB backing disk. The USB names file contains descriptive labels for this test device; numeric IDs and busid came from real sysfs and the USB/IP protocol.
- The patch applied without conflicts. `checkpatch.pl --strict`: 0 errors, 0 warnings, 0 checks.

## Captured kernel versions

```text
Linux usbip-host 7.3.0-rc5 #5 PREEMPT Thu Oct  1 16:46:50 CEST 2026 x86_64 GNU/Linux
usbip-host
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 52:54:00:12:34:01 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.1/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe12:3401/64 scope link tentative 
       valid_lft forever preferred_lft forever
```

```text
Linux usbip-client 7.3.0-rc5 #5 PREEMPT Thu Oct  1 16:46:50 CEST 2026 x86_64 GNU/Linux
usbip-client
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 52:54:00:12:34:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.2/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe12:3402/64 scope link tentative 
       valid_lft forever preferred_lft forever
```

## Requested before-and-after output

```text
$ /opt/usbip-before/usbip list -p -r 192.0.2.1
Exportable USB devices
======================
 - 192.0.2.1
        2-1: QEMU : QEMU USB mass storage (46f4:0001)
           : /sys/devices/pci0000:00/0000:00:03.0/usb2/2-1
           : (Defined at Interface level) (00/00/00)
exit=0
```

```text
$ /opt/usbip-after/usbip list -p -r 192.0.2.1
busid=2-1#usbid=46f4:0001#
exit=0
```

## Additional verification

| Check | Verified result |
|---|---|
| Original `list -p -r` versus original `list -r` | Byte-identical raw output, confirming the ignored flag |
| Original versus patched `list -r` | Byte-identical raw output |
| Patched parsable format | Exactly one `busid=2-1#usbid=46f4:0001#` record plus newline |
| Attach | Exit 0; imported at VHCI port 08 from `192.0.2.1:3240` |
| Enumeration | Client `/dev/sda` under `vhci_hcd.0`; sysfs IDs `46f4:0001` |
| Data transfer | Full 1 MiB imported disk SHA-256 matched the backing image |
| Detach | Exit 0; no imported port afterward |
| Empty list | Exit 0; stdout exactly zero bytes after host unbind |
| Rebind | Same parsable record returned again |

```text
$ /opt/usbip-after/usbip port
Imported USB devices
====================
Port 08: <Port in Use> at Super Speed(5000Mbps)
       QEMU : QEMU USB mass storage (46f4:0001)
       2-1 -> usbip://192.0.2.1:3240/2-1
           -> remote bus/dev 002/002
exit=0
```

```text
$ sha256sum /dev/sda
87b755d14716cb3fd1622fae9c5dc5f7e2b758fb1b4c2575234839ba2f7d6b03  /dev/sda
exit=0
```

```text
$ sleep 2; /opt/usbip-after/usbip port
Imported USB devices
====================
exit=0
```

```text
$ /opt/usbip-after/usbip list -p -r 192.0.2.1 > /tmp/empty.stdout 2>/tmp/empty.stderr; rc=$?; wc -c /tmp/empty.stdout; cat /tmp/empty.stderr; exit_code=$rc; test "$exit_code" -eq 0
0 /tmp/empty.stdout
usbip: info: no exportable devices found on 192.0.2.1
exit=0
```

```text
$ /opt/usbip-after/usbip list -p -r 192.0.2.1
busid=2-1#usbid=46f4:0001#
exit=0
```

## Scope and limitations

These are two separate VMs on one physical host, with emulated USB hardware. Physical USB hardware, two physical computers, and a WAN were not tested. The kernel is the requested release candidate with a custom configuration. The existing option-order behavior is preserved: `-p` precedes `-r`.

The exported mass-storage device supplied zero interface records in the list reply after binding; this run does not exercise a nonzero-interface list payload. The existing v7 patch continues to receive interface records, but no new claim of such coverage is made here.

No new patch revision or code fix was needed. This report supplies the missing requested verification; maintainer acceptance remains pending. Codex assisted with test orchestration and the report.

## Evidence package

The ZIP includes full serial transcripts, structured results with untrimmed output, per-command logs, kernel configuration and build log, exact v7 patch, original email, client sources and binaries, the tested kernel and initramfs, and the test harness. To rerun with QEMU installed: `python3 run-two-vms.py`. `build-test-kernel.sh` rebuilds the kernel from the pinned source archive and included configuration.

## SHA-256 identities

- `linux-codeload.tar.gz`: `382d6aa48640351df7da6321e156c39155b4a99b0985d4370f7e608729987453`
- `usbip-v7.patch`: `dfb1495fc9d04b83c08e896647e8b5c58fe91198abab006e659d43e86c3987f1`
- `usbip-before/src/usbip_list.c`: `2ed37e969d42a565bc4a317be6fbee2a0244745d9733b036a4622551078ebfec`
- `usbip-after/src/usbip_list.c`: `9472b864b91756bb4753169f54de3c163f61f651f81f189ce28c3932798e9cbe`
- `usbip-before/src/usbip`: `07a18fb8fd994cece07804759e334e0d332eb0984d4050f73aba178fba800915`
- `usbip-after/src/usbip`: `caedbdc35a4581148f512c1de147a8716d1bc5883e71e8e540ef1d7fc2ed092e`
- `linux-7.3-rc5/arch/x86/boot/bzImage`: `08d30afafc0f48e1f88faa512f3445510a36cbfb49ca0cdee755af92696570fc`
- `guest-initramfs.cpio.gz`: `91d9a00b12b296aba305bd9a5e88072e392d81b9a173685afd0d7953b55621f2`
- `usb-test-disk.img`: `87b755d14716cb3fd1622fae9c5dc5f7e2b758fb1b4c2575234839ba2f7d6b03`

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-01 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07  8:36 [PATCH v7] usbip: make remote list honor parsable output Jason Colapietro
2026-09-14 17:43 ` Jason Colapietro
2026-09-23  8:44   ` Shuah Khan
2026-09-27  4:00     ` Jason Colapietro
2026-10-01 12:49       ` Shuah Khan
2026-10-01 12:53         ` Shuah Khan
2026-10-01 16:13           ` jasoncola1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®