summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-04 15:06:09 +0100
committerRichard Jones <rjones@redhat.com>2010-05-04 15:26:20 +0100
commit8a9f2ca65521d093ac14307aca4370d9497ac840 (patch)
treeff1e57378920875ac8a00e4a2ea2a7fd89031985 /daemon
parent7d005a9ae820cff3274b456d99b0031d7277a61a (diff)
downloadlibguestfs-8a9f2ca65521d093ac14307aca4370d9497ac840.tar.gz
libguestfs-8a9f2ca65521d093ac14307aca4370d9497ac840.tar.xz
libguestfs-8a9f2ca65521d093ac14307aca4370d9497ac840.zip
Change network configuration to use macros.
Change the network configuration so everything is set using some macros at the top of src/guestfs.c. Also, rename the macros used in the daemon so they are not the same. It was a very long time since these sets of macros had to match the ones defined in src/guestfs.c, despite what the comment said. Note that this commit should not change the semantics of the program at all.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/guestfsd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 06ad702e..03a975a7 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -55,9 +55,14 @@
static char *read_cmdline (void);
-/* Also in guestfs.c */
-#define GUESTFWD_ADDR "10.0.2.4"
-#define GUESTFWD_PORT "6666"
+/* This is the default address we connect to for very old libraries
+ * which didn't specify the address and port number explicitly on the
+ * kernel command line. It's now recommended to always specify the
+ * address and port number on the command line, so this will not be
+ * used any more.
+ */
+#define OLD_GUESTFWD_ADDR "10.0.2.4"
+#define OLD_GUESTFWD_PORT "6666"
/* This is only a hint. If not defined, ignore it. */
#ifndef AI_ADDRCONFIG
@@ -285,7 +290,7 @@ main (int argc, char *argv[])
/* Default vmchannel. */
if (vmchannel == NULL) {
- vmchannel = strdup ("tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT);
+ vmchannel = strdup ("tcp:" OLD_GUESTFWD_ADDR ":" OLD_GUESTFWD_PORT);
if (!vmchannel) {
perror ("strdup");
exit (EXIT_FAILURE);