提交 a460295f 编写于 作者: J Jim Fehlig

xenconfig: fix spicepasswd handling

The logic related to spicedisable_ticketing and spicepasswd was
inverted.  As per man xl.cfg(5), 'spicedisable_ticketing = 1'
means no passwd is required.  On the other hand, a passwd is
required if 'spicedisable_ticketing = 0'.  Fix the logic and
produce and error if 'spicedisable_ticketing = 0' but spicepasswd
is not provided.  Also fix the spice cfg test file.
Signed-off-by: NJim Fehlig <jfehlig@suse.com>
上级 e21b1180
...@@ -192,8 +192,8 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) ...@@ -192,8 +192,8 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def)
if (xenConfigGetBool(conf, "spicedisable_ticketing", &val, 0) < 0) if (xenConfigGetBool(conf, "spicedisable_ticketing", &val, 0) < 0)
goto cleanup; goto cleanup;
if (val) { if (!val) {
if (xenConfigCopyStringOpt(conf, "spicepasswd", if (xenConfigCopyString(conf, "spicepasswd",
&graphics->data.spice.auth.passwd) < 0) &graphics->data.spice.auth.passwd) < 0)
goto cleanup; goto cleanup;
} }
...@@ -697,13 +697,15 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def) ...@@ -697,13 +697,15 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
return -1; return -1;
if (graphics->data.spice.auth.passwd) { if (graphics->data.spice.auth.passwd) {
if (xenConfigSetInt(conf, "spicedisable_ticketing", 1) < 0) if (xenConfigSetInt(conf, "spicedisable_ticketing", 0) < 0)
return -1; return -1;
if (graphics->data.spice.auth.passwd && if (xenConfigSetString(conf, "spicepasswd",
xenConfigSetString(conf, "spicepasswd",
graphics->data.spice.auth.passwd) < 0) graphics->data.spice.auth.passwd) < 0)
return -1; return -1;
} else {
if (xenConfigSetInt(conf, "spicedisable_ticketing", 1) < 0)
return -1;
} }
if (xenConfigSetInt(conf, "spiceagent_mouse", if (xenConfigSetInt(conf, "spiceagent_mouse",
......
...@@ -25,6 +25,6 @@ spice = 1 ...@@ -25,6 +25,6 @@ spice = 1
spicehost = "127.0.0.1" spicehost = "127.0.0.1"
spiceport = 590 spiceport = 590
spicetls_port = 500 spicetls_port = 500
spicedisable_ticketing = 1 spicedisable_ticketing = 0
spicepasswd = "thebeast" spicepasswd = "thebeast"
spiceagent_mouse = 0 spiceagent_mouse = 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册