提交 096b39c9 编写于 作者: J Jim Fehlig

xenconfig: use local variable for graphics def

'graphics->' is a bit easier to read and type, and makes for
shorter lines than 'def->graphics[0]->'.
Signed-off-by: NJim Fehlig <jfehlig@suse.com>
上级 d52d7a64
......@@ -667,9 +667,12 @@ static int
xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
{
const char *listenAddr = NULL;
virDomainGraphicsDefPtr graphics;
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
if (def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
graphics = def->graphics[0];
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
/* set others to false but may not be necessary */
if (xenConfigSetInt(conf, "sdl", 0) < 0)
return -1;
......@@ -681,37 +684,37 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
return -1;
if (xenConfigSetInt(conf, "spiceport",
def->graphics[0]->data.spice.port) < 0)
graphics->data.spice.port) < 0)
return -1;
if (xenConfigSetInt(conf, "spicetls_port",
def->graphics[0]->data.spice.tlsPort) < 0)
graphics->data.spice.tlsPort) < 0)
return -1;
if (def->graphics[0]->data.spice.auth.passwd) {
if (graphics->data.spice.auth.passwd) {
if (xenConfigSetInt(conf, "spicedisable_ticketing", 1) < 0)
return -1;
if (def->graphics[0]->data.spice.auth.passwd &&
if (graphics->data.spice.auth.passwd &&
xenConfigSetString(conf, "spicepasswd",
def->graphics[0]->data.spice.auth.passwd) < 0)
graphics->data.spice.auth.passwd) < 0)
return -1;
}
listenAddr = virDomainGraphicsListenGetAddress(def->graphics[0], 0);
listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
if (listenAddr &&
xenConfigSetString(conf, "spicehost", listenAddr) < 0)
return -1;
if (xenConfigSetInt(conf, "spiceagent_mouse",
def->graphics[0]->data.spice.mousemode) < 0)
graphics->data.spice.mousemode) < 0)
return -1;
if (def->graphics[0]->data.spice.copypaste) {
if (graphics->data.spice.copypaste) {
if (xenConfigSetInt(conf, "spicedvagent", 1) < 0)
return -1;
if (xenConfigSetInt(conf, "spice_clipboard_sharing",
def->graphics[0]->data.spice.copypaste) < 0)
graphics->data.spice.copypaste) < 0)
return -1;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册