mirror of
https://git.proxmox.com/git/proxmox-backup-qemu
synced 2025-10-05 03:11:50 +00:00
proxmox_backup_connect: return info about previous backup
This commit is contained in:
parent
598e872f87
commit
fabeaf9cf1
10
src/lib.rs
10
src/lib.rs
@ -204,6 +204,11 @@ pub extern "C" fn proxmox_backup_new(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Open connection to the backup server (sync)
|
/// Open connection to the backup server (sync)
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// 0 ... Sucecss (no prevbious backup)
|
||||||
|
/// 1 ... Success (found previous backup)
|
||||||
|
/// -1 ... Error
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(clippy::not_unsafe_ptr_arg_deref)]
|
#[allow(clippy::not_unsafe_ptr_arg_deref)]
|
||||||
pub extern "C" fn proxmox_backup_connect(
|
pub extern "C" fn proxmox_backup_connect(
|
||||||
@ -234,6 +239,11 @@ pub extern "C" fn proxmox_backup_connect(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Open connection to the backup server
|
/// Open connection to the backup server
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// 0 ... Sucecss (no prevbious backup)
|
||||||
|
/// 1 ... Success (found previous backup)
|
||||||
|
/// -1 ... Error
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(clippy::not_unsafe_ptr_arg_deref)]
|
#[allow(clippy::not_unsafe_ptr_arg_deref)]
|
||||||
pub extern "C" fn proxmox_backup_connect_async(
|
pub extern "C" fn proxmox_backup_connect_async(
|
||||||
|
@ -159,14 +159,18 @@ fn backup_worker_task(
|
|||||||
|
|
||||||
let last_manifest = writer.download_previous_manifest().await;
|
let last_manifest = writer.download_previous_manifest().await;
|
||||||
let mut manifest_guard = manifest.lock().unwrap();
|
let mut manifest_guard = manifest.lock().unwrap();
|
||||||
|
let mut result = 0;
|
||||||
*manifest_guard = match last_manifest {
|
*manifest_guard = match last_manifest {
|
||||||
Ok(last_manifest) => Some(Arc::new(last_manifest)),
|
Ok(last_manifest) => {
|
||||||
|
result = 1;
|
||||||
|
Some(Arc::new(last_manifest))
|
||||||
|
},
|
||||||
Err(_) => None
|
Err(_) => None
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut client_guard = client.lock().unwrap();
|
let mut client_guard = client.lock().unwrap();
|
||||||
*client_guard = Some(writer);
|
*client_guard = Some(writer);
|
||||||
Ok(0)
|
Ok(result)
|
||||||
};
|
};
|
||||||
|
|
||||||
tokio::spawn(handle_async_command(command_future, abort.listen(), callback_info));
|
tokio::spawn(handle_async_command(command_future, abort.listen(), callback_info));
|
||||||
|
Loading…
Reference in New Issue
Block a user