file-restore: print warnings on stderr

as we print JSON on stdout to be parsed

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2021-04-21 15:18:07 +02:00 committed by Thomas Lamprecht
parent 2fd2d29281
commit 1011fb552b
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ async fn cleanup_map(map: &mut HashMap<String, VMState>) -> bool {
if res.is_err() { if res.is_err() {
// VM is not reachable, remove from map and inform user // VM is not reachable, remove from map and inform user
to_remove.push(name.clone()); to_remove.push(name.clone());
println!( eprintln!(
"VM '{}' (pid: {}, cid: {}) was not reachable, removing from map", "VM '{}' (pid: {}, cid: {}) was not reachable, removing from map",
name, state.pid, state.cid name, state.pid, state.cid
); );
@ -129,7 +129,7 @@ async fn ensure_running(details: &SnapRestoreDetails) -> Result<VsockClient, Err
return Ok(client); return Ok(client);
} }
Err(err) => { Err(err) => {
println!("stale VM detected, restarting ({})", err); eprintln!("stale VM detected, restarting ({})", err);
// VM is dead, restart // VM is dead, restart
let vms = start_vm(vm.cid, details).await?; let vms = start_vm(vm.cid, details).await?;
new_cid = vms.cid; new_cid = vms.cid;