feat(power-management-core): bubble up runtime context in daemon/control service

Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
Ariadne Conill 2024-06-28 22:34:07 -07:00
parent 176630f003
commit 051bb7dfe2
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ use krataoci::{
packer::{service::OciPackerService, OciPackedFormat, OciPackedImage},
progress::{OciProgress, OciProgressContext},
};
use kratart::Runtime;
use std::{pin::Pin, str::FromStr};
use tokio::{
select,
@ -68,6 +69,7 @@ pub struct DaemonControlService {
guests: GuestStore,
guest_reconciler_notify: Sender<Uuid>,
packer: OciPackerService,
runtime: Runtime,
}
impl DaemonControlService {
@ -81,6 +83,7 @@ impl DaemonControlService {
guests: GuestStore,
guest_reconciler_notify: Sender<Uuid>,
packer: OciPackerService,
runtime: Runtime,
) -> Self {
Self {
glt,
@ -91,6 +94,7 @@ impl DaemonControlService {
guests,
guest_reconciler_notify,
packer,
runtime,
}
}
}

View File

@ -50,6 +50,7 @@ pub struct Daemon {
idm: DaemonIdmHandle,
console: DaemonConsoleHandle,
packer: OciPackerService,
runtime: Runtime,
}
const GUEST_RECONCILER_QUEUE_LEN: usize = 1000;
@ -136,6 +137,7 @@ impl Daemon {
idm,
console,
packer,
runtime,
})
}
@ -149,6 +151,7 @@ impl Daemon {
self.guests.clone(),
self.guest_reconciler_notify.clone(),
self.packer.clone(),
self.runtime.clone(),
);
let mut server = Server::builder();