graphics: rename gListen to glisten

We have both in the code.  Let's use only one format.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-05-17 14:55:55 +02:00
parent 2faa13560c
commit 6bd0cd3b73
10 changed files with 62 additions and 62 deletions

View File

@ -23865,21 +23865,21 @@ int
virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
const char *address)
{
virDomainGraphicsListenDef gListen;
virDomainGraphicsListenDef glisten;
memset(&gListen, 0, sizeof(gListen));
memset(&glisten, 0, sizeof(glisten));
gListen.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS;
glisten.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS;
if (VIR_STRDUP(gListen.address, address) < 0)
if (VIR_STRDUP(glisten.address, address) < 0)
goto error;
if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, gListen) < 0)
if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, glisten) < 0)
goto error;
return 0;
error:
VIR_FREE(gListen.address);
VIR_FREE(glisten.address);
return -1;
}

View File

@ -1430,7 +1430,7 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
libxl_device_vfb *x_vfb)
{
unsigned short port;
virDomainGraphicsListenDefPtr gListen = NULL;
virDomainGraphicsListenDefPtr glisten = NULL;
libxl_device_vfb_init(x_vfb);
@ -1457,11 +1457,11 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
}
x_vfb->vnc.display = l_vfb->data.vnc.port - LIBXL_VNC_PORT_MIN;
if ((gListen = virDomainGraphicsGetListen(l_vfb, 0)) &&
gListen->address) {
if ((glisten = virDomainGraphicsGetListen(l_vfb, 0)) &&
glisten->address) {
/* libxl_device_vfb_init() does VIR_STRDUP("127.0.0.1") */
VIR_FREE(x_vfb->vnc.listen);
if (VIR_STRDUP(x_vfb->vnc.listen, gListen->address) < 0)
if (VIR_STRDUP(x_vfb->vnc.listen, glisten->address) < 0)
return -1;
}
if (VIR_STRDUP(x_vfb->vnc.passwd, l_vfb->data.vnc.auth.passwd) < 0)
@ -1551,7 +1551,7 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
for (i = 0; i < def->ngraphics; i++) {
virDomainGraphicsDefPtr l_vfb = def->graphics[i];
unsigned short port;
virDomainGraphicsListenDefPtr gListen = NULL;
virDomainGraphicsListenDefPtr glisten = NULL;
if (l_vfb->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
continue;
@ -1565,9 +1565,9 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
}
b_info->u.hvm.spice.port = l_vfb->data.spice.port;
if ((gListen = virDomainGraphicsGetListen(l_vfb, 0)) &&
gListen->address &&
VIR_STRDUP(b_info->u.hvm.spice.host, gListen->address) < 0)
if ((glisten = virDomainGraphicsGetListen(l_vfb, 0)) &&
glisten->address &&
VIR_STRDUP(b_info->u.hvm.spice.host, glisten->address) < 0)
return -1;
if (VIR_STRDUP(b_info->u.hvm.keymap, l_vfb->data.spice.keymap) < 0)

View File

@ -7357,7 +7357,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
const char *domainLibDir)
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
virDomainGraphicsListenDefPtr gListen = NULL;
virDomainGraphicsListenDefPtr glisten = NULL;
const char *listenAddr = NULL;
char *netAddr = NULL;
bool escapeAddr;
@ -7390,18 +7390,18 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
goto error;
}
if ((gListen = virDomainGraphicsGetListen(graphics, 0))) {
if ((glisten = virDomainGraphicsGetListen(graphics, 0))) {
switch (gListen->type) {
switch (glisten->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
listenAddr = gListen->address;
listenAddr = glisten->address;
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
if (!gListen->network)
if (!glisten->network)
break;
ret = networkGetNetworkAddress(gListen->network, &netAddr);
ret = networkGetNetworkAddress(glisten->network, &netAddr);
if (ret <= -2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("network-based listen not possible, "
@ -7414,7 +7414,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
listenAddr = netAddr;
/* store the address we found in the <graphics> element so it
* will show up in status. */
if (VIR_STRDUP(gListen->address, netAddr) < 0)
if (VIR_STRDUP(glisten->address, netAddr) < 0)
goto error;
break;
@ -7512,7 +7512,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
virDomainGraphicsDefPtr graphics)
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
virDomainGraphicsListenDefPtr gListen = NULL;
virDomainGraphicsListenDefPtr glisten = NULL;
const char *listenAddr = NULL;
char *netAddr = NULL;
int ret;
@ -7551,18 +7551,18 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
if (port > 0 || tlsPort > 0) {
if ((gListen = virDomainGraphicsGetListen(graphics, 0))) {
if ((glisten = virDomainGraphicsGetListen(graphics, 0))) {
switch (gListen->type) {
switch (glisten->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
listenAddr = gListen->address;
listenAddr = glisten->address;
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
if (!gListen->network)
if (!glisten->network)
break;
ret = networkGetNetworkAddress(gListen->network, &netAddr);
ret = networkGetNetworkAddress(glisten->network, &netAddr);
if (ret <= -2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("network-based listen not possible, "
@ -7575,7 +7575,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
listenAddr = netAddr;
/* store the address we found in the <graphics> element so it will
* show up in status. */
if (VIR_STRDUP(gListen->address, listenAddr) < 0)
if (VIR_STRDUP(glisten->address, listenAddr) < 0)
goto error;
break;

View File

@ -319,7 +319,7 @@ qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriverPtr driver,
{
qemuMigrationCookieGraphicsPtr mig = NULL;
const char *listenAddr;
virDomainGraphicsListenDefPtr gListen = virDomainGraphicsGetListen(def, 0);
virDomainGraphicsListenDefPtr glisten = virDomainGraphicsGetListen(def, 0);
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (VIR_ALLOC(mig) < 0)
@ -332,7 +332,7 @@ qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriverPtr driver,
else
mig->tlsPort = -1;
if (!gListen || !(listenAddr = gListen->address))
if (!glisten || !(listenAddr = glisten->address))
listenAddr = cfg->spiceListen;
#ifdef WITH_GNUTLS

View File

@ -1579,7 +1579,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
char *guiDisplay = NULL;
char *sdlDisplay = NULL;
size_t i = 0;
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
for (i = 0; i < def->ngraphics; i++) {
IVRDxServer *VRDxServer = NULL;
@ -1607,15 +1607,15 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
VIR_DEBUG("VRDP set to allow multiple connection");
}
if ((gListen = virDomainGraphicsGetListen(def->graphics[i], 0)) &&
gListen->address) {
if ((glisten = virDomainGraphicsGetListen(def->graphics[i], 0)) &&
glisten->address) {
PRUnichar *netAddressUtf16 = NULL;
VBOX_UTF8_TO_UTF16(gListen->address, &netAddressUtf16);
VBOX_UTF8_TO_UTF16(glisten->address, &netAddressUtf16);
gVBoxAPI.UIVRDxServer.SetNetAddress(data, VRDxServer,
netAddressUtf16);
VIR_DEBUG("VRDP listen address is set to: %s",
gListen->address);
glisten->address);
VBOX_UTF16_FREE(netAddressUtf16);
}

View File

@ -3402,7 +3402,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
int
virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
{
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
@ -3424,10 +3424,10 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
def->data.vnc.port);
}
if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
gListen->address) {
if ((glisten = virDomainGraphicsGetListen(def, 0)) &&
glisten->address) {
virBufferAsprintf(buffer, "RemoteDisplay.vnc.ip = \"%s\"\n",
gListen->address);
glisten->address);
}
if (def->data.vnc.keymap != NULL) {

View File

@ -2705,7 +2705,7 @@ static int prlsdkCheckFSUnsupportedParams(virDomainFSDefPtr fs)
static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
{
virDomainGraphicsDefPtr gr;
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
PRL_RESULT pret;
int ret = -1;
@ -2728,10 +2728,10 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
prlsdkCheckRetGoto(pret, cleanup);
}
if ((gListen = virDomainGraphicsGetListen(gr, 0))) {
if (!gListen->address)
if ((glisten = virDomainGraphicsGetListen(gr, 0))) {
if (!glisten->address)
goto cleanup;
pret = PrlVmCfg_SetVNCHostName(sdkdom, gListen->address);
pret = PrlVmCfg_SetVNCHostName(sdkdom, glisten->address);
prlsdkCheckRetGoto(pret, cleanup);
}

View File

@ -1643,7 +1643,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
def->graphics[0]->data.sdl.xauth) < 0)
return -1;
} else {
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
if (xenConfigSetInt(conf, "sdl", 0) < 0)
return -1;
@ -1660,9 +1660,9 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
def->graphics[0]->data.vnc.port - 5900) < 0)
return -1;
if ((gListen = virDomainGraphicsGetListen(def->graphics[0], 0)) &&
gListen->address &&
xenConfigSetString(conf, "vnclisten", gListen->address) < 0)
if ((glisten = virDomainGraphicsGetListen(def->graphics[0], 0)) &&
glisten->address &&
xenConfigSetString(conf, "vnclisten", glisten->address) < 0)
return -1;
if (def->graphics[0]->data.vnc.auth.passwd &&
@ -1689,7 +1689,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
virBufferAsprintf(&buf, ",xauthority=%s",
def->graphics[0]->data.sdl.xauth);
} else {
virDomainGraphicsListenDefPtr gListen
virDomainGraphicsListenDefPtr glisten
= virDomainGraphicsGetListen(def->graphics[0], 0);
virBufferAddLit(&buf, "type=vnc");
@ -1698,8 +1698,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def)
if (!def->graphics[0]->data.vnc.autoport)
virBufferAsprintf(&buf, ",vncdisplay=%d",
def->graphics[0]->data.vnc.port - 5900);
if (gListen && gListen->address)
virBufferAsprintf(&buf, ",vnclisten=%s", gListen->address);
if (glisten && glisten->address)
virBufferAsprintf(&buf, ",vnclisten=%s", glisten->address);
if (def->graphics[0]->data.vnc.auth.passwd)
virBufferAsprintf(&buf, ",vncpasswd=%s",
def->graphics[0]->data.vnc.auth.passwd);

View File

@ -1523,7 +1523,7 @@ static int
xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
virBufferPtr buf)
{
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
@ -1551,9 +1551,9 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
virBufferAsprintf(buf, "(vncdisplay %d)", def->data.vnc.port-5900);
}
if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
gListen->address)
virBufferAsprintf(buf, "(vnclisten '%s')", gListen->address);
if ((glisten = virDomainGraphicsGetListen(def, 0)) &&
glisten->address)
virBufferAsprintf(buf, "(vnclisten '%s')", glisten->address);
if (def->data.vnc.auth.passwd)
virBufferAsprintf(buf, "(vncpasswd '%s')", def->data.vnc.auth.passwd);
if (def->data.vnc.keymap)
@ -1579,7 +1579,7 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
static int
xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, virBufferPtr buf)
{
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
@ -1604,9 +1604,9 @@ xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, virBufferPtr buf)
virBufferAsprintf(buf, "(vncdisplay %d)", def->data.vnc.port-5900);
}
if ((gListen = virDomainGraphicsGetListen(def, 0)) &&
gListen->address)
virBufferAsprintf(buf, "(vnclisten '%s')", gListen->address);
if ((glisten = virDomainGraphicsGetListen(def, 0)) &&
glisten->address)
virBufferAsprintf(buf, "(vnclisten '%s')", glisten->address);
if (def->data.vnc.auth.passwd)
virBufferAsprintf(buf, "(vncpasswd '%s')", def->data.vnc.auth.passwd);
if (def->data.vnc.keymap)

View File

@ -837,7 +837,7 @@ xenFormatXLDomainDisks(virConfPtr conf, virDomainDefPtr def)
static int
xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
{
virDomainGraphicsListenDefPtr gListen;
virDomainGraphicsListenDefPtr glisten;
virDomainGraphicsDefPtr graphics;
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
@ -854,9 +854,9 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
if (xenConfigSetInt(conf, "spice", 1) < 0)
return -1;
if ((gListen = virDomainGraphicsGetListen(graphics, 0)) &&
gListen->address &&
xenConfigSetString(conf, "spicehost", gListen->address) < 0)
if ((glisten = virDomainGraphicsGetListen(graphics, 0)) &&
glisten->address &&
xenConfigSetString(conf, "spicehost", glisten->address) < 0)
return -1;
if (xenConfigSetInt(conf, "spiceport",