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

Feature Request- ACPI Wakeup Call upon initializing VM from saved image state #1075

Open
evonox opened this issue Jul 7, 2024 · 2 comments

Comments

@evonox
Copy link

evonox commented Jul 7, 2024

I have the following use case. When I load the OS Linux from the saved image, it contains incorrect date and time. I would like to detect in the hosted OS that the image was woken up and synchronize time from the V86 emulator, for instance using a Bash script. Could the OS Linux receive from ACPI subsystem for instance signal or interrupt that it was awaken from hibernation to automatically synch the clock with the valid value?

@SuperMaxusa
Copy link
Contributor

SuperMaxusa commented Jul 8, 2024

I would like to detect in the hosted OS that the image was woken up and synchronize time from the V86 emulator, for instance using a Bash script.

You can run hwclock -s (#754) to synchronize time and date from RTC clock.

Could the OS Linux receive from ACPI subsystem for instance signal or interrupt that it was awaken from hibernation to automatically synch the clock with the valid value?

Load from state is not like a hibernation, it's just restore from file your RAM state, some device state and other settings, so I don' t think that ACPI sends any signal after restoring.

Maybe you can run this command (emulator.serial0_send() or emulator.keyboard_send_text()) automatically on emulator-ready or emulator-started events (or if something else is found for #1065).

If it will be helpful, you can run

(( sleep 20 ; hwclock -s ) & ) && clear 

and save state when screen is cleared.

(explanation: this script runs a small task for updating time on background with timeout 20 second (you can choose any value), and clears screen in same time)

@copy
Copy link
Owner

copy commented Oct 21, 2024

Besides using a serial/virtio/keyboard, we don't really have a way to programmatically communicate with the guest OS.

Here is a similar feature request: #993

If we implement the qemu guest agent protocol (which requires virtio-serial), there is already functionality for setting the guest datetime. qemu guest agent has drivers for Windows and Linux.

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

3 participants