[libvirt] [PATCH 04/21] backup: Introduce virDomainBackup APIs

Peter Krempa pkrempa at redhat.com
Tue Dec 3 13:22:04 UTC 2019


On Wed, Nov 27, 2019 at 11:30:30 -0600, Eric Blake wrote:
> On 11/26/19 3:39 PM, Peter Krempa wrote:

[...]

> > + * For now, backup jobs are also mutually exclusive with any
> > + * other block job on the same device, although this restriction may
> > + * be lifted in a future release. Progress of the backup job can be
> > + * tracked via virDomainGetJobStats(). Completion of the job is also announced
> > + * asynchronously via VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event.
> 
> Is that true for pull mode, or only for push mode?  With push mode, it's
> obvious when the event is needed - when qemu finishes pushing.  But in pull
> mode, the only time an event makes sense is when you finally abort the job
> and the NBD server goes away - but as that is always an explicit libvirt API
> call, does the event still make sense?

It's also emitted for the pull mode. The same way as we emit this event
for migration. A migration success is also reported by the migration API
return value, but the event is still emitted.

Given that the event also carries the statistics it might be of
interrest to the APP, or can be ignored.

> 
> > + *
> > + * There are two fundamental backup approaches. The first, called a
> > + * push model, instructs the hypervisor to copy the state of the guest
> > + * disk to the designated storage destination (which may be on the


[...]

> > + *
> > + * In some cases, a user can start a backup job without supplying all
> > + * details and rely on libvirt to fill in the rest (for example,
> > + * selecting the port used for an NBD export). This API can then be
> > + * used to learn what default values were chosen.
> > + *
> > + * Returns a NUL-terminated UTF-8 encoded XML instance or NULL in
> > + * case of error.  The caller must free() the returned value.
> > + */
> 
> Do we need any further tweaks to the virDomainAbortJob() API to mention that
> it is used to end a backup?

virDomainAbortJob documents that it aborts any current background job at
the soonest opportunity. The rest of the documentation mentions only
caveats for certain kinds of jobs. Since we don't have any for backup I
don't feel that it's necessary.




More information about the libvir-list mailing list