mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: monitor: Add 'tls-creds' parameter to 'nbd-server-start' command
To allow encryption of the non-shared storage migration NBD connection we will need to instantiated the NBD server with the TLS env. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
51541809b8
commit
17d34b482b
@ -411,7 +411,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
|
||||
else if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
|
||||
goto exit_monitor;
|
||||
|
||||
if (qemuMonitorNBDServerStart(priv->mon, listenAddr, port) < 0)
|
||||
if (qemuMonitorNBDServerStart(priv->mon, listenAddr, port, NULL) < 0)
|
||||
goto exit_monitor;
|
||||
}
|
||||
|
||||
|
@ -3999,13 +3999,14 @@ qemuMonitorGetGICCapabilities(qemuMonitorPtr mon,
|
||||
int
|
||||
qemuMonitorNBDServerStart(qemuMonitorPtr mon,
|
||||
const char *host,
|
||||
unsigned int port)
|
||||
unsigned int port,
|
||||
const char *tls_alias)
|
||||
{
|
||||
VIR_DEBUG("host=%s port=%u", host, port);
|
||||
VIR_DEBUG("host=%s port=%u tls_alias=%s", host, port, NULLSTR(tls_alias));
|
||||
|
||||
QEMU_CHECK_MONITOR_JSON(mon);
|
||||
|
||||
return qemuMonitorJSONNBDServerStart(mon, host, port);
|
||||
return qemuMonitorJSONNBDServerStart(mon, host, port, tls_alias);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1052,7 +1052,8 @@ char *qemuMonitorGetTargetArch(qemuMonitorPtr mon);
|
||||
|
||||
int qemuMonitorNBDServerStart(qemuMonitorPtr mon,
|
||||
const char *host,
|
||||
unsigned int port);
|
||||
unsigned int port,
|
||||
const char *tls_alias);
|
||||
int qemuMonitorNBDServerAdd(qemuMonitorPtr mon,
|
||||
const char *deviceID,
|
||||
bool writable);
|
||||
|
@ -6396,7 +6396,8 @@ qemuMonitorJSONBuildUnixSocketAddress(const char *path)
|
||||
int
|
||||
qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
|
||||
const char *host,
|
||||
unsigned int port)
|
||||
unsigned int port,
|
||||
const char *tls_alias)
|
||||
{
|
||||
int ret = -1;
|
||||
virJSONValuePtr cmd = NULL;
|
||||
@ -6412,6 +6413,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-start",
|
||||
"a:addr", &addr,
|
||||
"S:tls-creds", tls_alias,
|
||||
NULL)))
|
||||
goto cleanup;
|
||||
|
||||
|
@ -449,7 +449,8 @@ char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
|
||||
|
||||
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
|
||||
const char *host,
|
||||
unsigned int port);
|
||||
unsigned int port,
|
||||
const char *tls_alias);
|
||||
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
|
||||
const char *deviceID,
|
||||
bool writable);
|
||||
|
@ -1350,7 +1350,7 @@ GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "/foo/bar1", "/foo/bar2", NULL,
|
||||
GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")
|
||||
GEN_TEST_FUNC(qemuMonitorJSONScreendump, "/foo/bar")
|
||||
GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false)
|
||||
GEN_TEST_FUNC(qemuMonitorJSONNBDServerStart, "localhost", 12345)
|
||||
GEN_TEST_FUNC(qemuMonitorJSONNBDServerStart, "localhost", 12345, "test-alias")
|
||||
GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", true)
|
||||
GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user