update to proxmox-sys 0.2 crate

- imported pbs-api-types/src/common_regex.rs from old proxmox crate
- use hex crate to generate/parse hex digest
- remove all reference to proxmox crate (use proxmox-sys and
  proxmox-serde instead)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-11-23 17:57:00 +01:00
parent bd00ff10e4
commit 25877d05ac
201 changed files with 627 additions and 1535 deletions

View File

@ -2,7 +2,7 @@ use std::io::{Read, Write};
use std::pin::Pin;
use std::task::{Context, Poll};
use proxmox::sys::error::SysError;
use proxmox_sys::error::SysError;
use proxmox_uuid::Uuid;
use pbs_tape::{
@ -58,14 +58,14 @@ pub fn tape_write_snapshot_archive<'a>(
for filename in file_list.iter() {
let mut file = snapshot_reader.open_file(filename)
.map_err(|err| proxmox::io_format_err!("open file '{}' failed - {}", filename, err))?;
.map_err(|err| proxmox_sys::io_format_err!("open file '{}' failed - {}", filename, err))?;
let metadata = file.metadata()?;
let file_size = metadata.len();
let metadata: pxar::Metadata = metadata.into();
if !metadata.is_regular_file() {
proxmox::io_bail!("file '{}' is not a regular file", filename);
proxmox_sys::io_bail!("file '{}' is not a regular file", filename);
}
let mut remaining = file_size;
@ -73,14 +73,14 @@ pub fn tape_write_snapshot_archive<'a>(
while remaining != 0 {
let got = file.read(&mut file_copy_buffer[..])?;
if got as u64 > remaining {
proxmox::io_bail!("file '{}' changed while reading", filename);
proxmox_sys::io_bail!("file '{}' changed while reading", filename);
}
out.write_all(&file_copy_buffer[..got])?;
remaining -= got as u64;
}
if remaining > 0 {
proxmox::io_bail!("file '{}' shrunk while reading", filename);
proxmox_sys::io_bail!("file '{}' shrunk while reading", filename);
}
}
encoder.finish()?;