From 7e2b619148d1a15a6b4f13c9603daf9060bcb44a Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sat, 2 Mar 2024 22:03:28 -0500 Subject: [PATCH] Add initial endpoint function --- guestfs-inspectd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guestfs-inspectd.c b/guestfs-inspectd.c index a627743..7d8c250 100644 --- a/guestfs-inspectd.c +++ b/guestfs-inspectd.c @@ -6,6 +6,8 @@ void *worker_task; +char *endpoint(void); + int main(int argc, char **argv) { if (argc < 2) { printf("Usage: %s ...\n", argv[0]); @@ -25,3 +27,11 @@ int main(int argc, char **argv) { return EXIT_SUCCESS; } + +char *endpoint() { + // TODO: This should be based on GUESTFS_INSPECT_ENDPOINT, or XDG_RUNTIME_DIR if the former is not set, and default to a sensible path if neither are set. + const char* ep = "ipc:///tmp/guestfs-inspect.sock"; + char *res = malloc(strlen(ep) + 1); + strcpy(res, ep); + return res; +}