[libvirt] [PATCH v4 03/13] Change virConnectDomainEventGraphicsCallback signature

Michal Privoznik mprivozn at redhat.com
Mon May 20 17:55:29 UTC 2013


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.
---
 include/libvirt/libvirt.h.in | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 693b834..1804c93 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4504,8 +4504,8 @@ typedef enum {
  */
 struct _virDomainEventGraphicsAddress {
     int family;               /* Address family, virDomainEventGraphicsAddressType */
-    const char *node;         /* Address of node (eg IP address, or UNIX path) */
-    const char *service;      /* Service name/number (eg TCP port, or NULL) */
+    char *node;               /* Address of node (eg IP address, or UNIX path) */
+    char *service;            /* Service name/number (eg TCP port, or NULL) */
 };
 typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
 typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
@@ -4520,8 +4520,8 @@ typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
  * some examples are 'x509dname' and 'saslUsername'.
  */
 struct _virDomainEventGraphicsSubjectIdentity {
-    const char *type;     /* Type of identity */
-    const char *name;     /* Identity value */
+    char *type;     /* Type of identity */
+    char *name;     /* Identity value */
 };
 typedef struct _virDomainEventGraphicsSubjectIdentity virDomainEventGraphicsSubjectIdentity;
 typedef virDomainEventGraphicsSubjectIdentity *virDomainEventGraphicsSubjectIdentityPtr;
@@ -4560,10 +4560,10 @@ typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
 typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
                                                       virDomainPtr dom,
                                                       int phase,
-                                                      virDomainEventGraphicsAddressPtr local,
-                                                      virDomainEventGraphicsAddressPtr remote,
+                                                      const virDomainEventGraphicsAddressPtr local,
+                                                      const virDomainEventGraphicsAddressPtr remote,
                                                       const char *authScheme,
-                                                      virDomainEventGraphicsSubjectPtr subject,
+                                                      const virDomainEventGraphicsSubjectPtr subject,
                                                       void *opaque);
 
 /**
-- 
1.8.2.1




More information about the libvir-list mailing list