# v160 known-good XDVD/iSCSI baseline + safe cleanup/status helpers

v160 preserves the v159 Windows-visible GDR8050L iSCSI attach behavior and the dual_alias XDVD read mapping that allowed the dumper to parse XDFS and title metadata. The changes are deliberately conservative: safer generated Windows helpers, explicit status reporting, and a small read-trace summarizer.


This update preserves the v157/v158 Windows iSCSI attach and XDVD read-map/capture behavior, and fixes the v158 validation failure in the standalone TCP server-tooling smoke.

## What broke in v158

`gdr_host_tcp_bridge.make_bridge()` was updated to pass the new XDVD read-map and READ trace options into `GDRScsiParser`, but the legacy `gdr_host_server.py` wrapper in the workspace constructed an `argparse.Namespace` without those new attributes. That caused:

```text
AttributeError: 'Namespace' object has no attribute 'xdvd_read_map'
```

## v160 changes

- `gdr_host_tcp_bridge.py` now uses safe `getattr(...)` defaults for `xdvd_read_map`, `read_trace_jsonl`, and `read_trace_limit` so old callers cannot crash it.
- Adds/replaces `gdr_host_server.py` with a compatibility wrapper that always runs `gdr_host_tcp_bridge.py` in `--serve` mode while accepting the newer read-map arguments.
- Keeps v158 live iSCSI helper generation and the default live `dual_alias` read mapping.
- Does not change the known-good Windows iSCSI discovery/login/SendTargets behavior.

## Command

```powershell
.\run_gdr8050l_auth_packet_v160_windows_iscsi_bridge.cmd "D:\vscode-workspace\xbox-dvd-tools-v2\disc_dumps\Red Faction II[TQ00501A].xdvd.json" "D:\vscode-workspace\xbox-dvd-tools-v2\disc_dumps\Red Faction II[TQ00501A].iso" --log "D:\vscode-workspace\xbox-dvd-tools-v2\disc_dumps\Red Faction II[TQ00501A].log" --windows-probes --stem gdr8050l_auth_v160_windows_iscsi --write-scsi-script gdr8050l_auth_v160_windows_iscsi_scsi_script.json --iscsi-listen-host 0.0.0.0 --iscsi-advertise-host 192.168.0.8
```

Then use the generated live helper:

```powershell
.\gdr8050l_auth_v160_windows_iscsi_start_iscsi_target.cmd
```

After attaching and running the dumper, send:

```text
gdr8050l_auth_v160_windows_iscsi_read_trace.jsonl
gdr8050l_auth_v160_windows_iscsi_live_windows_iscsi.jsonl
```


## Safe cleanup note

Do not remove CD-ROM PnP devices by friendly name when a real cross-flashed GDR-8163B is attached, because it can also report as `HL-DT-ST DVD-ROM GDR8050L`. Use the generated iSCSI disconnect helper to remove only sessions for the emulator IQN and portal. Use the status helper to distinguish iSCSI sessions from physical drives.

## Read trace summarizer

After a live Windows/VLC/dumper run, summarize READ mapping with:

```powershell
python .\gdr_read_trace_summary.py .\gdr8050l_auth_v160_windows_iscsi_read_trace.jsonl
```

This does not change emulator behavior; it only summarizes host LBA -> ISO LBA mapping, signatures, and XDFS/XBE-related reads.
