close #3777: Add source information to backup logs

This will show the ip-address of the client creating
the backup in the logs. For example it will output:
"starting new backup on datastore 'test1' from ::ffff:192.168.1.192:
"host/test/2023-08-21T07:28:10Z"".

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
Gabriel Goller 2023-09-08 16:01:14 +02:00 committed by Thomas Lamprecht
parent 8fcd709cf2
commit 2aae8544b7

View File

@ -214,9 +214,12 @@ fn upgrade_to_backup_protocol(
env.debug = debug;
env.last_backup = last_backup;
let origin = match rpcenv.get_client_ip().map(|addr| addr.ip()) {
Some(ip) => format!(" from {ip}"),
None => "".into(),
};
env.log(format!(
"starting new {} on datastore '{}': {:?}",
worker_type, store, path
"starting new {worker_type} on datastore '{store}'{origin}: {path:?}",
));
let service =