update to first proxmox crate split

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-10-08 11:19:37 +02:00
parent e3f3359c86
commit 6ef1b649d9
265 changed files with 880 additions and 1036 deletions

View File

@ -4,7 +4,7 @@ use std::io::Write;
use anyhow::{bail, format_err, Error};
use endian_trait::Endian;
use proxmox::tools::io::{ReadExt, WriteExt};
use proxmox_io::{ReadExt, WriteExt};
use crate::sgutils2::{SgRaw, alloc_page_aligned_buffer};
@ -216,7 +216,7 @@ struct SspDataEncryptionAlgorithmDescriptor {
// Returns the algorythm_index for AES-CGM
fn decode_spin_data_encryption_caps(data: &[u8]) -> Result<u8, Error> {
proxmox::try_block!({
proxmox_lang::try_block!({
let mut reader = &data[..];
let _page: SspDataEncryptionCapabilityPage = unsafe { reader.read_be_value()? };
@ -267,7 +267,7 @@ struct SspDataEncryptionStatusPage {
fn decode_spin_data_encryption_status(data: &[u8]) -> Result<DataEncryptionStatus, Error> {
proxmox::try_block!({
proxmox_lang::try_block!({
let mut reader = &data[..];
let page: SspDataEncryptionStatusPage = unsafe { reader.read_be_value()? };

View File

@ -5,7 +5,7 @@ use std::os::unix::io::AsRawFd;
use anyhow::{bail, format_err, Error};
use endian_trait::Endian;
use proxmox::tools::io::ReadExt;
use proxmox_io::ReadExt;
use pbs_api_types::MamAttribute;
@ -211,7 +211,7 @@ pub fn mam_extract_media_usage(mam: &[MamAttribute]) -> Result<MediaUsageInfo, E
let mon: i32 = date_str[4..6].parse()?;
let mday: i32 = date_str[6..8].parse()?;
use proxmox::tools::time::TmEditor;
use proxmox_time::TmEditor;
let mut t = TmEditor::new(true);
t.set_year(year)?;
t.set_mon(mon)?;

View File

@ -3,7 +3,7 @@ use std::io::Read;
use endian_trait::Endian;
use std::os::unix::io::AsRawFd;
use proxmox::tools::io::ReadExt;
use proxmox_io::ReadExt;
use crate::sgutils2::SgRaw;
@ -38,7 +38,7 @@ pub fn report_density<F: AsRawFd>(file: &mut F) -> Result<u8, Error> {
let mut max_density = 0u8;
proxmox::try_block!({
proxmox_lang::try_block!({
let mut reader = &data[..];
let page_len: u16 = unsafe { reader.read_be_value()? };

View File

@ -3,7 +3,7 @@ use std::os::unix::io::AsRawFd;
use anyhow::{bail, format_err, Error};
use proxmox::tools::io::ReadExt;
use proxmox_io::ReadExt;
use crate::sgutils2::SgRaw;
@ -106,7 +106,7 @@ fn sg_read_tape_alert_flags<F: AsRawFd>(file: &mut F) -> Result<Vec<u8>, Error>
fn decode_tape_alert_flags(data: &[u8]) -> Result<TapeAlertFlags, Error> {
proxmox::try_block!({
proxmox_lang::try_block!({
if !((data[0] & 0x7f) == 0x12 && data[1] == 0) {
bail!("invalid response");
}

View File

@ -4,7 +4,7 @@ use std::os::unix::io::AsRawFd;
use anyhow::{bail, format_err, Error};
use endian_trait::Endian;
use proxmox::tools::io::ReadExt;
use proxmox_io::ReadExt;
use pbs_api_types::Lp17VolumeStatistics;
@ -71,7 +71,7 @@ fn decode_volume_statistics(data: &[u8]) -> Result<Lp17VolumeStatistics, Error>
Ok(value)
};
proxmox::try_block!({
proxmox_lang::try_block!({
if !((data[0] & 0x7f) == 0x17 && data[1] == 0) {
bail!("invalid response");
}