[libvirt] handle different version of QEMU

Hello, I'm implementing the "new" QEMU option of block_set_io_throttle(@bps_max, @bps_rd_max...), but i have a problem: The old version of QEMU(before 1.7) does not handle it, so I'd like to know what function should i use to know the version of QEMU, and what's the proper way to handle this problem ?

On 08/05/2014 10:14 AM, Matthias Gatto wrote:
Hello,
I'm implementing the "new" QEMU option of block_set_io_throttle(@bps_max, @bps_rd_max...), but i have a problem: The old version of QEMU(before 1.7) does not handle it, so I'd like to know what function should i use to know the version of QEMU, and what's the proper way to handle this problem ?
Look at src/qemu/qemu_capabilities.c for how we discover other capabilities. You'll have to find some way to force QMP introspection to reveal whether you are dealing with old or new qemu. Are you targetting a new command line option (look at virQEMUCapsCommandLine) or a new QMP command (look at virQEMUCapsCommands), or new optional arguments to existing QMP commands (tougher, since QMP doesn't necessarily have introspection yet) or something else? I'm not quite clear based on your description what you are trying to add support for. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

I'm targeting an existing QMP commands, the commands "block_set_io_throttle", which is already implemented in libvirt, but since the version 1.7 of QEMU new optional arguments have been add to it, but libvirt didn't handle these new arguments. On Tue, Aug 5, 2014 at 6:57 PM, Eric Blake <eblake@redhat.com> wrote:
On 08/05/2014 10:14 AM, Matthias Gatto wrote:
Hello,
I'm implementing the "new" QEMU option of block_set_io_throttle(@bps_max, @bps_rd_max...), but i have a problem: The old version of QEMU(before 1.7) does not handle it, so I'd like to know what function should i use to know the version of QEMU, and what's the proper way to handle this problem ?
Look at src/qemu/qemu_capabilities.c for how we discover other capabilities. You'll have to find some way to force QMP introspection to reveal whether you are dealing with old or new qemu. Are you targetting a new command line option (look at virQEMUCapsCommandLine) or a new QMP command (look at virQEMUCapsCommands), or new optional arguments to existing QMP commands (tougher, since QMP doesn't necessarily have introspection yet) or something else? I'm not quite clear based on your description what you are trying to add support for.
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Matthias Gatto