[libvirt] [PATCH 2/2] blockjob: wire up online qemu block-commit

Eric Blake eblake at redhat.com
Fri Oct 5 15:03:47 UTC 2012


On 10/05/2012 08:00 AM, Michal Privoznik wrote:
> On 04.10.2012 16:44, Eric Blake wrote:
>> This is the bare minimum to kick off a block commit.  In particular,
>> flags support is missing (shallow requires us to crawl the backing
>> chain to determine the file name to pass to the qemu monitor command;
>> delete requires us to track what needs to be deleted at the time
>> the completion event fires), and top must be non-NULL (matching the
>> fact that the current qemu code does not support committing the
>> active layer, although it is still planned to add that before 1.3).
>> Since the active layer won't change, we have it easy and do not have
>> to alter the domain XML.  We are also relying on qemu to do some
>> error detection on our behalf (such as validating 'top' and 'base'
>> as being members of the backing chain).  Additionally, this will
>> fail if SELinux is enforcing, because we fail to grant qemu proper
>> read/write access to the files it will be modifying.
>>

>> +
>> +static int
>> +qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
>> +                      const char *top, unsigned long bandwidth,
>> +                      unsigned int flags)
>> +{
>> +    struct qemud_driver *driver = dom->conn->privateData;
>> +    qemuDomainObjPrivatePtr priv;
>> +    virDomainObjPtr vm = NULL;
>> +    char *device = NULL;
>> +    int ret = -1;
>> +    virDomainEventPtr event = NULL;
> 
> Not used yet. But since this is a stub only it doesn't really matter.

I'll scrub it out before pushing (it's leftover from my other
unsubmitted branch for doing offline block commit, where we have to
synthesize the event because qemu is not running).

> 
> Looks good.

And Anthony just merged Jeff's patches into qemu.git today (now commit
ed61fc10), so I'll push this as soon as I complete another round of
testing, as well as work towards proper SELinux behavior.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121005/cba93cc4/attachment-0001.sig>


More information about the libvir-list mailing list