Skip to content

Commit

Permalink
vsock: optional prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
  • Loading branch information
gdevillele committed May 10, 2016
1 parent f2ef226 commit c5898bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ HAVE_OCAML_QCOW := $(shell if ocamlfind query qcow uri >/dev/null 2>/dev/null ;
ifeq ($(HAVE_OCAML_QCOW),YES)
CFLAGS += -DHAVE_OCAML=1 -DHAVE_OCAML_QCOW=1 -DHAVE_OCAML=1

# prefix vsock file names if PRI_ADDR_PREFIX
# is defined. (not applied to aliases)
ifneq ($(PRI_ADDR_PREFIX),)
CFLAGS += -DPRI_ADDR_PREFIX=\"$(PRI_ADDR_PREFIX)\"
endif

OCAML_SRC := \
src/mirage_block_ocaml.ml

Expand Down
8 changes: 7 additions & 1 deletion src/pci_virtio_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ struct vsock_addr {
};
#define PRIcid "08"PRIx32
#define PRIport "08"PRIx32
#define PRIaddr PRIcid ".%" PRIport

#ifdef PRI_ADDR_PREFIX
#define PRIaddr PRI_ADDR_PREFIX "%" PRIcid ".%" PRIport
#else
#define PRIaddr "%" PRIcid ".%" PRIport
#endif

#define FMTADDR(a) a.cid, a.port

#define WRITE_BUF_LENGTH (128*1024)
Expand Down

0 comments on commit c5898bf

Please sign in to comment.