mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemuMonitorJSONGraphicsRelocate: Clean up command argument construction
Move the construction of the command from the variable declaration so that it doesn't exceed the line length and we can also move the logic of determining the protocol outside of the command construction. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
32e44f213c
commit
701c8c2467
@ -3590,17 +3590,20 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
|
||||
int tlsPort,
|
||||
const char *tlsSubject)
|
||||
{
|
||||
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("client_migrate_info",
|
||||
"s:protocol",
|
||||
(type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE ? "spice" : "vnc"),
|
||||
"s:hostname", hostname,
|
||||
"i:port", port,
|
||||
"i:tls-port", tlsPort,
|
||||
"S:cert-subject", tlsSubject,
|
||||
NULL);
|
||||
const char *protocol = "vnc";
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
|
||||
if (!cmd)
|
||||
if (type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
|
||||
protocol = "spice";
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("client_migrate_info",
|
||||
"s:protocol", protocol,
|
||||
"s:hostname", hostname,
|
||||
"i:port", port,
|
||||
"i:tls-port", tlsPort,
|
||||
"S:cert-subject", tlsSubject,
|
||||
NULL)))
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user