bump proxmox crate to 0.1.7
The -sys, -tools and -api crate have now been merged into the proxmx crate directly. Only macro crates are separate (but still reexported by the proxmox crate in their designated locations). When we need to depend on "parts" of the crate later on we'll just have to use features. The reason is mostly that these modules had inter-dependencies which really make them not independent enough to be their own crates. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -48,13 +48,13 @@ impl DataBlob {
|
||||
|
||||
/// accessor to crc32 checksum
|
||||
pub fn crc(&self) -> u32 {
|
||||
let crc_o = proxmox::tools::offsetof!(DataBlobHeader, crc);
|
||||
let crc_o = proxmox::offsetof!(DataBlobHeader, crc);
|
||||
u32::from_le_bytes(self.raw_data[crc_o..crc_o+4].try_into().unwrap())
|
||||
}
|
||||
|
||||
// set the CRC checksum field
|
||||
pub fn set_crc(&mut self, crc: u32) {
|
||||
let crc_o = proxmox::tools::offsetof!(DataBlobHeader, crc);
|
||||
let crc_o = proxmox::offsetof!(DataBlobHeader, crc);
|
||||
self.raw_data[crc_o..crc_o+4].copy_from_slice(&crc.to_le_bytes());
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ pub struct DynamicIndexHeader {
|
||||
pub index_csum: [u8; 32],
|
||||
reserved: [u8; 4032], // overall size is one page (4096 bytes)
|
||||
}
|
||||
proxmox::tools::static_assert_size!(DynamicIndexHeader, 4096);
|
||||
proxmox::static_assert_size!(DynamicIndexHeader, 4096);
|
||||
// TODO: Once non-Copy unions are stabilized, use:
|
||||
// union DynamicIndexHeader {
|
||||
// reserved: [u8; 4096],
|
||||
@ -493,7 +493,7 @@ impl DynamicIndexWriter {
|
||||
|
||||
self.writer.flush()?;
|
||||
|
||||
let csum_offset = proxmox::tools::offsetof!(DynamicIndexHeader, index_csum);
|
||||
let csum_offset = proxmox::offsetof!(DynamicIndexHeader, index_csum);
|
||||
self.writer.seek(SeekFrom::Start(csum_offset as u64))?;
|
||||
|
||||
let csum = self.csum.take().unwrap();
|
||||
|
@ -32,7 +32,7 @@ pub struct FixedIndexHeader {
|
||||
pub chunk_size: u64,
|
||||
reserved: [u8; 4016], // overall size is one page (4096 bytes)
|
||||
}
|
||||
proxmox::tools::static_assert_size!(FixedIndexHeader, 4096);
|
||||
proxmox::static_assert_size!(FixedIndexHeader, 4096);
|
||||
|
||||
// split image into fixed size chunks
|
||||
|
||||
@ -372,7 +372,7 @@ impl FixedIndexWriter {
|
||||
|
||||
self.unmap()?;
|
||||
|
||||
let csum_offset = proxmox::tools::offsetof!(FixedIndexHeader, index_csum);
|
||||
let csum_offset = proxmox::offsetof!(FixedIndexHeader, index_csum);
|
||||
self.file.seek(SeekFrom::Start(csum_offset as u64))?;
|
||||
self.file.write_all(&index_csum)?;
|
||||
self.file.flush()?;
|
||||
|
@ -3,10 +3,8 @@ use failure::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use chrono::{Local, TimeZone, DateTime};
|
||||
|
||||
use proxmox::tools::{
|
||||
try_block,
|
||||
fs::{file_get_contents, replace_file, CreateOptions},
|
||||
};
|
||||
use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
|
||||
use proxmox::try_block;
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub enum KeyDerivationConfig {
|
||||
|
@ -119,7 +119,7 @@ impl TryFrom<Value> for BackupManifest {
|
||||
|
||||
use crate::tools::{required_string_property, required_integer_property, required_array_property};
|
||||
|
||||
proxmox::tools::try_block!({
|
||||
proxmox::try_block!({
|
||||
let backup_type = required_string_property(&data, "backup-type")?;
|
||||
let backup_id = required_string_property(&data, "backup-id")?;
|
||||
let backup_time = required_integer_property(&data, "backup-time")?;
|
||||
|
Reference in New Issue
Block a user