On 03/21/2016 04:18 AM, Maxim Nestratov wrote:
Hi all,
It's been already quite a long time since qemu implemented QMP
"drive-backup" command to create block devices backups. Even more, since
qemu 2.4 there is a possibility to create incremental backups. Though it
is possible to backup all attached to a domain disk drives by combining
them into a single QMP transaction command, this way of creating them,
not to mention managing, remains inconvenient for an end user of
libvirt. Moreover, creating a single drive backup via QMP interface
isn't handy either. That said, it looks reasonable to introduce a *new
backup API* based on QMP "drive-backup" facilities.
Though we can start from a single simple function, allowing to create a
disk backup by means of QMP "drive-backup" command, I'd like to discuss
here the level of management libvirt could provide for backup
operations. To begin with, here is the preliminary list of possible
functions that I think make sense for libvirt API.
virDomainCreateBackup - which creates a backup full/incremental of
all/selected disks,
I'm also wondering if it would be better to just add a new flag to our
existing virDomainBlockCopy() that specifies backup semantics (the
current default creates the block copy at the point in time that the job
is _ended_; whereas drive-backup creates the block copy at the oin in
time where the job is _started_), rather than needing new API.
virListBackups - which lists all backups created for a particular
domain/target,
virRestoreBackup - which restores all/selected disks from a backup,
virDeleteBackup - which deletes all/selected disks from a backup.
And here, I think that the existing virDomainSnapshot* API may already
fit this need, if we could more closely couple the act of creating
snapshots/backups with the act of disk backups.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org