[libvirt] [PATCH 2/4] event: introduce new event for cputune

Eric Blake eblake at redhat.com
Thu Sep 4 03:28:51 UTC 2014


On 08/28/2014 12:38 PM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---

> @@ -395,6 +405,10 @@ static virNetClientProgramEvent remoteEvents[] = {
>        remoteDomainBuildEventDeviceRemoved,
>        sizeof(remote_domain_event_device_removed_msg),
>        (xdrproc_t)xdr_remote_domain_event_device_removed_msg },
> +    { REMOTE_PROC_DOMAIN_EVENT_CPUTUNE,
> +      remoteDomainBuildEventCputune,
> +      sizeof(remote_domain_event_cputune_msg),
> +      (xdrproc_t)xdr_remote_domain_event_cputune_msg },
>      /* All events above here are legacy events, missing the callback
>       * ID, which means the server has a single global registration and
>       * we do full filtering in the client.  If the server lacks

This hunk is wrong.  Per the comment, you do NOT want an old-style event.

> @@ -476,6 +490,10 @@ static virNetClientProgramEvent remoteEvents[] = {
>        remoteDomainBuildEventBlockJob2,
>        sizeof(remote_domain_event_block_job_2_msg),
>        (xdrproc_t)xdr_remote_domain_event_block_job_2_msg },
> +    { REMOTE_PROC_DOMAIN_EVENT_CALLBACK_CPUTUNE,
> +      remoteDomainBuildEventCallbackCputune,
> +      sizeof(remote_domain_event_callback_cputune_msg),
> +      (xdrproc_t)xdr_remote_domain_event_callback_cputune_msg },

because the new-style is sufficient. [Or are you planning on backporting
this to an earlier version of libvirt that didn't support new-style events?]


> +
> +    /**
> +     * @generate: both
> +     * @acl: none
> +     */
> +    REMOTE_PROC_DOMAIN_EVENT_CPUTUNE = 345,

Likewise, this RPC should not be needed.

> +
> +    /**
> +     * @generate: both
> +     * @acl: none
> +     */
> +    REMOTE_PROC_DOMAIN_EVENT_CALLBACK_CPUTUNE = 346

and this one should be 345, and is sufficient.

Look at commit 1bfe73a126e; that covers the bare minimum that you need
to add a new-style event without worrying about back-compat to old libvirt.

-- 
Eric Blake   eblake 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: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140903/550ca9f3/attachment-0001.sig>


More information about the libvir-list mailing list