提交 17d34b48 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 51541809
......@@ -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")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册