more hvm work

This commit is contained in:
Alex Zenla
2024-05-08 02:30:48 -07:00
parent 29b3f91e60
commit 7fb2732f4b
4 changed files with 23 additions and 16 deletions

View File

@ -23,7 +23,7 @@ async fn main() -> Result<()> {
mem_mb: 512,
kernel: fs::read(&kernel_image_path).await?,
initrd: fs::read(&initrd_path).await?,
cmdline: "console=hvc0 debug earlyprintk=xen,keep loglevel=10".to_string(),
cmdline: "earlyprintk=xen earlycon=xen console=hvc0 init=/init".to_string(),
swap_console_backend: None,
disks: vec![],
channels: vec![],

View File

@ -169,12 +169,7 @@ impl XenClient {
created: &CreateDomain,
config: &DomainConfig,
) -> Result<CreatedDomain> {
trace!(
"XenClient init domid={} domain={:?} config={:?}",
domid,
created,
config
);
trace!("XenClient init domid={} domain={:?}", domid, created,);
let backend_dom_path = self.store.get_domain_path(0).await?;
let dom_path = self.store.get_domain_path(domid).await?;
let uuid_string = Uuid::from_bytes(created.handle).to_string();

View File

@ -108,7 +108,6 @@ impl XsdClient {
}
async fn write<P: AsRef<str>>(&self, tx: u32, path: P, data: Vec<u8>) -> Result<bool> {
trace!("write tx={tx} path={} data={:?}", path.as_ref(), data);
let mut buffer = Vec::new();
let path = CString::new(path.as_ref())?;
buffer.extend_from_slice(path.as_bytes_with_nul());
@ -120,6 +119,11 @@ impl XsdClient {
response.parse_bool()
}
async fn write_string<P: AsRef<str>>(&self, tx: u32, path: P, data: &str) -> Result<bool> {
trace!("write tx={tx} path={} data=\"{}\"", path.as_ref(), data);
self.write(tx, path, data.as_bytes().to_vec()).await
}
async fn mkdir<P: AsRef<str>>(&self, tx: u32, path: P) -> Result<bool> {
trace!("mkdir tx={tx} path={}", path.as_ref());
self.socket
@ -247,7 +251,7 @@ impl XsdInterface for XsdClient {
}
async fn write_string<P: AsRef<str>>(&self, path: P, data: &str) -> Result<bool> {
self.write(0, path, data.as_bytes().to_vec()).await
self.write_string(0, path, data).await
}
async fn mkdir<P: AsRef<str>>(&self, path: P) -> Result<bool> {
@ -287,9 +291,7 @@ impl XsdInterface for XsdTransaction {
}
async fn write_string<P: AsRef<str>>(&self, path: P, data: &str) -> Result<bool> {
self.client
.write(self.tx, path, data.as_bytes().to_vec())
.await
self.client.write_string(self.tx, path, data).await
}
async fn mkdir<P: AsRef<str>>(&self, path: P) -> Result<bool> {