[libvirt] [PATCHv8 03/11] blockjob: add qemu capabilities related to block jobs

Eric Blake eblake at redhat.com
Mon Oct 22 15:09:27 UTC 2012


On 10/20/2012 03:47 PM, Eric Blake wrote:
> Upstream qemu 1.3 is adding two new monitor commands, 'drive-mirror'
> and 'block-job-complete'[1], which can drive live block copy and
> storage migration.  Additionally, RHEL 6.3 had backported an earlier
> version of most of the same functionality, but under the names
> '__com.redhat_drive-mirror' and '__com.redhat_drive-reopen' and with
> slightly different JSON arguments, which we can support without too
> much extra effort.

> @@ -1884,6 +1886,10 @@ qemuCapsProbeQMPCommands(qemuCapsPtr caps,
>              qemuCapsSet(caps, QEMU_CAPS_KVM);
>          else if (strstr(name, "block-commit"))
>              qemuCapsSet(caps, QEMU_CAPS_BLOCK_COMMIT);
> +        else if (strstr(name, "drive-mirror"))
> +            qemuCapsSet(caps, QEMU_CAPS_DRIVE_MIRROR);

Off-list, it was pointed out to me that strstr() is a bit weak; I'm
changing this to:

if (STREQ(name, "drive-mirror") ||
    STREQ(name, "__com.redhat_drive-mirror"))

as that is more robust to any future QMP commands that happen to contain
the substring drive-mirror.

-- 
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/20121022/a4b21d7d/attachment-0001.sig>


More information about the libvir-list mailing list