mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-13 17:49:16 +00:00
5632ed8bad
Commit d75f865fb9
caused a job-deadlock if
a VM is running the backup job and being destroyed as it removed the
cleanup of the async job type and there was nothing to clean up the
backup job.
Add an explicit cleanup of the backup job when destroying a VM.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
60 lines
2.1 KiB
C
60 lines
2.1 KiB
C
/*
|
|
* qemu_backup.h: Implementation and handling of the backup jobs
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see
|
|
* <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
int
|
|
qemuBackupBegin(virDomainObjPtr vm,
|
|
const char *backupXML,
|
|
const char *checkpointXML,
|
|
unsigned int flags);
|
|
|
|
char *
|
|
qemuBackupGetXMLDesc(virDomainObjPtr vm,
|
|
unsigned int flags);
|
|
|
|
void
|
|
qemuBackupJobCancelBlockjobs(virDomainObjPtr vm,
|
|
virDomainBackupDefPtr backup,
|
|
bool terminatebackup,
|
|
int asyncJob);
|
|
|
|
void
|
|
qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm,
|
|
virDomainDiskDefPtr disk,
|
|
qemuBlockjobState state,
|
|
unsigned long long cur,
|
|
unsigned long long end,
|
|
int asyncJob);
|
|
|
|
void
|
|
qemuBackupJobTerminate(virDomainObjPtr vm,
|
|
qemuDomainJobStatus jobstatus);
|
|
|
|
int
|
|
qemuBackupGetJobInfoStats(virQEMUDriverPtr driver,
|
|
virDomainObjPtr vm,
|
|
qemuDomainJobInfoPtr jobInfo);
|
|
|
|
/* exported for testing */
|
|
virJSONValuePtr
|
|
qemuBackupDiskPrepareOneBitmapsChain(virDomainMomentDefPtr *incremental,
|
|
virStorageSourcePtr backingChain,
|
|
virHashTablePtr blockNamedNodeData,
|
|
const char *diskdst);
|