]> xenbits.xensource.com Git - libvirt.git/commit
Change virConnectDomainEventGraphicsCallback signature
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 19 May 2013 10:48:11 +0000 (12:48 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 22 May 2013 16:53:59 +0000 (18:53 +0200)
commit6ac6f59c98813efac3defaaf5c5b12e9f387c228
tree87a9298c9fba0a3787b935ba32495b445ce58cb1
parent1f5deed9b6d453f7bca925ce68b9e3cc6d1e79cb
Change virConnectDomainEventGraphicsCallback signature

For future work we need _virDomainEventGraphicsAddress and
_virDomainEventGraphicsSubjectIdentity members to be char * not const
char *. We are strdup()-ing them anyway, so they should have been char *
anyway (from const correctness POV). However, we don't want users to
change passed values, so we need to make the callback's argument const.

Although this is an API change (not ABI though), real callers won't be
impacted. Why?
 1. these callback members are read-only, so it is less likely that
someone is trying to assign into the struct members.
 2. The only way to register a virConnectDomainEventGraphicsCallback is
to cast it through a call to virConnectDomainEventRegisterAny.  That is,
even if the user's callback function leaves out the const, we never use
the typedef as the direct type of any API parameter.  Since they are
already casting their function pointer into a munged type before
registering it, their code will continue to compile.
include/libvirt/libvirt.h.in