diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/stack_manager.sh | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/scripts/stack_manager.sh b/scripts/stack_manager.sh index 0b62170..ef8385a 100755 --- a/scripts/stack_manager.sh +++ b/scripts/stack_manager.sh @@ -11,6 +11,8 @@ FIRMWARE_PATH="$BASE_DIR/firmware/57X-GSP/570.144/gsp-570.144.fwimage.bin" FIRMWARE_DEST="/lib/firmware/gsp-570.144.fwimage.bin" MDEV_SCRIPT="$BASE_DIR/scripts/create_mdev.sh" +# Legacy direct-QEMU script retained for reference only - VM launch MUST go +# through the harness (vgpu_vm.py). See cmd_launch_qemu. QEMU_SCRIPT="$BASE_DIR/scripts/launch_qemu_vgpu.sh" TEST_SCRIPT="$BASE_DIR/scripts/test_vgpu_stack.sh" @@ -226,12 +228,16 @@ cmd_list_mdev() { # ============================================================ cmd_launch_qemu() { - log_info "Launching QEMU with vGPU..." - if [[ ! -f "$QEMU_SCRIPT" ]]; then - log_err "launch_qemu_vgpu.sh not found" + # WORKFLOW RULE: always use the QEMU harness (vgpu_vm.py), never + # or raw QEMU directly - the harness owns , mdev lifecycle, QMP, + # guest-agent and serial logging. + local harness="$BASE_DIR/scripts/vgpu_vm.py" + if [[ ! -f "$harness" ]]; then + log_err "vgpu_vm.py harness not found at $harness" return 1 fi - "$QEMU_SCRIPT" "$@" + log_info "Launching QEMU with vGPU via harness (vgpu_vm.py)..." + "$harness" start "${1:-vgpu-linux}" } # ============================================================ @@ -273,12 +279,20 @@ cmd_dmesg() { } cmd_debug_qemu() { - log_info "Starting debug QEMU session..." - if [[ ! -f "$BASE_DIR/scripts/debug_guest_init.sh" ]]; then - log_err "debug_guest_init.sh not found" + # WORKFLOW RULE: harness only. The vgpu-linux.yaml already sets + # serialLog=/tmp/vgpu-guest-serial.log and gdbPort=1234, so a normal + # harness start IS the debug session: attach GDB with + # gdb -ex 'target remote localhost:1234' + # and follow the guest serial log plus host dmesg. + local harness="$BASE_DIR/scripts/vgpu_vm.py" + if [[ ! -f "$harness" ]]; then + log_err "vgpu_vm.py harness not found at $harness" return 1 fi - "$BASE_DIR/scripts/debug_guest_init.sh" "$@" + log_info "Starting debug session via harness (GDB stub tcp::1234, serial /tmp/vgpu-guest-serial.log)..." + "$harness" start "${1:-vgpu-linux}" + log_info "Attach GDB: gdb -ex 'target remote localhost:1234'" + log_info "Serial log: tail -f /tmp/vgpu-guest-serial.log" } cmd_cleanup_crash() { |
