@@ -410,8 +410,6 @@ MigrationState *migrate_get_current(void);
bool migrate_postcopy(void);
-int migrate_use_tls(void);
-
uint64_t ram_get_total_transferred_pages(void);
/* Sending on the return path - generic and then for each message type */
@@ -40,6 +40,15 @@ bool migrate_xbzrle(void);
bool migrate_zero_blocks(void);
bool migrate_zero_copy_send(void);
+/*
+ * pseudo capabilities
+ *
+ * This are functions that are used in a similar way that capabilities
+ * check, but they are not a capability.
+ */
+
+bool migrate_tls(void);
+
/* capabilities helpers */
bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp);
@@ -2248,15 +2248,6 @@ bool migrate_postcopy(void)
return migrate_postcopy_ram() || migrate_dirty_bitmaps();
}
-int migrate_use_tls(void)
-{
- MigrationState *s;
-
- s = migrate_get_current();
-
- return s->parameters.tls_creds && *s->parameters.tls_creds;
-}
-
/* migration thread support */
/*
* Something bad happened to the RP stream, mark an error
@@ -206,6 +206,20 @@ bool migrate_zero_copy_send(void)
return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND];
}
+
+/* pseudo capabilities */
+
+bool migrate_tls(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ return s->parameters.tls_creds && *s->parameters.tls_creds;
+}
+
+
+
typedef enum WriteTrackingSupport {
WT_SUPPORT_UNKNOWN = 0,
WT_SUPPORT_ABSENT,
@@ -355,7 +369,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
new_caps[MIGRATION_CAPABILITY_COMPRESS] ||
new_caps[MIGRATION_CAPABILITY_XBZRLE] ||
migrate_multifd_compression() ||
- migrate_use_tls())) {
+ migrate_tls())) {
error_setg(errp,
"Zero copy only available for non-compressed non-TLS multifd migration");
return false;
@@ -22,6 +22,7 @@
#include "channel.h"
#include "migration.h"
#include "tls.h"
+#include "options.h"
#include "crypto/tlscreds.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
@@ -165,7 +166,7 @@ void migration_tls_channel_connect(MigrationState *s,
bool migrate_channel_requires_tls_upgrade(QIOChannel *ioc)
{
- if (!migrate_use_tls()) {
+ if (!migrate_tls()) {
return false;
}
Once there, rename it to migrate_tls() and make it return bool for consistency. Signed-off-by: Juan Quintela <quintela@redhat.com> --- migration/migration.h | 2 -- migration/options.h | 9 +++++++++ migration/migration.c | 9 --------- migration/options.c | 16 +++++++++++++++- migration/tls.c | 3 ++- 5 files changed, 26 insertions(+), 13 deletions(-)