[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2 of 2] Add correct const-ness to memshr tool functions


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
  • Date: Mon, 09 Jan 2012 16:43:21 -0500
  • Cc: ian.jackson@xxxxxxxxxx, andres@xxxxxxxxxxxxxx, ian.campbell@xxxxxxxxxx, adin@xxxxxxxxxxxxxx
  • Delivery-date: Mon, 09 Jan 2012 21:39:51 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=content-type :mime-version:content-transfer-encoding:subject:message-id :in-reply-to:references:date:from:to:cc; q=dns; s= lagarcavilla.org; b=AiG4qhl0Rdp71JM+Xmrgp0lgS4Gl3HLGc4dkwnpk7u9h zoSuL6DpHLr8/7bI6qpuDKzgu03YfjZ1p6gR3jbYIt1KHGF2iZ2nitDNejI4tUf/ AKRg5NUgKoieeb/Qiwv0OAjdmGhKvALv6wnF0q8Isyf9rfI6bEuvArKtnczll/0=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

 tools/blktap2/drivers/Makefile  |  2 +-
 tools/blktap2/drivers/tapdisk.h |  4 ++++
 tools/memshr/interface.c        |  2 +-
 tools/memshr/memshr.h           |  2 +-
 tools/memshr/shm.c              |  2 +-
 tools/memshr/shm.h              |  2 +-
 6 files changed, 9 insertions(+), 5 deletions(-)


This patch addresses some of the compile and link issues with the memshr
module.

Signed-off-by: Adin Scannell <adin@xxxxxxxxxxx>
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/blktap2/drivers/Makefile
--- a/tools/blktap2/drivers/Makefile
+++ b/tools/blktap2/drivers/Makefile
@@ -43,7 +43,7 @@ MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
 MEMSHRLIBS :=
 ifeq ($(CONFIG_Linux), __fixme__)
 CFLAGS += -DMEMSHR
-MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
+MEMSHRLIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl $(MEMSHR_DIR)/libmemshr.a
 endif
 
 ifeq ($(VHD_STATIC),y)
diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h
+++ b/tools/blktap2/drivers/tapdisk.h
@@ -64,6 +64,10 @@
 #include "tapdisk-log.h"
 #include "tapdisk-utils.h"
 
+#ifdef MEMSHR
+#include "memshr.h"
+#endif
+
 #define DPRINTF(_f, _a...)           syslog(LOG_INFO, _f, ##_a)
 #define EPRINTF(_f, _a...)           syslog(LOG_ERR, "tap-err:%s: " _f, 
__func__, ##_a)
 #define PERROR(_f, _a...)            EPRINTF(_f ": %s", ##_a, strerror(errno))
diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/memshr/interface.c
--- a/tools/memshr/interface.c
+++ b/tools/memshr/interface.c
@@ -123,7 +123,7 @@ void memshr_vbd_initialize(void)
     vbd_info.enabled = 1;
 }
 
-uint16_t memshr_vbd_image_get(char* file)
+uint16_t memshr_vbd_image_get(const char* file)
 {
     uint16_t id;
 
diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/memshr/memshr.h
--- a/tools/memshr/memshr.h
+++ b/tools/memshr/memshr.h
@@ -28,7 +28,7 @@ typedef uint64_t xen_mfn_t;
 extern void memshr_set_domid(int domid);
 extern void memshr_daemon_initialize(void);
 extern void memshr_vbd_initialize(void);
-extern uint16_t memshr_vbd_image_get(char* file);
+extern uint16_t memshr_vbd_image_get(const char* file);
 extern void memshr_vbd_image_put(uint16_t memshr_id);
 extern int memshr_vbd_issue_ro_request(char *buf,
                                        grant_ref_t gref,
diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/memshr/shm.c
--- a/tools/memshr/shm.c
+++ b/tools/memshr/shm.c
@@ -187,7 +187,7 @@ struct blockshr_hash * shm_blockshr_hash
     return h;
 } 
 
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs)
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
 {
     vbd_image_info_t *img, *next_img;
     int i, img_id;
diff -r 2d3804d81c3c -r ee6a41ae9dcb tools/memshr/shm.h
--- a/tools/memshr/shm.h
+++ b/tools/memshr/shm.h
@@ -44,7 +44,7 @@ typedef struct shared_memshr_info {
 shared_memshr_info_t * shm_shared_info_open(int unlink);
 struct fgprtshr_hash * shm_fgprtshr_hash_open(int unlink);
 struct blockshr_hash * shm_blockshr_hash_open(int unlink);
-uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs);
+uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs);
 void     shm_vbd_image_put(uint16_t memshr_id, vbd_image_info_t *vbd_imgs);
 
 #endif /* __SHM_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.