mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: blockjob: Remove infrastructure for remembering to delete image
Now that we delete the images elsewhere it's not required. Additionally it's safe to do as we never released an upstream version which required this being in place. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
40485059ab
commit
3a98fe9db3
@ -298,8 +298,7 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
|
|||||||
virJSONValuePtr actions,
|
virJSONValuePtr actions,
|
||||||
virDomainMomentDefPtr *incremental,
|
virDomainMomentDefPtr *incremental,
|
||||||
virHashTablePtr blockNamedNodeData,
|
virHashTablePtr blockNamedNodeData,
|
||||||
virQEMUDriverConfigPtr cfg,
|
virQEMUDriverConfigPtr cfg)
|
||||||
bool removeStore)
|
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
|
|
||||||
@ -331,7 +330,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(dd->blockjob = qemuBlockJobDiskNewBackup(vm, dd->domdisk, dd->store,
|
if (!(dd->blockjob = qemuBlockJobDiskNewBackup(vm, dd->domdisk, dd->store,
|
||||||
removeStore,
|
|
||||||
dd->incrementalBitmap)))
|
dd->incrementalBitmap)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -389,13 +387,11 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm,
|
|||||||
virHashTablePtr blockNamedNodeData,
|
virHashTablePtr blockNamedNodeData,
|
||||||
virJSONValuePtr actions,
|
virJSONValuePtr actions,
|
||||||
virQEMUDriverConfigPtr cfg,
|
virQEMUDriverConfigPtr cfg,
|
||||||
struct qemuBackupDiskData **rdd,
|
struct qemuBackupDiskData **rdd)
|
||||||
bool reuse_external)
|
|
||||||
{
|
{
|
||||||
struct qemuBackupDiskData *disks = NULL;
|
struct qemuBackupDiskData *disks = NULL;
|
||||||
ssize_t ndisks = 0;
|
ssize_t ndisks = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
bool removeStore = !reuse_external && (def->type == VIR_DOMAIN_BACKUP_TYPE_PULL);
|
|
||||||
|
|
||||||
disks = g_new0(struct qemuBackupDiskData, def->ndisks);
|
disks = g_new0(struct qemuBackupDiskData, def->ndisks);
|
||||||
|
|
||||||
@ -410,7 +406,7 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm,
|
|||||||
|
|
||||||
if (qemuBackupDiskPrepareDataOne(vm, backupdisk, dd, actions,
|
if (qemuBackupDiskPrepareDataOne(vm, backupdisk, dd, actions,
|
||||||
incremental, blockNamedNodeData,
|
incremental, blockNamedNodeData,
|
||||||
cfg, removeStore) < 0)
|
cfg) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (def->type == VIR_DOMAIN_BACKUP_TYPE_PULL) {
|
if (def->type == VIR_DOMAIN_BACKUP_TYPE_PULL) {
|
||||||
@ -826,7 +822,7 @@ qemuBackupBegin(virDomainObjPtr vm,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if ((ndd = qemuBackupDiskPrepareData(vm, def, incremental, blockNamedNodeData,
|
if ((ndd = qemuBackupDiskPrepareData(vm, def, incremental, blockNamedNodeData,
|
||||||
actions, cfg, &dd, reuse)) <= 0) {
|
actions, cfg, &dd)) <= 0) {
|
||||||
if (ndd == 0) {
|
if (ndd == 0) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("no disks selected for backup"));
|
_("no disks selected for backup"));
|
||||||
|
@ -382,7 +382,6 @@ qemuBlockJobDataPtr
|
|||||||
qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
|
qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
|
||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
virStorageSourcePtr store,
|
virStorageSourcePtr store,
|
||||||
bool deleteStore,
|
|
||||||
const char *bitmap)
|
const char *bitmap)
|
||||||
{
|
{
|
||||||
g_autoptr(qemuBlockJobData) job = NULL;
|
g_autoptr(qemuBlockJobData) job = NULL;
|
||||||
@ -395,7 +394,6 @@ qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
|
|||||||
|
|
||||||
job->data.backup.bitmap = g_strdup(bitmap);
|
job->data.backup.bitmap = g_strdup(bitmap);
|
||||||
job->data.backup.store = virObjectRef(store);
|
job->data.backup.store = virObjectRef(store);
|
||||||
job->data.backup.deleteStore = deleteStore;
|
|
||||||
|
|
||||||
/* backup jobs are usually started in bulk by transaction so the caller
|
/* backup jobs are usually started in bulk by transaction so the caller
|
||||||
* shall save the status XML */
|
* shall save the status XML */
|
||||||
|
@ -113,7 +113,6 @@ typedef qemuBlockJobBackupData *qemuBlockJobDataBackupPtr;
|
|||||||
|
|
||||||
struct _qemuBlockJobBackupData {
|
struct _qemuBlockJobBackupData {
|
||||||
virStorageSourcePtr store;
|
virStorageSourcePtr store;
|
||||||
bool deleteStore;
|
|
||||||
char *bitmap;
|
char *bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -201,7 +200,6 @@ qemuBlockJobDataPtr
|
|||||||
qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
|
qemuBlockJobDiskNewBackup(virDomainObjPtr vm,
|
||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
virStorageSourcePtr store,
|
virStorageSourcePtr store,
|
||||||
bool deleteStore,
|
|
||||||
const char *bitmap);
|
const char *bitmap);
|
||||||
|
|
||||||
qemuBlockJobDataPtr
|
qemuBlockJobDataPtr
|
||||||
|
@ -2617,9 +2617,6 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
|
|||||||
data->xmlopt,
|
data->xmlopt,
|
||||||
false) < 0)
|
false) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (job->data.backup.deleteStore)
|
|
||||||
virBufferAddLit(&childBuf, "<deleteStore/>\n");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3222,10 +3219,6 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobDataPtr job,
|
|||||||
if (!(tmp = virXPathNode("./store", ctxt)) ||
|
if (!(tmp = virXPathNode("./store", ctxt)) ||
|
||||||
!(job->data.backup.store = qemuDomainObjPrivateXMLParseBlockjobChain(tmp, ctxt, xmlopt)))
|
!(job->data.backup.store = qemuDomainObjPrivateXMLParseBlockjobChain(tmp, ctxt, xmlopt)))
|
||||||
goto broken;
|
goto broken;
|
||||||
|
|
||||||
if (virXPathNode("./deleteStore", ctxt))
|
|
||||||
job->data.backup.deleteStore = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
case QEMU_BLOCKJOB_TYPE_BROKEN:
|
||||||
|
@ -248,7 +248,6 @@
|
|||||||
</privateData>
|
</privateData>
|
||||||
</source>
|
</source>
|
||||||
</store>
|
</store>
|
||||||
<deleteStore/>
|
|
||||||
</blockjob>
|
</blockjob>
|
||||||
</blockjobs>
|
</blockjobs>
|
||||||
<agentTimeout>-2</agentTimeout>
|
<agentTimeout>-2</agentTimeout>
|
||||||
|
Loading…
Reference in New Issue
Block a user