71 lines
2.6 KiB
Diff
71 lines
2.6 KiB
Diff
|
commit 975ea20f85987855686a683c1840e56b7270c570
|
||
|
Author: Jim Fehlig <jfehlig@suse.com>
|
||
|
Date: Fri May 19 15:31:48 2017 -0600
|
||
|
|
||
|
maint: define a macro for IPv4 loopback address
|
||
|
|
||
|
Use a macro instead of hardcoding "127.0.0.1" throughout the
|
||
|
sources.
|
||
|
|
||
|
Index: libvirt-3.3.0/src/internal.h
|
||
|
===================================================================
|
||
|
--- libvirt-3.3.0.orig/src/internal.h
|
||
|
+++ libvirt-3.3.0/src/internal.h
|
||
|
@@ -79,6 +79,8 @@
|
||
|
# define INET_ADDRSTRLEN 16
|
||
|
# endif
|
||
|
|
||
|
+# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
|
||
|
+
|
||
|
/* String equality tests, suggested by Jim Meyering. */
|
||
|
# define STREQ(a, b) (strcmp(a, b) == 0)
|
||
|
# define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0)
|
||
|
Index: libvirt-3.3.0/src/qemu/qemu_conf.c
|
||
|
===================================================================
|
||
|
--- libvirt-3.3.0.orig/src/qemu/qemu_conf.c
|
||
|
+++ libvirt-3.3.0/src/qemu/qemu_conf.c
|
||
|
@@ -250,10 +250,10 @@ virQEMUDriverConfigPtr virQEMUDriverConf
|
||
|
SYSCONFDIR "/pki/qemu") < 0)
|
||
|
goto error;
|
||
|
|
||
|
- if (VIR_STRDUP(cfg->vncListen, "127.0.0.1") < 0)
|
||
|
+ if (VIR_STRDUP(cfg->vncListen, VIR_LOOPBACK_IPV4_ADDR) < 0)
|
||
|
goto error;
|
||
|
|
||
|
- if (VIR_STRDUP(cfg->spiceListen, "127.0.0.1") < 0)
|
||
|
+ if (VIR_STRDUP(cfg->spiceListen, VIR_LOOPBACK_IPV4_ADDR) < 0)
|
||
|
goto error;
|
||
|
|
||
|
/*
|
||
|
Index: libvirt-3.3.0/src/util/virsocketaddr.c
|
||
|
===================================================================
|
||
|
--- libvirt-3.3.0.orig/src/util/virsocketaddr.c
|
||
|
+++ libvirt-3.3.0/src/util/virsocketaddr.c
|
||
|
@@ -383,11 +383,11 @@ virSocketAddrFormatFull(const virSocketA
|
||
|
* nicely for UNIX sockets */
|
||
|
if (addr->data.sa.sa_family == AF_UNIX) {
|
||
|
if (withService) {
|
||
|
- if (virAsprintf(&addrstr, "127.0.0.1%s0",
|
||
|
+ if (virAsprintf(&addrstr, VIR_LOOPBACK_IPV4_ADDR"%s0",
|
||
|
separator ? separator : ":") < 0)
|
||
|
goto error;
|
||
|
} else {
|
||
|
- if (VIR_STRDUP(addrstr, "127.0.0.1") < 0)
|
||
|
+ if (VIR_STRDUP(addrstr, VIR_LOOPBACK_IPV4_ADDR) < 0)
|
||
|
goto error;
|
||
|
}
|
||
|
return addrstr;
|
||
|
Index: libvirt-3.3.0/src/vz/vz_sdk.c
|
||
|
===================================================================
|
||
|
--- libvirt-3.3.0.orig/src/vz/vz_sdk.c
|
||
|
+++ libvirt-3.3.0/src/vz/vz_sdk.c
|
||
|
@@ -3084,7 +3084,7 @@ static int prlsdkApplyGraphicsParams(PRL
|
||
|
|
||
|
glisten = virDomainGraphicsGetListen(gr, 0);
|
||
|
pret = PrlVmCfg_SetVNCHostName(sdkdom, glisten && glisten->address ?
|
||
|
- glisten->address : "127.0.0.1");
|
||
|
+ glisten->address : VIR_LOOPBACK_IPV4_ADDR);
|
||
|
prlsdkCheckRetGoto(pret, cleanup);
|
||
|
|
||
|
ret = 0;
|