[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling |
Date: |
Wed, 17 May 2017 10:28:33 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 05/17/2017 09:53 AM, Pradeep Jagadeesh wrote:
>>> +#ifdef _WIN64
>>> +
>>> +void qmp_fsdev_set_io_throttle(IOThrottle *arg, Error **errp)
>>> +{
>>> + return;
>>> +}
>>> +
>>> +IOThrottleList *qmp_query_fsdev_io_throttle(Error **errp)
>>> +{
>>> + abort();
>>> +}
>>> +
>>> +#endif
>>
>> I think you're missing an addition to monitor.c
>> qmp_unregister_commands_hack() if you intend for this command to be
>> available only on non-windows platforms (and is your #ifdef the correct
>> name, or is this a Linux-only feature rather than a non-windows feature).
> I had to add this one here because, I was getting some error when I
> cross compile for Windows. But I do not have any idea about, do I need
> to add in monitor.c or not.
First point: is fsdev a Linux-only feature, or can it be compiled on
BSD? If it is Linux-only, then compiling a stub for Windows will still
leave BSD broken, and your #ifdef is wrong. Fixing compilation on mingw
is nice, but not the only platform to worry about.
Second point: if fsdev is indeed a platform-specific feature, then we
don't want to advertise the QMP commands that are useless when running
on a platform that doesn't support it. Anywhere you have to add a stub
for compilation means you ALSO need to patch monitor.c to unregister the
command from being advertised as a valid QMP command. (If you used
#ifdef __LINUX__ to guard the working version, and #ifndef __LINUX__ to
declare the stub, then the monitor.c needs an #ifndef section within
qmp_unregister_commands_hack() to tell QMP to not advertise the stubs.)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v4 1/4] throttle: factor out duplicate code, (continued)
Re: [Qemu-devel] [PATCH v4 0/4] fsdev: qmp interface for io throttling, no-reply, 2017/05/10