]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
maint: avoid 'const fooPtr' in all remaining places
authorEric Blake <eblake@redhat.com>
Tue, 8 Oct 2013 17:12:17 +0000 (11:12 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 14 Oct 2013 20:34:38 +0000 (14:34 -0600)
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can).  But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).

Fix up all remaining offenders.

* src/lxc/lxc_process.c (virLXCProcessSetupInterfaceBridged): Drop
needless const.
* src/uml/uml_driver.c (umlMonitorCommand): Use intended type.
(umlMonitorAddress): Fix fallout.
* src/xen/xm_internal.c (xenXMDomainSearchForUUID): Use intended type.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/lxc/lxc_process.c
src/uml/uml_driver.c
src/xen/xm_internal.c

index 8ede404f84387a0f14bfbbcd99c3a16edf9e62e2..f088e8e51b70c151dfb38bf9137545b8edebdaeb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
  * Copyright IBM Corp. 2008
  *
  * lxc_process.c: LXC process lifecycle management
@@ -246,7 +246,7 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
     char *ret = NULL;
     char *parentVeth;
     char *containerVeth = NULL;
-    const virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
+    virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
 
     VIR_DEBUG("calling vethCreate()");
     parentVeth = net->ifname;
index b9b977abb90dc22212d2560b5504871a76217ba1..9ac896af6b4949aac66328f5b7e2c4fda759aaa3 100644 (file)
@@ -141,7 +141,7 @@ static void umlShutdownVMDaemon(struct uml_driver *driver,
 
 
 static int umlMonitorCommand(const struct uml_driver *driver,
-                             const virDomainObjPtr vm,
+                             const virDomainObj *vm,
                              const char *cmd,
                              char **reply);
 
@@ -836,8 +836,9 @@ reopen:
 }
 
 static int umlMonitorAddress(const struct uml_driver *driver,
-                             virDomainObjPtr vm,
-                             struct sockaddr_un *addr) {
+                             const virDomainObj *vm,
+                             struct sockaddr_un *addr)
+{
     char *sockname;
     int retval = 0;
 
@@ -918,7 +919,7 @@ struct monitor_response {
 
 
 static int umlMonitorCommand(const struct uml_driver *driver,
-                             const virDomainObjPtr vm,
+                             const virDomainObj *vm,
                              const char *cmd,
                              char **reply)
 {
index d20dd910ec576eca6d8edf3351683cbe9a971b17..d9a3502dbda7d2ec4fdc375d2f54b6387ea935c2 100644 (file)
@@ -860,8 +860,8 @@ xenXMDomainSearchForUUID(const void *payload,
                          const void *name ATTRIBUTE_UNUSED,
                          const void *data)
 {
-    const unsigned char *wantuuid = (const unsigned char *)data;
-    const xenXMConfCachePtr entry = (const xenXMConfCachePtr)payload;
+    const unsigned char *wantuuid = data;
+    const xenXMConfCache *entry = payload;
 
     if (!memcmp(entry->def->uuid, wantuuid, VIR_UUID_BUFLEN))
         return 1;