xenstore: move error type and make use of result type aliases

This commit is contained in:
Alex Zenla 2024-01-30 01:58:10 -08:00
parent 812e357bc9
commit eba623d61a
No known key found for this signature in database
GPG Key ID: 067B238899B51269
8 changed files with 95 additions and 112 deletions

View File

@ -7,7 +7,6 @@ use std::fmt::{Display, Formatter};
use std::num::ParseIntError; use std::num::ParseIntError;
use std::path::StripPrefixError; use std::path::StripPrefixError;
use xenclient::XenClientError; use xenclient::XenClientError;
use xenstore::bus::XsdBusError;
pub type Result<T> = std::result::Result<T, HyphaError>; pub type Result<T> = std::result::Result<T, HyphaError>;
@ -117,8 +116,8 @@ impl From<uuid::Error> for HyphaError {
} }
} }
impl From<XsdBusError> for HyphaError { impl From<xenstore::error::Error> for HyphaError {
fn from(value: XsdBusError) -> Self { fn from(value: xenstore::error::Error) -> Self {
HyphaError::new(value.to_string().as_str()) HyphaError::new(value.to_string().as_str())
} }
} }

View File

@ -20,7 +20,6 @@ use uuid::Uuid;
use xencall::sys::CreateDomain; use xencall::sys::CreateDomain;
use xencall::{XenCall, XenCallError}; use xencall::{XenCall, XenCallError};
use xenevtchn::EventChannelError; use xenevtchn::EventChannelError;
use xenstore::bus::XsdBusError;
use xenstore::client::{ use xenstore::client::{
XsPermission, XsdClient, XsdInterface, XS_PERM_NONE, XS_PERM_READ, XS_PERM_READ_WRITE, XsPermission, XsdClient, XsdInterface, XS_PERM_NONE, XS_PERM_READ, XS_PERM_READ_WRITE,
}; };
@ -61,8 +60,8 @@ impl From<std::io::Error> for XenClientError {
} }
} }
impl From<XsdBusError> for XenClientError { impl From<xenstore::error::Error> for XenClientError {
fn from(value: XsdBusError) -> Self { fn from(value: xenstore::error::Error) -> Self {
XenClientError::new(value.to_string().as_str()) XenClientError::new(value.to_string().as_str())
} }
} }

View File

@ -1,8 +1,8 @@
use xenstore::bus::XsdBusError;
use xenstore::client::{XsdClient, XsdInterface}; use xenstore::client::{XsdClient, XsdInterface};
use xenstore::error::Result;
use xenstore::sys::XSD_ERROR_EINVAL; use xenstore::sys::XSD_ERROR_EINVAL;
fn list_recursive(client: &mut XsdClient, level: usize, path: &str) -> Result<(), XsdBusError> { fn list_recursive(client: &mut XsdClient, level: usize, path: &str) -> Result<()> {
let children = match client.list(path) { let children = match client.list(path) {
Ok(children) => children, Ok(children) => children,
Err(error) => { Err(error) => {
@ -28,7 +28,7 @@ fn list_recursive(client: &mut XsdClient, level: usize, path: &str) -> Result<()
Ok(()) Ok(())
} }
fn main() -> Result<(), XsdBusError> { fn main() -> Result<()> {
let mut client = XsdClient::open()?; let mut client = XsdClient::open()?;
list_recursive(&mut client, 0, "/")?; list_recursive(&mut client, 0, "/")?;
Ok(()) Ok(())

View File

@ -1,15 +1,11 @@
use crate::error::{Error, Result};
use crate::sys::{XsdMessageHeader, XSD_ERROR}; use crate::sys::{XsdMessageHeader, XSD_ERROR};
use std::ffi::{CString, FromVecWithNulError, IntoStringError, NulError}; use std::ffi::CString;
use std::fs::metadata; use std::fs::metadata;
use std::io;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::mem::size_of; use std::mem::size_of;
use std::net::Shutdown; use std::net::Shutdown;
use std::num::ParseIntError;
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
use std::str::Utf8Error;
use std::string::FromUtf8Error;
use thiserror::Error;
const XEN_BUS_PATHS: &[&str] = &["/var/run/xenstored/socket"]; const XEN_BUS_PATHS: &[&str] = &["/var/run/xenstored/socket"];
@ -23,30 +19,6 @@ fn find_bus_path() -> Option<String> {
None None
} }
#[derive(Error, Debug)]
pub enum XsdBusError {
#[error("io issue encountered")]
Io(#[from] io::Error),
#[error("utf8 string decode failed")]
Utf8DecodeString(#[from] FromUtf8Error),
#[error("utf8 str decode failed")]
Utf8DecodeStr(#[from] Utf8Error),
#[error("unable to decode cstring as utf8")]
Utf8DecodeCstring(#[from] IntoStringError),
#[error("nul byte found in string")]
NulByteFoundString(#[from] NulError),
#[error("unable to find nul byte in vec")]
VecNulByteNotFound(#[from] FromVecWithNulError),
#[error("unable to parse integer")]
ParseInt(#[from] ParseIntError),
#[error("bus was not found on any available path")]
BusNotFound,
#[error("store responded with error: `{0}`")]
ResponseError(String),
#[error("invalid permissions provided")]
InvalidPermissions,
}
pub struct XsdSocket { pub struct XsdSocket {
handle: UnixStream, handle: UnixStream,
} }
@ -58,11 +30,11 @@ pub struct XsdResponse {
} }
impl XsdResponse { impl XsdResponse {
pub fn parse_string(&self) -> Result<String, XsdBusError> { pub fn parse_string(&self) -> Result<String> {
Ok(CString::from_vec_with_nul(self.payload.clone())?.into_string()?) Ok(CString::from_vec_with_nul(self.payload.clone())?.into_string()?)
} }
pub fn parse_string_vec(&self) -> Result<Vec<String>, XsdBusError> { pub fn parse_string_vec(&self) -> Result<Vec<String>> {
let mut strings: Vec<String> = Vec::new(); let mut strings: Vec<String> = Vec::new();
let mut buffer: Vec<u8> = Vec::new(); let mut buffer: Vec<u8> = Vec::new();
for b in &self.payload { for b in &self.payload {
@ -77,22 +49,22 @@ impl XsdResponse {
Ok(strings) Ok(strings)
} }
pub fn parse_bool(&self) -> Result<bool, XsdBusError> { pub fn parse_bool(&self) -> Result<bool> {
Ok(true) Ok(true)
} }
} }
impl XsdSocket { impl XsdSocket {
pub fn dial() -> Result<XsdSocket, XsdBusError> { pub fn dial() -> Result<XsdSocket> {
let path = match find_bus_path() { let path = match find_bus_path() {
Some(path) => path, Some(path) => path,
None => return Err(XsdBusError::BusNotFound), None => return Err(Error::BusNotFound),
}; };
let stream = UnixStream::connect(path)?; let stream = UnixStream::connect(path)?;
Ok(XsdSocket { handle: stream }) Ok(XsdSocket { handle: stream })
} }
pub fn send(&mut self, tx: u32, typ: u32, buf: &[u8]) -> Result<XsdResponse, XsdBusError> { pub fn send(&mut self, tx: u32, typ: u32, buf: &[u8]) -> Result<XsdResponse> {
let header = XsdMessageHeader { let header = XsdMessageHeader {
typ, typ,
req: 0, req: 0,
@ -108,29 +80,19 @@ impl XsdSocket {
self.handle.read_exact(payload.as_mut_slice())?; self.handle.read_exact(payload.as_mut_slice())?;
if result_header.typ == XSD_ERROR { if result_header.typ == XSD_ERROR {
let error = CString::from_vec_with_nul(payload)?; let error = CString::from_vec_with_nul(payload)?;
return Err(XsdBusError::ResponseError(error.into_string()?)); return Err(Error::ResponseError(error.into_string()?));
} }
let response = XsdResponse { header, payload }; let response = XsdResponse { header, payload };
Ok(response) Ok(response)
} }
pub fn send_single( pub fn send_single(&mut self, tx: u32, typ: u32, string: &str) -> Result<XsdResponse> {
&mut self,
tx: u32,
typ: u32,
string: &str,
) -> Result<XsdResponse, XsdBusError> {
let text = CString::new(string)?; let text = CString::new(string)?;
let buf = text.as_bytes_with_nul(); let buf = text.as_bytes_with_nul();
self.send(tx, typ, buf) self.send(tx, typ, buf)
} }
pub fn send_multiple( pub fn send_multiple(&mut self, tx: u32, typ: u32, array: &[&str]) -> Result<XsdResponse> {
&mut self,
tx: u32,
typ: u32,
array: &[&str],
) -> Result<XsdResponse, XsdBusError> {
let mut buf: Vec<u8> = Vec::new(); let mut buf: Vec<u8> = Vec::new();
for item in array { for item in array {
buf.extend_from_slice(item.as_bytes()); buf.extend_from_slice(item.as_bytes());

View File

@ -1,4 +1,5 @@
use crate::bus::{XsdBusError, XsdSocket}; use crate::bus::XsdSocket;
use crate::error::{Error, Result};
use crate::sys::{ use crate::sys::{
XSD_DIRECTORY, XSD_GET_DOMAIN_PATH, XSD_INTRODUCE, XSD_MKDIR, XSD_READ, XSD_RM, XSD_SET_PERMS, XSD_DIRECTORY, XSD_GET_DOMAIN_PATH, XSD_INTRODUCE, XSD_MKDIR, XSD_READ, XSD_RM, XSD_SET_PERMS,
XSD_TRANSACTION_END, XSD_TRANSACTION_START, XSD_WRITE, XSD_TRANSACTION_END, XSD_TRANSACTION_START, XSD_WRITE,
@ -22,35 +23,35 @@ pub struct XsPermission {
} }
impl XsPermission { impl XsPermission {
pub fn encode(&self) -> Result<String, XsdBusError> { pub fn encode(&self) -> Result<String> {
let c = match self.perms { let c = match self.perms {
XS_PERM_READ_WRITE => 'b', XS_PERM_READ_WRITE => 'b',
XS_PERM_WRITE => 'w', XS_PERM_WRITE => 'w',
XS_PERM_READ => 'r', XS_PERM_READ => 'r',
XS_PERM_NONE => 'n', XS_PERM_NONE => 'n',
_ => return Err(XsdBusError::InvalidPermissions), _ => return Err(Error::InvalidPermissions),
}; };
Ok(format!("{}{}", c, self.id)) Ok(format!("{}{}", c, self.id))
} }
} }
pub trait XsdInterface { pub trait XsdInterface {
fn list(&mut self, path: &str) -> Result<Vec<String>, XsdBusError>; fn list(&mut self, path: &str) -> Result<Vec<String>>;
fn read(&mut self, path: &str) -> Result<Vec<u8>, XsdBusError>; fn read(&mut self, path: &str) -> Result<Vec<u8>>;
fn read_string(&mut self, path: &str) -> Result<String, XsdBusError>; fn read_string(&mut self, path: &str) -> Result<String>;
fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool, XsdBusError>; fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool>;
fn write_string(&mut self, path: &str, data: &str) -> Result<bool, XsdBusError>; fn write_string(&mut self, path: &str, data: &str) -> Result<bool>;
fn mkdir(&mut self, path: &str) -> Result<bool, XsdBusError>; fn mkdir(&mut self, path: &str) -> Result<bool>;
fn rm(&mut self, path: &str) -> Result<bool, XsdBusError>; fn rm(&mut self, path: &str) -> Result<bool>;
fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool, XsdBusError>; fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool>;
fn mknod(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool, XsdBusError> { fn mknod(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool> {
let result1 = self.write_string(path, "")?; let result1 = self.write_string(path, "")?;
let result2 = self.set_perms(path, perms)?; let result2 = self.set_perms(path, perms)?;
Ok(result1 && result2) Ok(result1 && result2)
} }
fn read_string_optional(&mut self, path: &str) -> Result<Option<String>, XsdBusError> { fn read_string_optional(&mut self, path: &str) -> Result<Option<String>> {
Ok(match self.read_string(path) { Ok(match self.read_string(path) {
Ok(value) => Some(value), Ok(value) => Some(value),
Err(error) => { Err(error) => {
@ -63,7 +64,7 @@ pub trait XsdInterface {
}) })
} }
fn list_any(&mut self, path: &str) -> Result<Vec<String>, XsdBusError> { fn list_any(&mut self, path: &str) -> Result<Vec<String>> {
Ok(match self.list(path) { Ok(match self.list(path) {
Ok(value) => value, Ok(value) => value,
Err(error) => { Err(error) => {
@ -78,24 +79,24 @@ pub trait XsdInterface {
} }
impl XsdClient { impl XsdClient {
pub fn open() -> Result<XsdClient, XsdBusError> { pub fn open() -> Result<XsdClient> {
let socket = XsdSocket::dial()?; let socket = XsdSocket::dial()?;
Ok(XsdClient { socket }) Ok(XsdClient { socket })
} }
fn list(&mut self, tx: u32, path: &str) -> Result<Vec<String>, XsdBusError> { fn list(&mut self, tx: u32, path: &str) -> Result<Vec<String>> {
trace!("list tx={tx} path={path}"); trace!("list tx={tx} path={path}");
let response = self.socket.send_single(tx, XSD_DIRECTORY, path)?; let response = self.socket.send_single(tx, XSD_DIRECTORY, path)?;
response.parse_string_vec() response.parse_string_vec()
} }
fn read(&mut self, tx: u32, path: &str) -> Result<Vec<u8>, XsdBusError> { fn read(&mut self, tx: u32, path: &str) -> Result<Vec<u8>> {
trace!("read tx={tx} path={path}"); trace!("read tx={tx} path={path}");
let response = self.socket.send_single(tx, XSD_READ, path)?; let response = self.socket.send_single(tx, XSD_READ, path)?;
Ok(response.payload) Ok(response.payload)
} }
fn write(&mut self, tx: u32, path: &str, data: Vec<u8>) -> Result<bool, XsdBusError> { fn write(&mut self, tx: u32, path: &str, data: Vec<u8>) -> Result<bool> {
trace!("write tx={tx} path={path} data={:?}", data); trace!("write tx={tx} path={path} data={:?}", data);
let mut buffer = Vec::new(); let mut buffer = Vec::new();
let path = CString::new(path)?; let path = CString::new(path)?;
@ -105,12 +106,12 @@ impl XsdClient {
response.parse_bool() response.parse_bool()
} }
fn mkdir(&mut self, tx: u32, path: &str) -> Result<bool, XsdBusError> { fn mkdir(&mut self, tx: u32, path: &str) -> Result<bool> {
trace!("mkdir tx={tx} path={path}"); trace!("mkdir tx={tx} path={path}");
self.socket.send_single(tx, XSD_MKDIR, path)?.parse_bool() self.socket.send_single(tx, XSD_MKDIR, path)?.parse_bool()
} }
fn rm(&mut self, tx: u32, path: &str) -> Result<bool, XsdBusError> { fn rm(&mut self, tx: u32, path: &str) -> Result<bool> {
trace!("rm tx={tx} path={path}"); trace!("rm tx={tx} path={path}");
let result = self.socket.send_single(tx, XSD_RM, path); let result = self.socket.send_single(tx, XSD_RM, path);
if let Err(error) = result { if let Err(error) = result {
@ -122,12 +123,7 @@ impl XsdClient {
result.unwrap().parse_bool() result.unwrap().parse_bool()
} }
fn set_perms( fn set_perms(&mut self, tx: u32, path: &str, perms: &[XsPermission]) -> Result<bool> {
&mut self,
tx: u32,
path: &str,
perms: &[XsPermission],
) -> Result<bool, XsdBusError> {
trace!("set_perms tx={tx} path={path} perms={:?}", perms); trace!("set_perms tx={tx} path={path} perms={:?}", perms);
let mut items: Vec<String> = Vec::new(); let mut items: Vec<String> = Vec::new();
items.push(path.to_string()); items.push(path.to_string());
@ -139,7 +135,7 @@ impl XsdClient {
response.parse_bool() response.parse_bool()
} }
pub fn transaction(&mut self) -> Result<XsdTransaction, XsdBusError> { pub fn transaction(&mut self) -> Result<XsdTransaction> {
trace!("transaction start"); trace!("transaction start");
let response = self.socket.send_single(0, XSD_TRANSACTION_START, "")?; let response = self.socket.send_single(0, XSD_TRANSACTION_START, "")?;
let str = response.parse_string()?; let str = response.parse_string()?;
@ -147,19 +143,14 @@ impl XsdClient {
Ok(XsdTransaction { client: self, tx }) Ok(XsdTransaction { client: self, tx })
} }
pub fn get_domain_path(&mut self, domid: u32) -> Result<String, XsdBusError> { pub fn get_domain_path(&mut self, domid: u32) -> Result<String> {
let response = let response =
self.socket self.socket
.send_single(0, XSD_GET_DOMAIN_PATH, domid.to_string().as_str())?; .send_single(0, XSD_GET_DOMAIN_PATH, domid.to_string().as_str())?;
response.parse_string() response.parse_string()
} }
pub fn introduce_domain( pub fn introduce_domain(&mut self, domid: u32, mfn: u64, evtchn: u32) -> Result<bool> {
&mut self,
domid: u32,
mfn: u64,
evtchn: u32,
) -> Result<bool, XsdBusError> {
trace!("introduce domain domid={domid} mfn={mfn} evtchn={evtchn}"); trace!("introduce domain domid={domid} mfn={mfn} evtchn={evtchn}");
let response = self.socket.send_multiple( let response = self.socket.send_multiple(
0, 0,
@ -180,75 +171,75 @@ pub struct XsdTransaction<'a> {
} }
impl XsdInterface for XsdClient { impl XsdInterface for XsdClient {
fn list(&mut self, path: &str) -> Result<Vec<String>, XsdBusError> { fn list(&mut self, path: &str) -> Result<Vec<String>> {
self.list(0, path) self.list(0, path)
} }
fn read(&mut self, path: &str) -> Result<Vec<u8>, XsdBusError> { fn read(&mut self, path: &str) -> Result<Vec<u8>> {
self.read(0, path) self.read(0, path)
} }
fn read_string(&mut self, path: &str) -> Result<String, XsdBusError> { fn read_string(&mut self, path: &str) -> Result<String> {
Ok(String::from_utf8(self.read(0, path)?)?) Ok(String::from_utf8(self.read(0, path)?)?)
} }
fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool, XsdBusError> { fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool> {
self.write(0, path, data) self.write(0, path, data)
} }
fn write_string(&mut self, path: &str, data: &str) -> Result<bool, XsdBusError> { fn write_string(&mut self, path: &str, data: &str) -> Result<bool> {
self.write(0, path, data.as_bytes().to_vec()) self.write(0, path, data.as_bytes().to_vec())
} }
fn mkdir(&mut self, path: &str) -> Result<bool, XsdBusError> { fn mkdir(&mut self, path: &str) -> Result<bool> {
self.mkdir(0, path) self.mkdir(0, path)
} }
fn rm(&mut self, path: &str) -> Result<bool, XsdBusError> { fn rm(&mut self, path: &str) -> Result<bool> {
self.rm(0, path) self.rm(0, path)
} }
fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool, XsdBusError> { fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool> {
self.set_perms(0, path, perms) self.set_perms(0, path, perms)
} }
} }
impl XsdInterface for XsdTransaction<'_> { impl XsdInterface for XsdTransaction<'_> {
fn list(&mut self, path: &str) -> Result<Vec<String>, XsdBusError> { fn list(&mut self, path: &str) -> Result<Vec<String>> {
self.client.list(self.tx, path) self.client.list(self.tx, path)
} }
fn read(&mut self, path: &str) -> Result<Vec<u8>, XsdBusError> { fn read(&mut self, path: &str) -> Result<Vec<u8>> {
self.client.read(self.tx, path) self.client.read(self.tx, path)
} }
fn read_string(&mut self, path: &str) -> Result<String, XsdBusError> { fn read_string(&mut self, path: &str) -> Result<String> {
Ok(String::from_utf8(self.client.read(self.tx, path)?)?) Ok(String::from_utf8(self.client.read(self.tx, path)?)?)
} }
fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool, XsdBusError> { fn write(&mut self, path: &str, data: Vec<u8>) -> Result<bool> {
self.client.write(self.tx, path, data) self.client.write(self.tx, path, data)
} }
fn write_string(&mut self, path: &str, data: &str) -> Result<bool, XsdBusError> { fn write_string(&mut self, path: &str, data: &str) -> Result<bool> {
self.client.write(self.tx, path, data.as_bytes().to_vec()) self.client.write(self.tx, path, data.as_bytes().to_vec())
} }
fn mkdir(&mut self, path: &str) -> Result<bool, XsdBusError> { fn mkdir(&mut self, path: &str) -> Result<bool> {
self.client.mkdir(self.tx, path) self.client.mkdir(self.tx, path)
} }
fn rm(&mut self, path: &str) -> Result<bool, XsdBusError> { fn rm(&mut self, path: &str) -> Result<bool> {
self.client.rm(self.tx, path) self.client.rm(self.tx, path)
} }
fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool, XsdBusError> { fn set_perms(&mut self, path: &str, perms: &[XsPermission]) -> Result<bool> {
self.client.set_perms(self.tx, path, perms) self.client.set_perms(self.tx, path, perms)
} }
} }
impl XsdTransaction<'_> { impl XsdTransaction<'_> {
pub fn end(&mut self, abort: bool) -> Result<bool, XsdBusError> { pub fn end(&mut self, abort: bool) -> Result<bool> {
let abort_str = if abort { "F" } else { "T" }; let abort_str = if abort { "F" } else { "T" };
trace!("transaction end abort={}", abort); trace!("transaction end abort={}", abort);
@ -258,11 +249,11 @@ impl XsdTransaction<'_> {
.parse_bool() .parse_bool()
} }
pub fn commit(&mut self) -> Result<bool, XsdBusError> { pub fn commit(&mut self) -> Result<bool> {
self.end(false) self.end(false)
} }
pub fn abort(&mut self) -> Result<bool, XsdBusError> { pub fn abort(&mut self) -> Result<bool> {
self.end(true) self.end(true)
} }
} }

31
xen/xenstore/src/error.rs Normal file
View File

@ -0,0 +1,31 @@
use std::ffi::{FromVecWithNulError, IntoStringError, NulError};
use std::io;
use std::num::ParseIntError;
use std::str::Utf8Error;
use std::string::FromUtf8Error;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("io issue encountered")]
Io(#[from] io::Error),
#[error("utf8 string decode failed")]
Utf8DecodeString(#[from] FromUtf8Error),
#[error("utf8 str decode failed")]
Utf8DecodeStr(#[from] Utf8Error),
#[error("unable to decode cstring as utf8")]
Utf8DecodeCstring(#[from] IntoStringError),
#[error("nul byte found in string")]
NulByteFoundString(#[from] NulError),
#[error("unable to find nul byte in vec")]
VecNulByteNotFound(#[from] FromVecWithNulError),
#[error("unable to parse integer")]
ParseInt(#[from] ParseIntError),
#[error("bus was not found on any available path")]
BusNotFound,
#[error("store responded with error: `{0}`")]
ResponseError(String),
#[error("invalid permissions provided")]
InvalidPermissions,
}
pub type Result<T> = std::result::Result<T, Error>;

View File

@ -1,3 +1,4 @@
pub mod bus; pub mod bus;
pub mod client; pub mod client;
pub mod error;
pub mod sys; pub mod sys;

View File

@ -1,6 +1,6 @@
use bytemuck::{Pod, Zeroable};
/// Handwritten protocol definitions for XenStore. /// Handwritten protocol definitions for XenStore.
/// Used xen/include/public/io/xs_wire.h as a reference. /// Used xen/include/public/io/xs_wire.h as a reference.
use bytemuck::{Pod, Zeroable};
use libc; use libc;
#[derive(Copy, Clone, Pod, Zeroable, Debug)] #[derive(Copy, Clone, Pod, Zeroable, Debug)]