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

View File

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