crc-org / vfkit

Apache License 2.0
119 stars 23 forks source link

GUI does not close with state HardStop #67

Open baude opened 10 months ago

baude commented 10 months ago

I believe we have a bug (possibly down in vz) where if you run with --gui and the required graphical elements (shown below), when a HardStop state change is requested, the GUI is not closed.

Observations:

Doing something like:

/usr/local/bin/vfkit --bootloader efi,variable-store=/Users/brentbaude/efi-variable-store,create \
    --device virtio-blk,path=/Users/brentbaude/fedora_server.raw \
    --device virtio-net,nat,mac=52:54:00:70:2b:71 \
    --device virtio-rng --device virtio-input,keyboard \
    --device virtio-input,pointing \
    --device virtio-gpu,width=1920,height=1080 \
    --gui \
    --cpus 2 \
    --memory 4192 \
    --restful-uri tcp://localhost:8081

And observe the differences in behavior for the following restful calls:

brentbaude@Brents-Mac-mini vfkit % curl -X POST  -H 'Content-Type: application/json' -d '{"state": "Stop"}'  http://localhost:8081/vm/state
brentbaude@Brents-Mac-mini vfkit % curl -X POST  -H 'Content-Type: application/json' -d '{"state": "HardStop"}'  http://localhost:8081/vm/state
cfergeau commented 9 months ago

This is a Code-Hex/vz issue. I've reported it in https://github.com/Code-Hex/vz/issues/150 and https://github.com/cfergeau/vz/tree/hardstop-gui has a fix. It can be tested in vfkit with go mod edit --replace=github.com/Code-Hex/vz/v3=github.com/cfergeau/vz/v3@hardstop-gui followed by a build.