Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a poweroff command should result in an exit #87

Open
rminnich opened this issue Apr 21, 2022 · 4 comments
Open

a poweroff command should result in an exit #87

rminnich opened this issue Apr 21, 2022 · 4 comments

Comments

@rminnich
Copy link
Contributor

If you run a poweroff command in (e.g.) qemu or cloud hypervisor, the vmm exits. This is very convenient.

It would be nice if gokvm did too. I will try to see why it does not.

@bobuhiro11
Copy link
Owner

bobuhiro11 commented Apr 24, 2022

I will check too.

# qemu
$ make qemu
/ # poweroff
/ # umount: none busy - remounted read-only
umount: can't unmount /: Invalid argument
swapoff: can't open '/etc/fstab': No such file or directory
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system poweroff
[   11.643784][   T46] reboot: System halted

# gokvm
$ make run
/ # poweroff
umount: none busy - remounted read-only
/ # umount: can't unmount /: Invalid argument
swapoff: can't open '/etc/fstab': No such file or directory
The system is going down NOW!
Sent SIGTERM to all processes
[  552.033085][    C2] xmit_skb:1648: eth0: xmit 00000000357b564e 33:33:00:00:00:02
Sent [  553.361168][   T65] reboot: System halted

@rminnich
Copy link
Contributor Author

This is probably because the reset via write to cf9 is broken. This is going to take some rework. I think it's due to smp support.

@rminnich
Copy link
Contributor Author

FYI, this used to work.

@bobuhiro11
Copy link
Owner

You have a point.
Maybe there is an IO Out happening with executing poweroff command and the handling of it is lacking. I will look into it.

   941     funcOutbCF9 := func(port uint64, bytes []byte) error {
   942         if len(bytes) == 1 && bytes[0] == 0xe {
   943             return fmt.Errorf("write 0xe to cf9: %w", ErrWriteToCF9)
   944         }
   945
   946         return fmt.Errorf("write %#x to cf9: %w", bytes, ErrWriteToCF9)
   947     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants