char *errmsg; /* error message of failed sub-blockjob */
unsigned int apiFlags; /* original flags used when starting the job */
+
+ bool nbdStopped; /* The NBD server for a pull-mode backup was stopped. This
+ flag is deliberately not stored in the status XML as
+ it's related only to termination of the backup. */
};
typedef enum {
return;
if (backup->type == VIR_DOMAIN_BACKUP_TYPE_PULL) {
- if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
- return;
- ignore_value(qemuMonitorNBDServerStop(priv->mon));
- if (backup->tlsAlias)
- ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsAlias, false));
- if (backup->tlsSecretAlias)
- ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsSecretAlias, false));
- qemuDomainObjExitMonitor(vm);
+ if (!backup->nbdStopped) {
+ if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
+ return;
+ ignore_value(qemuMonitorNBDServerStop(priv->mon));
+ if (backup->tlsAlias)
+ ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsAlias, false));
+ if (backup->tlsSecretAlias)
+ ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsSecretAlias, false));
+ qemuDomainObjExitMonitor(vm);
+ backup->nbdStopped = true;
+ }
/* update the final statistics with the current job's data */
backup->pull_tmp_used += cur;