Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ae206e06a | ||
|
|
cf00aac721 | ||
|
|
e76060b02c | ||
|
|
9d9be66a68 | ||
|
|
c95335699c | ||
|
|
edd66dcc12 | ||
|
|
ff284bc497 |
No files matched your search
@@ -0,0 +1,25 @@
|
|||||||
|
name: Queue Runtime Alpha
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [codex/intel-vm-suspend]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: queue-runtime-alpha
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
alpha:
|
||||||
|
if: github.repository == 'reims-go/reims-vgpu'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- name: Queue Alpha for the pushed commit
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh workflow run runtime-preview.yml --repo "$GITHUB_REPOSITORY" --ref master \
|
||||||
|
-f upstream_commit="$GITHUB_SHA" -f publish=true -f supersede=true
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
[submodule "vendor/qemu"]
|
[submodule "vendor/qemu"]
|
||||||
path = vendor/qemu
|
path = vendor/qemu
|
||||||
url = https://github.com/yxc0915/qemu-reims-vgpu.git
|
url = https://github.com/reims-go/qemu-reims-vgpu.git
|
||||||
branch = codex/intel-vm-suspend
|
branch = codex/intel-vm-suspend
|
||||||
@@ -31,6 +31,7 @@ libc.workspace = true
|
|||||||
windows-sys = { workspace = true, features = [
|
windows-sys = { workspace = true, features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_System_Com",
|
"Win32_System_Com",
|
||||||
|
"Win32_System_Threading",
|
||||||
"Win32_UI_Shell",
|
"Win32_UI_Shell",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
|||||||
@@ -743,8 +743,10 @@ runtime's own device. The switches above apply, and `resolution=` too.
|
|||||||
the host's arrow shows over the window, and a minimized window is
|
the host's arrow shows over the window, and a minimized window is
|
||||||
restored and raised. Where the window draws no more (its GPU lost, or no
|
restored and raised. Where the window draws no more (its GPU lost, or no
|
||||||
swapchain), the question shows in SDL's message box instead: zenity's
|
swapchain), the question shows in SDL's message box instead: zenity's
|
||||||
where zenity is installed, else SDL's own X11 dialog. On Windows a task
|
where zenity is installed, else SDL's own X11 dialog. On Windows,
|
||||||
dialog the window owns, Turn Off left of Cancel. Turn Off asks the host
|
Reims-Go can handle the close in its own dialog with Shut down, Suspend
|
||||||
|
and Cancel. When the client handoff fails, SDL shows a task dialog the
|
||||||
|
window owns, Turn Off left of Cancel. Turn Off asks the host
|
||||||
to end the VM; Cancel, or the question dismissed, leaves the window and
|
to end the VM; Cancel, or the question dismissed, leaves the window and
|
||||||
the VM running, nothing held in the guest and the input released. From
|
the VM running, nothing held in the guest and the input released. From
|
||||||
the close to the answer nothing of the window's input reaches the guest:
|
the close to the answer nothing of the window's input reaches the guest:
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
//! shutdown request with the power-off action, which the guest is not asked about). So the window
|
//! shutdown request with the power-off action, which the guest is not asked about). So the window
|
||||||
//! asks first, in a question of the host OS's own over the window ([`QUESTION`], [`DETAIL`]), with
|
//! asks first, in a question of the host OS's own over the window ([`QUESTION`], [`DETAIL`]), with
|
||||||
//! two answers: [`CANCEL`], the default, keeps the VM running, and [`TURN_OFF`] tells the host.
|
//! two answers: [`CANCEL`], the default, keeps the VM running, and [`TURN_OFF`] tells the host.
|
||||||
|
//! A Windows VM started by Reims-Go can hand the question to its client
|
||||||
|
//! instead. The client then handles the chosen action.
|
||||||
//!
|
//!
|
||||||
//! **When it asks** ([`Asks::request`]): only where the host would hear of the close, while the
|
//! **When it asks** ([`Asks::request`]): only where the host would hear of the close, while the
|
||||||
//! window lives (the display's release takes the host's callbacks back) and the host gave a close
|
//! window lives (the display's release takes the host's callbacks back) and the host gave a close
|
||||||
@@ -55,6 +57,9 @@ pub(crate) enum Answer {
|
|||||||
Cancel,
|
Cancel,
|
||||||
/// No question could show: nothing happens, as for Cancel, and the OS's side logs why.
|
/// No question could show: nothing happens, as for Cancel, and the OS's side logs why.
|
||||||
Unshown,
|
Unshown,
|
||||||
|
/// Reims-Go's dialog handles the close.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
Delegated,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The process's questions: whether one is open, and whether the person has chosen Turn Off.
|
/// The process's questions: whether one is open, and whether the person has chosen Turn Off.
|
||||||
@@ -108,6 +113,8 @@ pub(crate) fn answered(answer: Answer) -> bool {
|
|||||||
Answer::TurnOff => "the person chose Turn Off: the host turns the VM off",
|
Answer::TurnOff => "the person chose Turn Off: the host turns the VM off",
|
||||||
Answer::Cancel => "the close is cancelled, or its window ended: the host is not told",
|
Answer::Cancel => "the close is cancelled, or its window ended: the host is not told",
|
||||||
Answer::Unshown => "no question showed: the host is not told, and the VM runs on",
|
Answer::Unshown => "no question showed: the host is not told, and the VM runs on",
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
Answer::Delegated => "the close question was handed to Reims-Go",
|
||||||
};
|
};
|
||||||
log::info!(target: "reims_vgpu_window", "{said}");
|
log::info!(target: "reims_vgpu_window", "{said}");
|
||||||
tell
|
tell
|
||||||
@@ -144,5 +151,13 @@ mod tests {
|
|||||||
assert_eq!(unshown.request(true), Step::Ask);
|
assert_eq!(unshown.request(true), Step::Ask);
|
||||||
assert!(!unshown.answered(Answer::Unshown));
|
assert!(!unshown.answered(Answer::Unshown));
|
||||||
assert_eq!(unshown.request(true), Step::Ask);
|
assert_eq!(unshown.request(true), Step::Ask);
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
let mut delegated = Asks::default();
|
||||||
|
assert_eq!(delegated.request(true), Step::Ask);
|
||||||
|
assert!(!delegated.answered(Answer::Delegated));
|
||||||
|
assert_eq!(delegated.request(true), Step::Ask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -657,6 +657,8 @@ fn ask_in_a_dialog(id: u64, ids: Vec<u64>) {
|
|||||||
super::ui::post(move || {
|
super::ui::post(move || {
|
||||||
let parent = shell::with_shell(id, |s| (!s.closed).then_some(s.sdl)).flatten();
|
let parent = shell::with_shell(id, |s| (!s.closed).then_some(s.sdl)).flatten();
|
||||||
let answer = match parent {
|
let answer = match parent {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
Some(_) if super::super::windows::request_client_close() => Answer::Delegated,
|
||||||
Some(parent) => question(parent),
|
Some(parent) => question(parent),
|
||||||
None => Answer::Cancel,
|
None => Answer::Cancel,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ use std::cell::Cell;
|
|||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::net::{SocketAddr, TcpStream};
|
use std::net::{SocketAddr, TcpStream};
|
||||||
|
use std::os::windows::process::CommandExt;
|
||||||
|
use std::process::Command;
|
||||||
use std::ptr::{NonNull, null, null_mut};
|
use std::ptr::{NonNull, null, null_mut};
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use std::sync::mpsc::{self, RecvTimeoutError, SyncSender};
|
use std::sync::mpsc::{self, RecvTimeoutError, SyncSender};
|
||||||
@@ -61,6 +63,7 @@ use windows_sys::Win32::System::Com::{
|
|||||||
CLSCTX_INPROC_SERVER, COINIT_APARTMENTTHREADED, CoCreateInstance, CoInitializeEx,
|
CLSCTX_INPROC_SERVER, COINIT_APARTMENTTHREADED, CoCreateInstance, CoInitializeEx,
|
||||||
CoUninitialize,
|
CoUninitialize,
|
||||||
};
|
};
|
||||||
|
use windows_sys::Win32::System::Threading::CREATE_NO_WINDOW;
|
||||||
use windows_sys::Win32::UI::Shell::TaskbarList;
|
use windows_sys::Win32::UI::Shell::TaskbarList;
|
||||||
use windows_sys::core::{BOOL, GUID, HRESULT};
|
use windows_sys::core::{BOOL, GUID, HRESULT};
|
||||||
|
|
||||||
@@ -69,6 +72,22 @@ use crate::capture::HostOs;
|
|||||||
/// The OS whose names the title gives the release chord's keys: Ctrl+Alt+Win (the module doc).
|
/// The OS whose names the title gives the release chord's keys: Ctrl+Alt+Win (the module doc).
|
||||||
pub(super) const HOST_OS: HostOs = HostOs::Windows;
|
pub(super) const HOST_OS: HostOs = HostOs::Windows;
|
||||||
|
|
||||||
|
/// Asks the Reims-Go desktop instance that started this VM to show its
|
||||||
|
/// close dialog. A failed handoff leaves the SDL dialog available.
|
||||||
|
pub(super) fn request_client_close() -> bool {
|
||||||
|
let Some(executable) = std::env::var_os("REIMS_GO_VM_CLOSE_EXE") else {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let Ok(name) = std::env::var("REIMS_GO_VM_CLOSE_NAME") else {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
Command::new(executable)
|
||||||
|
.arg(format!("--close-vm={name}"))
|
||||||
|
.creation_flags(CREATE_NO_WINDOW)
|
||||||
|
.status()
|
||||||
|
.is_ok_and(|status| status.success())
|
||||||
|
}
|
||||||
|
|
||||||
/// Win32 MSG layout matching winuser.h for SDL_SetWindowsMessageHook.
|
/// Win32 MSG layout matching winuser.h for SDL_SetWindowsMessageHook.
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
struct Win32Msg {
|
struct Win32Msg {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"capabilities": [
|
"capabilities": [
|
||||||
|
"client-window-close",
|
||||||
"display-fixed-mode",
|
"display-fixed-mode",
|
||||||
"nested-virt-nonfatal",
|
"nested-virt-nonfatal",
|
||||||
"vm-suspend",
|
"vm-suspend",
|
||||||
|
|||||||
Vendored
+1
-1
Submodule vendor/qemu updated: c67660108a...e6d7cb7422.
Reference in new issue
Block a user