[spice-server,1/2] reds: Inline reds_mig_switch function

Submitted by Frediano Ziglio on Sept. 11, 2019, 7:55 a.m.

Details

Message ID 20190911075547.5210-1-fziglio@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Sept. 11, 2019, 7:55 a.m.
No much reason for not inlining it, it's quite small and do
not reduce readability.
Note that spice_server_migrate_switch is deprecated and not
used by Qemu since commit 67be6726b6459472103ee87ceaf2e8e97c154965
(cfr "spice: raise requirement to 0.12" September 2012).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index c294137be..cd8e796aa 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3148,16 +3148,6 @@  static void reds_mig_finished(RedsState *reds, int completed)
     reds_mig_release(reds->config);
 }
 
-static void reds_mig_switch(RedsState *reds)
-{
-    if (!reds->config->mig_spice) {
-        spice_warning("reds_mig_switch called without migrate_info set");
-        return;
-    }
-    main_channel_migrate_switch(reds->main_channel, reds->config->mig_spice);
-    reds_mig_release(reds->config);
-}
-
 static void migrate_timeout(void *opaque)
 {
     RedsState *reds = opaque;
@@ -4427,7 +4417,12 @@  SPICE_GNUC_VISIBLE int spice_server_migrate_switch(SpiceServer *reds)
        return 0;
     }
     reds->expect_migrate = FALSE;
-    reds_mig_switch(reds);
+    if (!reds->config->mig_spice) {
+        spice_warning("spice_server_migrate_switch called without migrate_info set");
+        return 0;
+    }
+    main_channel_migrate_switch(reds->main_channel, reds->config->mig_spice);
+    reds_mig_release(reds->config);
     return 0;
 }
 

Comments