Skip to contentSkip to conversation

Network announce changes

PATCH Superseded Dr. David Alan Gilbert (git) 5 participants 25 messages Jan 28, 2019 – Feb 4, 2019 Networking

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover Network announce changes

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a reworking of a few sets of patches from 2017
that were put together by myself, Germano and Vlad that make the network announce system more flexible.

Firstly, it's parameterised, so that you can change the number
of packets and the gap between them; the number can be set to 0 to disable announce completely.

Secondly, you can force an announce by a qmp or hmp command at
any time. This is useful if you need the guest to do an announce for a different reason; for example if the management layer has just juggled some bonding configuration around.

The packet creation and timing also moves to net/ from migration/

The previous set was:

     https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05594.html

Dave

Dr. David Alan Gilbert (9):
net: Introduce announce timer
migration: Add announce parameters
virtio-net: Switch to using announce timer
migration: Switch to using announce timer
net: Add a network device specific self-announcement ability
virtio-net: Allow qemu_announce_self to trigger virtio announcements
qmp: Add announce-self command
hmp: Add hmp_announce_self
tests: Add a test for qemu self announcments

 hmp-commands.hx                |  14 ++++
 hmp.c                          |  33 ++++++++
 hmp.h                          |   1 +
 hw/net/trace-events            |   8 ++
 hw/net/virtio-net.c            |  69 ++++++++++++----
 include/hw/virtio/virtio-net.h |   4 +-
 include/migration/misc.h       |  12 +--
 include/net/announce.h         |  41 ++++++++++
 include/net/net.h              |   2 +
 include/qemu/typedefs.h        |   2 +
 include/sysemu/sysemu.h        |   2 -
 migration/migration.c          | 103 +++++++++++++++++++++++-
 migration/migration.h          |   4 +
 migration/savevm.c             |  72 +----------------
 migration/trace-events         |   1 -
 net/Makefile.objs              |   1 +
 net/announce.c                 | 141 +++++++++++++++++++++++++++++++++
 net/trace-events               |   4 +
 qapi/migration.json            |  56 ++++++++++++-
 qapi/net.json                  |  43 ++++++++++
 tests/Makefile.include         |   2 +
 tests/test-announce-self.c     |  83 +++++++++++++++++++
 tests/test-hmp.c               |   1 +
 23 files changed, 595 insertions(+), 104 deletions(-)
 create mode 100644 include/net/announce.h
 create mode 100644 net/announce.c
 create mode 100644 tests/test-announce-self.c
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/9 net: Introduce announce timer

From: "Dr. David Alan Gilbert" <[email protected]>

The 'announce timer' will be used by migration, and explicit requests for qemu to perform network announces.

Based on the work by Germano Veit Michel <[email protected]>
and Vlad Yasevich <[email protected]>

---
 include/net/announce.h  | 39 ++++++++++++++++++++++++++
 include/qemu/typedefs.h |  1 +
 migration/migration.c   |  1 +
 net/Makefile.objs       |  1 +
 net/announce.c          | 61 +++++++++++++++++++++++++++++++++++++++++
 qapi/net.json           | 23 ++++++++++++++++
 6 files changed, 126 insertions(+)
 create mode 100644 include/net/announce.h
 create mode 100644 net/announce.c
include/net/announce.h new file +39 -0
new file mode 100644
index 0000000000..b89f1c28b5
@@ -0,0 +1,39 @@
+/*
+ *  Self-announce facility
+ *  (c) 2017-2019 Red Hat, Inc.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_NET_ANNOUNCE_H
+#define QEMU_NET_ANNOUNCE_H
+
+#include "qemu-common.h"
+#include "qapi/qapi-types-net.h"
+#include "qemu/timer.h"
+
+struct AnnounceTimer {
+    QEMUTimer *tm;
+    AnnounceParameters params;
+    QEMUClockType type;
+    int round;
+};
+
+/* Returns: update the timer to the next time point */
+int64_t qemu_announce_timer_step(AnnounceTimer *timer);
+
+/* Delete the underlying timer */
+void qemu_announce_timer_del(AnnounceTimer *timer);
+
+/*
+ * Under BQL/main thread
+ * Reset the timer to the given parameters/type/notifier.
+ */
+void qemu_announce_timer_reset(AnnounceTimer *timer,
+                               AnnounceParameters *params,
+                               QEMUClockType type,
+                               QEMUTimerCB *cb,
+                               void *opaque);
+
+#endif
include/qemu/typedefs.h +1 -0
index 5d1a2d8329..e4a0a656d1 100644
@@ -8,6 +8,7 @@
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
+typedef struct AnnounceTimer AnnounceTimer;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
 typedef struct BlockBackend BlockBackend;
migration/migration.c +1 -0
index 37e06b76dc..a9c4c6f01d 100644
@@ -45,6 +45,7 @@
 #include "migration/colo.h"
 #include "hw/boards.h"
 #include "monitor/monitor.h"
+#include "net/announce.h"
 
 #define MAX_THROTTLE  (32 << 20)      /* Migration transfer speed throttling */
 
net/Makefile.objs +1 -0
index b2bf88a0ef..b363fe92d9 100644
@@ -2,6 +2,7 @@ common-obj-y = net.o queue.o checksum.o util.o hub.o
 common-obj-y += socket.o
 common-obj-y += dump.o
 common-obj-y += eth.o
+common-obj-y += announce.o
 common-obj-$(CONFIG_L2TPV3) += l2tpv3.o
 common-obj-$(CONFIG_POSIX) += vhost-user.o
 common-obj-$(CONFIG_SLIRP) += slirp.o
net/announce.c new file +61 -0

61 lines not on this page · raw message

qapi/net.json +23 -0
index a1a0f39f74..b9ff7617bd 100644
@@ -684,3 +684,26 @@
 ##
 { 'event': 'NIC_RX_FILTER_CHANGED',
   'data': { '*name': 'str', 'path': 'str' } }
+
+##
+# @AnnounceParameters:
+#
+# Parameters for self-announce timers
+#
+# @initial: Initial delay (in ms) before sending the first GARP/RARP
+#       announcement
+#
+# @max: Maximum delay (in ms) to between GARP/RARP announcement packets
+#
+# @rounds: Number of self-announcement attempts
+#
+# @step: Delay increase (in ms) after each self-announcement attempt
+#
+# Since: 4.0
+##
+
+{ 'struct': 'AnnounceParameters',
+  'data': { 'initial': 'int',
+            'max': 'int',
+            'rounds': 'int',
+            'step': 'int' } }
Signature · 1 line
2.20.1
#2 lore raw

Re: [Qemu-devel] [PATCH 1/9] net: Introduce announce timer

Quoted 16 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

The 'announce timer' will be used by migration, and explicit requests for qemu to perform network announces.

Based on the work by Germano Veit Michel <[email protected]>
and Vlad Yasevich <[email protected]>

---

+++ b/qapi/net.json

qapi/net.json +0 -0
@@ -684,3 +684,26 @@
 ##
 { 'event': 'NIC_RX_FILTER_CHANGED',
   'data': { '*name': 'str', 'path': 'str' } }

qapi/net.json line 696

Quoted 10 lines
qapi/net.json +10 -0
+
+##
+# @AnnounceParameters:
+#
+# Parameters for self-announce timers
+#
+# @initial: Initial delay (in ms) before sending the first GARP/RARP
+#       announcement
+#
+# @max: Maximum delay (in ms) to between GARP/RARP announcement packets

"to between" should be either "to use in between" or merely "between"

Quoted 4 lines
qapi/net.json +3 -0
+#
+# @rounds: Number of self-announcement attempts
+#

qapi/net.json line 709

Quoted 10 lines
qapi/net.json +10 -0
+# @step: Delay increase (in ms) after each self-announcement attempt
+#
+# Since: 4.0
+##
+
+{ 'struct': 'AnnounceParameters',
+  'data': { 'initial': 'int',
+            'max': 'int',
+            'rounds': 'int',
+            'step': 'int' } }

Can/should any of the parameters be optional with a sane (documented) default?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#3 lore raw

Re: [Qemu-devel] [PATCH 1/9] net: Introduce announce timer

Quoted 21 lines · * Eric Blake ([email protected]) wrote:
Quoted 20 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

The 'announce timer' will be used by migration, and explicit requests for qemu to perform network announces.

Based on the work by Germano Veit Michel <[email protected]>
and Vlad Yasevich <[email protected]>

---

+++ b/qapi/net.json

qapi/net.json +4 -0
@@ -684,3 +684,26 @@
 ##
 { 'event': 'NIC_RX_FILTER_CHANGED',
   'data': { '*name': 'str', 'path': 'str' } }
+
+##
+# @AnnounceParameters:
+#
Quoted 8 lines

qapi/net.json line 696

Quoted 6 lines
qapi/net.json +6 -0
+# Parameters for self-announce timers
+#
+# @initial: Initial delay (in ms) before sending the first GARP/RARP
+#       announcement
+#
+# @max: Maximum delay (in ms) to between GARP/RARP announcement packets

"to between" should be either "to use in between" or merely "between"

I've changed it to the plain 'between'.

Quoted 9 lines
Quoted 9 lines
qapi/net.json +9 -0
+#
+# @rounds: Number of self-announcement attempts
+#
+# @step: Delay increase (in ms) after each self-announcement attempt
+#
+# Since: 4.0
+##
+
+{ 'struct': 'AnnounceParameters',
Quoted 8 lines

qapi/net.json line 709

Quoted 5 lines
qapi/net.json +4 -0
+  'data': { 'initial': 'int',
+            'max': 'int',
+            'rounds': 'int',
+            'step': 'int' } }

Can/should any of the parameters be optional with a sane (documented) default?

I think last time Dan was arguing for it to be explicit, the only default we could pick are the values we currently use, which I think are only defendable as 'seem to have worked well so far'.

Dave

Quoted 5 lines
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#4 lore raw

PATCH 2/9 migration: Add announce parameters

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add migration parameters that control RARP/GARP announcement timeouts.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---
 hmp.c                    |  28 +++++++++++
 include/migration/misc.h |   2 +
 include/qemu/typedefs.h  |   1 +
 migration/migration.c    | 100 +++++++++++++++++++++++++++++++++++++++
 qapi/migration.json      |  56 ++++++++++++++++++++--
 5 files changed, 183 insertions(+), 4 deletions(-)
hmp.c +28 -0
index b2a2b1f84e..319f5134cd 100644
@@ -334,6 +334,18 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
     params = qmp_query_migrate_parameters(NULL);
 
     if (params) {
+        monitor_printf(mon, "%s: %" PRIu64 " ms\n",
+            MigrationParameter_str(MIGRATION_PARAMETER_ANNOUNCE_INITIAL),
+            params->announce_initial);
+        monitor_printf(mon, "%s: %" PRIu64 " ms\n",
+            MigrationParameter_str(MIGRATION_PARAMETER_ANNOUNCE_MAX),
+            params->announce_max);
+        monitor_printf(mon, "%s: %" PRIu64 "\n",
+            MigrationParameter_str(MIGRATION_PARAMETER_ANNOUNCE_ROUNDS),
+            params->announce_rounds);
+        monitor_printf(mon, "%s: %" PRIu64 " ms\n",
+            MigrationParameter_str(MIGRATION_PARAMETER_ANNOUNCE_STEP),
+            params->announce_step);
         assert(params->has_compress_level);
         monitor_printf(mon, "%s: %u\n",
             MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_LEVEL),
@@ -1757,6 +1769,22 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
         p->has_max_postcopy_bandwidth = true;
         visit_type_size(v, param, &p->max_postcopy_bandwidth, &err);
         break;
+    case MIGRATION_PARAMETER_ANNOUNCE_INITIAL:
+        p->has_announce_initial = true;
+        visit_type_size(v, param, &p->announce_initial, &err);
+        break;
+    case MIGRATION_PARAMETER_ANNOUNCE_MAX:
+        p->has_announce_max = true;
+        visit_type_size(v, param, &p->announce_max, &err);
+        break;
+    case MIGRATION_PARAMETER_ANNOUNCE_ROUNDS:
+        p->has_announce_rounds = true;
+        visit_type_size(v, param, &p->announce_rounds, &err);
+        break;
+    case MIGRATION_PARAMETER_ANNOUNCE_STEP:
+        p->has_announce_step = true;
+        visit_type_size(v, param, &p->announce_step, &err);
+        break;
     default:
         assert(0);
     }
include/migration/misc.h +2 -0
index 4ebf24c6c2..e837ab3042 100644
@@ -15,6 +15,7 @@
 #define MIGRATION_MISC_H
 
 #include "qemu/notify.h"
+#include "qapi/qapi-types-net.h"
 
 /* migration/ram.c */
 
@@ -38,6 +39,7 @@ int64_t self_announce_delay(int round)
     return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
 }
 
+AnnounceParameters *migrate_announce_params(void);
 /* migration/savevm.c */
 
 void dump_vmstate_json_to_file(FILE *out_fp);
include/qemu/typedefs.h +1 -0
index e4a0a656d1..22b8b20306 100644
@@ -8,6 +8,7 @@
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
+typedef struct AnnounceParameters AnnounceParameters;
 typedef struct AnnounceTimer AnnounceTimer;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
migration/migration.c +100 -0

146 lines not on this page · raw message

qapi/migration.json +52 -4

107 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

Re: [Qemu-devel] [PATCH 2/9] migration: Add announce parameters

Quoted 20 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add migration parameters that control RARP/GARP announcement timeouts.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---

+++ b/qapi/migration.json

qapi/migration.json +1 -0
@@ -6,6 +6,7 @@
 ##
 
 { 'include': 'common.json' }
+{ 'include': 'net.json' }
 
 ##
 # @MigrationStats:

qapi/migration.json line 484

Quoted 4 lines
qapi/migration.json +1 -0
@@ -480,6 +481,18 @@
 #
 # Migration parameters enumeration
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce

s/Inital/Initial/ [2]

qapi/migration.json line 495

Quoted 11 lines
qapi/migration.json +11 -0
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#

The new parameters are optional below [1]; should they have a default value documented, and are there any constraints such that if you set one, you must set all four to match the previous' patch having all four be non-optional?

qapi/migration.json line 688

Quoted 10 lines
qapi/migration.json +5 -1
@@ -653,7 +681,11 @@
 # TODO either fuse back into MigrationParameters, or make
 # MigrationParameters members mandatory
 { 'struct': 'MigrateSetParameters',
-  'data': { '*compress-level': 'int',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'int',

[1] mentioned above

qapi/migration.json line 728

Quoted 9 lines
qapi/migration.json +2 -0
             '*compress-threads': 'int',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'int',
@@ -692,6 +724,18 @@
 #
 # The optional members aren't actually optional.
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)

[2] again

qapi/migration.json line 820

Quoted 10 lines
qapi/migration.json +5 -1
@@ -769,7 +813,11 @@
 # Since: 2.4
 ##
 { 'struct': 'MigrationParameters',
-  'data': { '*compress-level': 'uint8',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'uint8',

[1] again

qapi/migration.json line 836

Quoted 9 lines
qapi/migration.json +1 -1
             '*compress-threads': 'uint8',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'uint8',
@@ -785,7 +833,7 @@
             '*x-multifd-page-count': 'uint32',
             '*xbzrle-cache-size': 'size',
 	    '*max-postcopy-bandwidth': 'size',
-            '*max-cpu-throttle':'uint8'} }
+            '*max-cpu-throttle':'uint8' } }

Why the whitespace churn?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#6 lore raw

Re: [Qemu-devel] [PATCH 2/9] migration: Add announce parameters

Quoted 18 lines · * Eric Blake ([email protected]) wrote:
Quoted 17 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add migration parameters that control RARP/GARP announcement timeouts.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---

+++ b/qapi/migration.json

qapi/migration.json +1 -0
@@ -6,6 +6,7 @@
 ##
 
 { 'include': 'common.json' }
+{ 'include': 'net.json' }
 
Quoted 9 lines

qapi/migration.json line 484

Quoted 7 lines
qapi/migration.json +1 -0
 ##
 # @MigrationStats:
@@ -480,6 +481,18 @@
 #
 # Migration parameters enumeration
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce

s/Inital/Initial/ [2]

Fixed.

Quoted 8 lines
Quoted 8 lines
qapi/migration.json +8 -0
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
Quoted 8 lines

qapi/migration.json line 495

Quoted 3 lines
qapi/migration.json +3 -0
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#

The new parameters are optional below [1]; should they have a default value documented, and are there any constraints such that if you set one, you must set all four to match the previous' patch having all four be non-optional?

I think this is just the same as all the other migration-parameters isn't it? It's the way that the 'migrate-set-parameters' command allows you to set an individual parameter without changing the others; it's not about defaults, just that whatever setting you currently have doesn't change.

Quoted 14 lines

qapi/migration.json line 688

Quoted 11 lines
qapi/migration.json +5 -1
@@ -653,7 +681,11 @@
 # TODO either fuse back into MigrationParameters, or make
 # MigrationParameters members mandatory
 { 'struct': 'MigrateSetParameters',
-  'data': { '*compress-level': 'int',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'int',

[1] mentioned above

Quoted 12 lines

qapi/migration.json line 728

Quoted 9 lines
qapi/migration.json +2 -0
             '*compress-threads': 'int',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'int',
@@ -692,6 +724,18 @@
 #
 # The optional members aren't actually optional.
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)

[2] again

Fixed.

Quoted 14 lines

qapi/migration.json line 820

Quoted 11 lines
qapi/migration.json +5 -1
@@ -769,7 +813,11 @@
 # Since: 2.4
 ##
 { 'struct': 'MigrationParameters',
-  'data': { '*compress-level': 'uint8',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'uint8',

[1] again

Quoted 11 lines

qapi/migration.json line 836

Quoted 9 lines
qapi/migration.json +1 -1
             '*compress-threads': 'uint8',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'uint8',
@@ -785,7 +833,7 @@
             '*x-multifd-page-count': 'uint32',
             '*xbzrle-cache-size': 'size',
 	    '*max-postcopy-bandwidth': 'size',
-            '*max-cpu-throttle':'uint8'} }
+            '*max-cpu-throttle':'uint8' } }

Why the whitespace churn?

Removed (although I think the extra space is cleaner).

Dave

Quoted 5 lines
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Acked-by on v1 2/9
#7 lore raw

Re: [Qemu-devel] [PATCH 2/9] migration: Add announce parameters

In reply to Dr. David Alan Gilbert (git)
Quoted 9 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add migration parameters that control RARP/GARP announcement timeouts.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---

[...]

qapi/migration.json line 12

Quoted 12 lines
qapi/migration.json +1 -0
index 7a795ecc16..868071d3a0 100644
@@ -6,6 +6,7 @@
 ##
 
 { 'include': 'common.json' }
+{ 'include': 'net.json' }
 
 ##
 # @MigrationStats:

This hunk looks superfluous.

qapi/migration.json line 485

Quoted 6 lines
qapi/migration.json +2 -0
@@ -480,6 +481,18 @@
 #
 # Migration parameters enumeration
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)

Current master has one instance of ms in qapi/, 9 of milliseconds. I'd stick to the more common spelling.

Quoted 93 lines
qapi/migration.json +48 -3
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: Set the compression level to be used in live migration,
 #          the compression level is an integer between 0 and 9, where 0 means
 #          no compression, 1 means the best compression speed, and 9 means best
@@ -557,10 +570,13 @@
 #
 # @max-cpu-throttle: maximum cpu throttle percentage.
 #                    Defaults to 99. (Since 3.1)
+#
 # Since: 2.4
 ##
 { 'enum': 'MigrationParameter',
-  'data': ['compress-level', 'compress-threads', 'decompress-threads',
+  'data': ['announce-initial', 'announce-max',
+           'announce-rounds', 'announce-step',
+           'compress-level', 'compress-threads', 'decompress-threads',
            'compress-wait-thread',
            'cpu-throttle-initial', 'cpu-throttle-increment',
            'tls-creds', 'tls-hostname', 'max-bandwidth',
@@ -572,6 +588,18 @@
 ##
 # @MigrateSetParameters:
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: compression level
 #
 # @compress-threads: compression thread count
@@ -653,7 +681,11 @@
 # TODO either fuse back into MigrationParameters, or make
 # MigrationParameters members mandatory
 { 'struct': 'MigrateSetParameters',
-  'data': { '*compress-level': 'int',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'int',
             '*compress-threads': 'int',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'int',
@@ -692,6 +724,18 @@
 #
 # The optional members aren't actually optional.
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: compression level
 #
 # @compress-threads: compression thread count
@@ -769,7 +813,11 @@
 # Since: 2.4
 ##
 { 'struct': 'MigrationParameters',
-  'data': { '*compress-level': 'uint8',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'uint8',
             '*compress-threads': 'uint8',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'uint8',

qapi/migration.json line 839

Quoted 8 lines
qapi/migration.json +1 -1
@@ -785,7 +833,7 @@
             '*x-multifd-page-count': 'uint32',
             '*xbzrle-cache-size': 'size',
 	    '*max-postcopy-bandwidth': 'size',
-            '*max-cpu-throttle':'uint8'} }
+            '*max-cpu-throttle':'uint8' } }
 
 ##
 # @query-migrate-parameters:

Since you're tidying up whitespace, consider expanding the tab.

With the superfluous hunk dropped, QAPI part

#8 lore raw

Re: [Qemu-devel] [PATCH 2/9] migration: Add announce parameters

Quoted 19 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 9 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add migration parameters that control RARP/GARP announcement timeouts.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---

[...]

Quoted 7 lines
qapi/migration.json +0 -0
index 7a795ecc16..868071d3a0 100644
@@ -6,6 +6,7 @@
 ##
 
Quoted 7 lines

qapi/migration.json line 12

Quoted 5 lines
qapi/migration.json +1 -0
 { 'include': 'common.json' }
+{ 'include': 'net.json' }
 
 ##
 # @MigrationStats:

This hunk looks superfluous.

Gone.

Quoted 9 lines

qapi/migration.json line 485

Quoted 6 lines
qapi/migration.json +2 -0
@@ -480,6 +481,18 @@
 #
 # Migration parameters enumeration
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)

Current master has one instance of ms in qapi/, 9 of milliseconds. I'd stick to the more common spelling.

OK, changed (with some wrapping changed now the lines are longer, and an added 'e' in announcment).

Quoted 99 lines
Quoted 99 lines
qapi/migration.json +49 -4
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: Set the compression level to be used in live migration,
 #          the compression level is an integer between 0 and 9, where 0 means
 #          no compression, 1 means the best compression speed, and 9 means best
@@ -557,10 +570,13 @@
 #
 # @max-cpu-throttle: maximum cpu throttle percentage.
 #                    Defaults to 99. (Since 3.1)
+#
 # Since: 2.4
 ##
 { 'enum': 'MigrationParameter',
-  'data': ['compress-level', 'compress-threads', 'decompress-threads',
+  'data': ['announce-initial', 'announce-max',
+           'announce-rounds', 'announce-step',
+           'compress-level', 'compress-threads', 'decompress-threads',
            'compress-wait-thread',
            'cpu-throttle-initial', 'cpu-throttle-increment',
            'tls-creds', 'tls-hostname', 'max-bandwidth',
@@ -572,6 +588,18 @@
 ##
 # @MigrateSetParameters:
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: compression level
 #
 # @compress-threads: compression thread count
@@ -653,7 +681,11 @@
 # TODO either fuse back into MigrationParameters, or make
 # MigrationParameters members mandatory
 { 'struct': 'MigrateSetParameters',
-  'data': { '*compress-level': 'int',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'int',
             '*compress-threads': 'int',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'int',
@@ -692,6 +724,18 @@
 #
 # The optional members aren't actually optional.
 #
+# @announce-initial: Inital delay (in ms) before sending the first announce
+#          (Since 4.0)
+#
+# @announce-max: Maximum delay (in ms) between packets in the announcment
+#          (Since 4.0)
+#
+# @announce-rounds: Number of self-announce packets sent after migration
+#          (Since 4.0)
+#
+# @announce-step: Increase in delay (in ms) between subsequent packets in
+#          the announcement (Since 4.0)
+#
 # @compress-level: compression level
 #
 # @compress-threads: compression thread count
@@ -769,7 +813,11 @@
 # Since: 2.4
 ##
 { 'struct': 'MigrationParameters',
-  'data': { '*compress-level': 'uint8',
+  'data': { '*announce-initial': 'size',
+            '*announce-max': 'size',
+            '*announce-rounds': 'size',
+            '*announce-step': 'size',
+            '*compress-level': 'uint8',
             '*compress-threads': 'uint8',
             '*compress-wait-thread': 'bool',
             '*decompress-threads': 'uint8',
@@ -785,7 +833,7 @@
             '*x-multifd-page-count': 'uint32',
             '*xbzrle-cache-size': 'size',
 	    '*max-postcopy-bandwidth': 'size',
-            '*max-cpu-throttle':'uint8'} }
+            '*max-cpu-throttle':'uint8' } }
 
Quoted 4 lines

qapi/migration.json line 839

Quoted 2 lines
qapi/migration.json +0 -0
 ##
 # @query-migrate-parameters:

Since you're tidying up whitespace, consider expanding the tab.

I'd removed that cleanup based on another review.

Quoted 2 lines

With the superfluous hunk dropped, QAPI part

Thanks,

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#9 lore raw

PATCH 3/9 virtio-net: Switch to using announce timer

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Switch virtio's self announcement to use the AnnounceTimer. It keeps it's own AnnounceTimer (per device), and starts running it using a migration post-load and a virtual clock; that way the announce happens once the guest is actually running.
The timer uses the migration parameters to set the timing of the repeats.

Based on earlier patches by myself and
Vladislav Yasevich <[email protected]>

---
 hw/net/trace-events            |  7 +++++++
 hw/net/virtio-net.c            | 36 ++++++++++++++++++++++------------
 include/hw/virtio/virtio-net.h |  4 ++--
 3 files changed, 32 insertions(+), 15 deletions(-)
hw/net/trace-events +7 -0
index 9d49f62fa1..fc800dd606 100644
@@ -359,3 +359,10 @@ sunhme_rx_filter_reject(void) "rejecting incoming frame"
 sunhme_rx_filter_accept(void) "accepting incoming frame"
 sunhme_rx_desc(uint32_t addr, int offset, uint32_t status, int len, int cr, int nr) "addr 0x%"PRIx32"(+0x%x) status 0x%"PRIx32 " len %d (ring %d/%d)"
 sunhme_rx_xsum_calc(uint16_t xsum) "calculated incoming xsum as 0x%x"
+
+# hw/net/virtio-net.c
+virtio_net_announce_timer(int round) "%d"
+virtio_net_handle_announce(int round) "%d"
+virtio_net_post_load_device(void)
+
+
hw/net/virtio-net.c +23 -13
index 3f319ef723..b50f86d230 100644
@@ -21,12 +21,14 @@
 #include "qemu/timer.h"
 #include "hw/virtio/virtio-net.h"
 #include "net/vhost_net.h"
+#include "net/announce.h"
 #include "hw/virtio/virtio-bus.h"
 #include "qapi/error.h"
 #include "qapi/qapi-events-net.h"
 #include "hw/virtio/virtio-access.h"
 #include "migration/misc.h"
 #include "standard-headers/linux/ethtool.h"
+#include "trace.h"
 
 #define VIRTIO_NET_VM_VERSION    11
 
@@ -164,8 +166,9 @@ static void virtio_net_announce_timer(void *opaque)
 {
     VirtIONet *n = opaque;
     VirtIODevice *vdev = VIRTIO_DEVICE(n);
+    trace_virtio_net_announce_timer(n->announce_timer.round);
 
-    n->announce_counter--;
+    n->announce_timer.round--;
     n->status |= VIRTIO_NET_S_ANNOUNCE;
     virtio_notify_config(vdev);
 }
@@ -479,8 +482,8 @@ static void virtio_net_reset(VirtIODevice *vdev)
     n->nobcast = 0;
     /* multiqueue is disabled by default */
     n->curr_queues = 1;
-    timer_del(n->announce_timer);
-    n->announce_counter = 0;
+    timer_del(n->announce_timer.tm);
+    n->announce_timer.round = 0;
     n->status &= ~VIRTIO_NET_S_ANNOUNCE;
 
     /* Flush any MAC and VLAN filter table state */
@@ -976,13 +979,12 @@ static int virtio_net_handle_vlan_table(VirtIONet *n, uint8_t cmd,
 static int virtio_net_handle_announce(VirtIONet *n, uint8_t cmd,
                                       struct iovec *iov, unsigned int iov_cnt)
 {
+    trace_virtio_net_handle_announce(n->announce_timer.round);
     if (cmd == VIRTIO_NET_CTRL_ANNOUNCE_ACK &&
         n->status & VIRTIO_NET_S_ANNOUNCE) {
         n->status &= ~VIRTIO_NET_S_ANNOUNCE;
-        if (n->announce_counter) {
-            timer_mod(n->announce_timer,
-                      qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) +
-                      self_announce_delay(n->announce_counter));
+        if (n->announce_timer.round) {
+            qemu_announce_timer_step(&n->announce_timer);
         }
         return VIRTIO_NET_OK;
     } else {
@@ -2298,6 +2300,7 @@ static int virtio_net_post_load_device(void *opaque, int version_id)
     VirtIODevice *vdev = VIRTIO_DEVICE(n);
     int i, link_down;
 
+    trace_virtio_net_post_load_device();
     virtio_net_set_mrg_rx_bufs(n, n->mergeable_rx_bufs,
                                virtio_vdev_has_feature(vdev,
                                                        VIRTIO_F_VERSION_1));
@@ -2334,8 +2337,15 @@ static int virtio_net_post_load_device(void *opaque, int version_id)
 
     if (virtio_vdev_has_feature(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE) &&
         virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) {
-        n->announce_counter = SELF_ANNOUNCE_ROUNDS;
-        timer_mod(n->announce_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL));
+        qemu_announce_timer_reset(&n->announce_timer, migrate_announce_params(),
+                                  QEMU_CLOCK_VIRTUAL,
+                                  virtio_net_announce_timer, n);
+        if (n->announce_timer.round) {
+            timer_mod(n->announce_timer.tm,
+                      qemu_clock_get_ms(n->announce_timer.type));
+        } else {
+            qemu_announce_timer_del(&n->announce_timer);
+        }
     }
 
     return 0;
@@ -2696,8 +2706,9 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
     qemu_macaddr_default_if_unset(&n->nic_conf.macaddr);
     memcpy(&n->mac[0], &n->nic_conf.macaddr, sizeof(n->mac));
     n->status = VIRTIO_NET_S_LINK_UP;
-    n->announce_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL,
-                                     virtio_net_announce_timer, n);
+    qemu_announce_timer_reset(&n->announce_timer, migrate_announce_params(),
+                              QEMU_CLOCK_VIRTUAL,
+                              virtio_net_announce_timer, n);
 
     if (n->netclient_type) {
         /*
@@ -2760,8 +2771,7 @@ static void virtio_net_device_unrealize(DeviceState *dev, Error **errp)
         virtio_net_del_queue(n, i);
     }
 
-    timer_del(n->announce_timer);
-    timer_free(n->announce_timer);
+    qemu_announce_timer_del(&n->announce_timer);
     g_free(n->vqs);
     qemu_del_nic(n->nic);
     virtio_net_rsc_cleanup(n);
include/hw/virtio/virtio-net.h +2 -2
index a1a0be3bea..b96f0c643f 100644
@@ -17,6 +17,7 @@
 #include "qemu/units.h"
 #include "standard-headers/linux/virtio_net.h"
 #include "hw/virtio/virtio.h"
+#include "net/announce.h"
 
 #define TYPE_VIRTIO_NET "virtio-net-device"
 #define VIRTIO_NET(obj) \
@@ -181,8 +182,7 @@ struct VirtIONet {
     char *netclient_name;
     char *netclient_type;
     uint64_t curr_guest_offloads;
-    QEMUTimer *announce_timer;
-    int announce_counter;
+    AnnounceTimer announce_timer;
     bool needs_vnet_hdr_swap;
     bool mtu_bypass_backend;
 };
Signature · 1 line
2.20.1
#10 lore raw

PATCH 4/9 migration: Switch to using announce timer

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Switch the announcements to using the new announce timer. Move the code that does it to announce.c rather than savevm because it really has nothing to do with the actual migration.

Migration starts the announce from bh's and so they're all in the main thread/bql, and so there's never any racing with the timers themselves.

---
 include/migration/misc.h | 10 ------
 include/net/announce.h   |  2 ++
 include/sysemu/sysemu.h  |  2 --
 migration/migration.c    |  2 +-
 migration/migration.h    |  4 +++
 migration/savevm.c       | 72 ++--------------------------------------
 migration/trace-events   |  1 -
 net/announce.c           | 67 +++++++++++++++++++++++++++++++++++++
 net/trace-events         |  4 +++
 9 files changed, 81 insertions(+), 83 deletions(-)
include/migration/misc.h +0 -10
index e837ab3042..0471e04d1f 100644
@@ -29,16 +29,6 @@ void blk_mig_init(void);
 static inline void blk_mig_init(void) {}
 #endif
 
-#define SELF_ANNOUNCE_ROUNDS 5
-
-static inline
-int64_t self_announce_delay(int round)
-{
-    assert(round < SELF_ANNOUNCE_ROUNDS && round > 0);
-    /* delay 50ms, 150ms, 250ms, ... */
-    return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
-}
-
 AnnounceParameters *migrate_announce_params(void);
 /* migration/savevm.c */
 
include/net/announce.h +2 -0
index b89f1c28b5..892d302b65 100644
@@ -36,4 +36,6 @@ void qemu_announce_timer_reset(AnnounceTimer *timer,
                                QEMUTimerCB *cb,
                                void *opaque);
 
+void qemu_announce_self(AnnounceTimer *timer, AnnounceParameters *params);
+
 #endif
include/sysemu/sysemu.h +0 -2
index 85877b7e43..e322e696f2 100644
@@ -81,8 +81,6 @@ extern bool machine_init_done;
 void qemu_add_machine_init_done_notifier(Notifier *notify);
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
 
-void qemu_announce_self(void);
-
 extern int autostart;
 
 typedef enum {
migration/migration.c +1 -1
index ca9c35a5cd..c39d3054ec 100644
@@ -374,7 +374,7 @@ static void process_incoming_migration_bh(void *opaque)
      * This must happen after all error conditions are dealt with and
      * we're sure the VM is going to be running on this host.
      */
-    qemu_announce_self();
+    qemu_announce_self(&mis->announce_timer, migrate_announce_params());
 
     if (multifd_load_cleanup(&local_err) != 0) {
         error_report_err(local_err);
migration/migration.h +4 -0
index dcd05d9f87..c99154dea2 100644
@@ -21,6 +21,7 @@
 #include "qemu/coroutine_int.h"
 #include "hw/qdev.h"
 #include "io/channel.h"
+#include "net/announce.h"
 
 struct PostcopyBlocktimeContext;
 
@@ -36,6 +37,9 @@ struct MigrationIncomingState {
      */
     QemuEvent main_thread_load_event;
 
+    /* For network announces */
+    AnnounceTimer  announce_timer;
+
     size_t         largest_page_size;
     bool           have_fault_thread;
     QemuThread     fault_thread;
migration/savevm.c +3 -69

96 lines not on this page · raw message

migration/trace-events +0 -1
index bd2d0cd25a..72e3fcb885 100644
@@ -52,7 +52,6 @@ vmstate_save_state_top(const char *idstr) "%s"
 vmstate_subsection_save_loop(const char *name, const char *sub) "%s/%s"
 vmstate_subsection_save_top(const char *idstr) "%s"
 vmstate_load(const char *idstr, const char *vmsd_name) "%s, %s"
-qemu_announce_self_iter(const char *mac) "%s"
 
 # migration/vmstate.c
 vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d"
net/announce.c +67 -0

78 lines not on this page · raw message

net/trace-events +4 -0
index 7b594cfdd2..7effa62787 100644
@@ -1,5 +1,8 @@
 # See docs/devel/tracing.txt for syntax documentation.
 
+# net/announce.c
+qemu_announce_self_iter(const char *mac) "%s"
+
 # net/vhost-user.c
 vhost_user_event(const char *chr, int event) "chr: %s got event: %d"
 
@@ -19,3 +22,4 @@ colo_compare_tcp_info(const char *pkt, uint32_t seq, uint32_t ack, int hdlen, in
 colo_filter_rewriter_debug(void) ""
 colo_filter_rewriter_pkt_info(const char *func, const char *src, const char *dst, uint32_t seq, uint32_t ack, uint32_t flag) "%s: src/dst: %s/%s p: seq/ack=%u/%u  flags=0x%x\n"
 colo_filter_rewriter_conn_offset(uint32_t offset) ": offset=%u\n"
+
Signature · 1 line
2.20.1
#11 lore raw

PATCH 5/9 net: Add a network device specific self-announcement ability

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Some network devices have a capability to do self announcements (ex: virtio-net). Add infrastructure that would allow devices to expose this ability.

---
 include/net/net.h | 2 ++
 net/announce.c    | 5 +++++
 2 files changed, 7 insertions(+)
include/net/net.h +2 -0
index 643295d163..f888cc3019 100644
@@ -60,6 +60,7 @@ typedef int (SetVnetLE)(NetClientState *, bool);
 typedef int (SetVnetBE)(NetClientState *, bool);
 typedef struct SocketReadState SocketReadState;
 typedef void (SocketReadStateFinalize)(SocketReadState *rs);
+typedef void (NetAnnounce)(NetClientState *);
 
 typedef struct NetClientInfo {
     NetClientDriver type;
@@ -80,6 +81,7 @@ typedef struct NetClientInfo {
     SetVnetHdrLen *set_vnet_hdr_len;
     SetVnetLE *set_vnet_le;
     SetVnetBE *set_vnet_be;
+    NetAnnounce *announce;
 } NetClientInfo;
 
 struct NetClientState {
net/announce.c +5 -0
index 13ad9c2ba8..070f37a7fa 100644
@@ -102,6 +102,11 @@ static void qemu_announce_self_iter(NICState *nic, void *opaque)
     len = announce_self_create(buf, nic->conf->macaddr.a);
 
     qemu_send_packet_raw(qemu_get_queue(nic), buf, len);
+
+    /* if the NIC provides it's own announcement support, use it as well */
+    if (nic->ncs->info->announce) {
+        nic->ncs->info->announce(nic->ncs);
+    }
 }
 static void qemu_announce_self_once(void *opaque)
 {
Signature · 1 line
2.20.1
#12 lore raw

PATCH 6/9 virtio-net: Allow qemu_announce_self to trigger virtio announcements

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Expose the virtio-net self announcement capability and allow qemu_announce_self() to call it.

These announces are caused by something external (i.e. the announce-self command); they won't trigger if the migration counter is triggering announces at the same time.

---
 hw/net/trace-events |  1 +
 hw/net/virtio-net.c | 35 ++++++++++++++++++++++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
hw/net/trace-events +1 -0
index fc800dd606..b419d0b1a7 100644
@@ -361,6 +361,7 @@ sunhme_rx_desc(uint32_t addr, int offset, uint32_t status, int len, int cr, int
 sunhme_rx_xsum_calc(uint16_t xsum) "calculated incoming xsum as 0x%x"
 
 # hw/net/virtio-net.c
+virtio_net_announce_notify(void) ""
 virtio_net_announce_timer(int round) "%d"
 virtio_net_handle_announce(int round) "%d"
 virtio_net_post_load_device(void)
hw/net/virtio-net.c +32 -3
index b50f86d230..ed0fa97b88 100644
@@ -162,15 +162,42 @@ static bool virtio_net_started(VirtIONet *n, uint8_t status)
         (n->status & VIRTIO_NET_S_LINK_UP) && vdev->vm_running;
 }
 
+static void virtio_net_announce_notify(VirtIONet *net)
+{
+    VirtIODevice *vdev = VIRTIO_DEVICE(net);
+    trace_virtio_net_announce_notify();
+
+    net->status |= VIRTIO_NET_S_ANNOUNCE;
+    virtio_notify_config(vdev);
+}
+
 static void virtio_net_announce_timer(void *opaque)
 {
     VirtIONet *n = opaque;
-    VirtIODevice *vdev = VIRTIO_DEVICE(n);
     trace_virtio_net_announce_timer(n->announce_timer.round);
 
     n->announce_timer.round--;
-    n->status |= VIRTIO_NET_S_ANNOUNCE;
-    virtio_notify_config(vdev);
+    virtio_net_announce_notify(n);
+}
+
+static void virtio_net_announce(NetClientState *nc)
+{
+    VirtIONet *n = qemu_get_nic_opaque(nc);
+    VirtIODevice *vdev = VIRTIO_DEVICE(n);
+
+    /*
+     * Make sure the virtio migration announcement timer isn't running
+     * If it is, let it trigger announcement so that we do not cause
+     * confusion.
+     */
+    if (n->announce_timer.round) {
+        return;
+    }
+
+    if (virtio_vdev_has_feature(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE) &&
+        virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) {
+            virtio_net_announce_notify(n);
+    }
 }
 
 static void virtio_net_vhost_status(VirtIONet *n, uint8_t status)
@@ -2568,6 +2595,7 @@ static NetClientInfo net_virtio_info = {
     .receive = virtio_net_receive,
     .link_status_changed = virtio_net_set_link_status,
     .query_rx_filter = virtio_net_query_rxfilter,
+    .announce = virtio_net_announce,
 };
 
 static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)
@@ -2709,6 +2737,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
     qemu_announce_timer_reset(&n->announce_timer, migrate_announce_params(),
                               QEMU_CLOCK_VIRTUAL,
                               virtio_net_announce_timer, n);
+    n->announce_timer.round = 0;
 
     if (n->netclient_type) {
         /*
Signature · 1 line
2.20.1
#13 lore raw

PATCH 7/9 qmp: Add announce-self command

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add a qmp command that can trigger guest announcements.

It uses it's own announce-timer instance, and parameters passed to it explicitly in the command.

Like most qmp commands, it's in the main thread/bql, so there's no racing with any outstanding timer.

Based on work of Germano Veit Michel <[email protected]> and
Vladislav Yasevich <[email protected]>

---
 net/announce.c |  8 ++++++++
 qapi/net.json  | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)
net/announce.c +8 -0
index 070f37a7fa..8cd9f4d909 100644
@@ -12,6 +12,7 @@
 #include "net/net.h"
 #include "qapi/clone-visitor.h"
 #include "qapi/qapi-visit-net.h"
+#include "qapi/qapi-commands-net.h"
 #include "trace.h"
 
 int64_t qemu_announce_timer_step(AnnounceTimer *timer)
@@ -131,3 +132,10 @@ void qemu_announce_self(AnnounceTimer *timer, AnnounceParameters *params)
         qemu_announce_timer_del(timer);
     }
 }
+
+void qmp_announce_self(AnnounceParameters *params, Error **errp)
+{
+    static AnnounceTimer announce_timer;
+    qemu_announce_self(&announce_timer, params);
+}
+
qapi/net.json +20 -0
index b9ff7617bd..fe1640448b 100644
@@ -707,3 +707,23 @@
             'max': 'int',
             'rounds': 'int',
             'step': 'int' } }
+
+##
+# @announce-self:
+#
+# Trigger generation of broadcast RARP frames to update network switches.
+# This can be useful when network bonds fail-over the active slave.
+#
+# @params: AnnounceParameters giving timing and repetition count of announce
+#
+# Example:
+#
+# -> { "execute": "announce-self"
+#      "arguments": { "initial": 50, "max": 550, "rounds": 10, "step": 50 } }
+# <- { "return": {} }
+#
+# Since: 4.0
+##
+{ 'command': 'announce-self',
+  'data' : {'params': 'AnnounceParameters'} }
+
Signature · 1 line
2.20.1
#14 lore raw

Re: [Qemu-devel] [PATCH 7/9] qmp: Add announce-self command

Quoted 5 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add a qmp command that can trigger guest announcements.

It uses it's own announce-timer instance, and parameters

s/it's/its/ (here, you want the possessive form without apostrophe; the contraction form is correct only when you can use "it is" in the same place)

Quoted 3 lines

passed to it explicitly in the command.

Like most qmp commands, it's in the main thread/bql, so

Here, "it's" is correct.

Quoted 20 lines

there's no racing with any outstanding timer.

Based on work of Germano Veit Michel <[email protected]> and
Vladislav Yasevich <[email protected]>

---
 net/announce.c |  8 ++++++++
 qapi/net.json  | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)

+++ b/qapi/net.json

qapi/net.json +3 -0
@@ -707,3 +707,23 @@
             'max': 'int',
             'rounds': 'int',
             'step': 'int' } }
+
+##
+# @announce-self:

qapi/net.json line 722

Quoted 10 lines
qapi/net.json +10 -0
+#
+# Trigger generation of broadcast RARP frames to update network switches.
+# This can be useful when network bonds fail-over the active slave.
+#
+# @params: AnnounceParameters giving timing and repetition count of announce
+#
+# Example:
+#
+# -> { "execute": "announce-self"
+#      "arguments": { "initial": 50, "max": 550, "rounds": 10, "step": 50 } }

Again, can any of these have useful defaults to be left optional?

Quoted 8 lines
qapi/net.json +7 -0
+# <- { "return": {} }
+#
+# Since: 4.0
+##
+{ 'command': 'announce-self',
+  'data' : {'params': 'AnnounceParameters'} }
+
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#15 lore raw

Re: [Qemu-devel] [PATCH 7/9] qmp: Add announce-self command

Quoted 9 lines · * Eric Blake ([email protected]) wrote:
Quoted 5 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add a qmp command that can trigger guest announcements.

It uses it's own announce-timer instance, and parameters

s/it's/its/ (here, you want the possessive form without apostrophe; the contraction form is correct only when you can use "it is" in the same place)

' removed

Quoted 30 lines
Quoted 3 lines

passed to it explicitly in the command.

Like most qmp commands, it's in the main thread/bql, so

Here, "it's" is correct.

Quoted 24 lines

there's no racing with any outstanding timer.

Based on work of Germano Veit Michel <[email protected]> and
Vladislav Yasevich <[email protected]>

---
 net/announce.c |  8 ++++++++
 qapi/net.json  | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)

+++ b/qapi/net.json

qapi/net.json +7 -0
@@ -707,3 +707,23 @@
             'max': 'int',
             'rounds': 'int',
             'step': 'int' } }
+
+##
+# @announce-self:
+#
+# Trigger generation of broadcast RARP frames to update network switches.
+# This can be useful when network bonds fail-over the active slave.
+#
Quoted 8 lines

qapi/net.json line 722

Quoted 6 lines
qapi/net.json +6 -0
+# @params: AnnounceParameters giving timing and repetition count of announce
+#
+# Example:
+#
+# -> { "execute": "announce-self"
+#      "arguments": { "initial": 50, "max": 550, "rounds": 10, "step": 50 } }

Again, can any of these have useful defaults to be left optional?

Nope, you have to state what you want fully. However, that line is actually wrong, it should be:
# -> { "execute": "announce-self"
# "arguments": { "params:" {
# "initial": 50, "max": 550, "rounds": 10, "step": 50 } } }

(As I found when I wrote the test).
I've fixed that up.

Dave

Quoted 14 lines
Quoted 8 lines
qapi/net.json +7 -0
+# <- { "return": {} }
+#
+# Since: 4.0
+##
+{ 'command': 'announce-self',
+  'data' : {'params': 'AnnounceParameters'} }
+
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#16 lore raw

PATCH 8/9 hmp: Add hmp_announce_self

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add an HMP command to trigger self annocements.
Unlike the QMP command (which takes a set of parameters), the HMP command reuses the set of parameters used for migration.

---
 hmp-commands.hx  | 14 ++++++++++++++
 hmp.c            |  5 +++++
 hmp.h            |  1 +
 tests/test-hmp.c |  1 +
 4 files changed, 21 insertions(+)
hmp-commands.hx +14 -0
index ba71558c25..9f812bc63b 100644
@@ -928,6 +928,20 @@ Bug: can screw up when the buffer contains invalid UTF-8 sequences,
 NUL characters, after the ring buffer lost data, and when reading
 stops because the size limit is reached.
 
+ETEXI
+
+    {
+        .name       = "announce_self",
+        .args_type  = "",
+        .params     = "",
+        .help       = "Trigger GARP/RARP announcements",
+        .cmd        = hmp_announce_self,
+    },
+
+STEXI
+@item announce_self
+@findex announce_self
+Trigger GARP/RARP announcements.
 ETEXI
 
     {
hmp.c +5 -0
index 319f5134cd..ccaa817ecd 100644
@@ -1570,6 +1570,11 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
 
 }
 
+void hmp_announce_self(Monitor *mon, const QDict *qdict)
+{
+    qmp_announce_self(migrate_announce_params(), NULL);
+}
+
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
 {
     qmp_migrate_cancel(NULL);
hmp.h +1 -0
index 5f1addcca2..e0f32f04d3 100644
@@ -46,6 +46,7 @@ void hmp_sync_profile(Monitor *mon, const QDict *qdict);
 void hmp_system_reset(Monitor *mon, const QDict *qdict);
 void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
 void hmp_exit_preconfig(Monitor *mon, const QDict *qdict);
+void hmp_announce_self(Monitor *mon, const QDict *qdict);
 void hmp_cpu(Monitor *mon, const QDict *qdict);
 void hmp_memsave(Monitor *mon, const QDict *qdict);
 void hmp_pmemsave(Monitor *mon, const QDict *qdict);
tests/test-hmp.c +1 -0
index 1a3a9c5099..8c49d2fdf1 100644
@@ -20,6 +20,7 @@
 static int verbose;
 
 static const char *hmp_cmds[] = {
+    "announce_self",
     "boot_set ndc",
     "chardev-add null,id=testchardev1",
     "chardev-send-break testchardev1",
Signature · 1 line
2.20.1
#17 lore raw

PATCH 9/9 tests: Add a test for qemu self announcments

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

We now expose qemu_announce_self through QMP and HMP. Add a test with some very basic packet validation (make sure we get a RARP).

---
 tests/Makefile.include     |  2 +
 tests/test-announce-self.c | 83 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 tests/test-announce-self.c
tests/Makefile.include +2 -0
index 19b4c0a696..57ce722d73 100644
@@ -143,6 +143,8 @@ check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF)
 
 check-qtest-generic-y += tests/device-introspect-test$(EXESUF)
 check-qtest-generic-y += tests/cdrom-test$(EXESUF)
+check-qtest-generic-y += tests/test-announce-self$(EXESUF)
+gcov-files-generic-y = migration/savevm.c
 
 check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
 
tests/test-announce-self.c new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
2.20.1
#18 lore raw

Re: [Qemu-devel] [PATCH 9/9] tests: Add a test for qemu self announcments

Quoted 7 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

We now expose qemu_announce_self through QMP and HMP. Add a test with some very basic packet validation (make sure we get a RARP).

typo in subject

Quoted 110 lines
---
 tests/Makefile.include     |  2 +
 tests/test-announce-self.c | 83 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 tests/test-announce-self.c
tests/Makefile.include +2 -0
index 19b4c0a696..57ce722d73 100644
@@ -143,6 +143,8 @@ check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF)
 
 check-qtest-generic-y += tests/device-introspect-test$(EXESUF)
 check-qtest-generic-y += tests/cdrom-test$(EXESUF)
+check-qtest-generic-y += tests/test-announce-self$(EXESUF)
+gcov-files-generic-y = migration/savevm.c
 
 check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
 
tests/test-announce-self.c new file +83 -0
new file mode 100644
index 0000000000..2ff0c77255
@@ -0,0 +1,83 @@
+/*
+ * QTest testcase for qemu_announce_self
+ *
+ * Copyright (c) 2017 Red hat, Inc.
+ * Copyright (c) 2014 SUSE LINUX Products GmbH
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "libqtest.h"
+#include "qapi/qmp/qdict.h"
+#include "qemu-common.h"
+#include "qemu/sockets.h"
+#include "qemu/iov.h"
+#include "libqos/libqos-pc.h"
+#include "libqos/libqos-spapr.h"
+
+#ifndef ETH_P_RARP
+#define ETH_P_RARP 0x8035
+#endif
+
+static QTestState *test_init(int socket)
+{
+    char *args;
+
+    args = g_strdup_printf("-netdev socket,fd=%d,id=hs0 -device "
+                           "virtio-net-pci,netdev=hs0", socket);
+
+    return qtest_start(args);
+}
+
+
+static void test_announce(int socket)
+{
+    char buffer[60];
+    int len;
+    QDict *rsp;
+    int ret;
+    uint16_t *proto = (uint16_t *)&buffer[12];
+
+    rsp = qmp("{ 'execute' : 'announce-self', "
+                  " 'arguments': {"
+                      " 'params': {"
+                          " 'initial': 50, 'max': 550,"
+                          " 'rounds': 10, 'step': 50 } } }");
+    assert(!qdict_haskey(rsp, "error"));
+    qobject_unref(rsp);
+
+    /* Catch the packet and make sure it's a RARP */
+    ret = qemu_recv(socket, &len, sizeof(len), 0);
+    g_assert_cmpint(ret, ==,  sizeof(len));
+    len = ntohl(len);
+
+    ret = qemu_recv(socket, buffer, len, 0);
+    g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
+}
+
+static void setup(gconstpointer data)
+{
+    QTestState *qs;
+    void (*func) (int socket) = data;
+    int sv[2], ret;
+
+    ret = socketpair(PF_UNIX, SOCK_STREAM, 0, sv);
+    g_assert_cmpint(ret, !=, -1);
+
+    qs = test_init(sv[1]);
+    func(sv[0]);
+
+    /* End test */
+    close(sv[0]);
+    qtest_quit(qs);
+}
+
+int main(int argc, char **argv)
+{
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_data_func("/virtio/net/test_announce_self", test_announce, setup);
+
+    return g_test_run();
+}
Signature · 1 line
2.20.1
#19 lore raw

Re: [Qemu-devel] [PATCH 9/9] tests: Add a test for qemu self announcments

Quoted 10 lines · * Michael S. Tsirkin ([email protected]) wrote:
Quoted 7 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

We now expose qemu_announce_self through QMP and HMP. Add a test with some very basic packet validation (make sure we get a RARP).

typo in subject

Thanks, fixed.

Dave

Quoted 102 lines
Quoted 102 lines
---
 tests/Makefile.include     |  2 +
 tests/test-announce-self.c | 83 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 tests/test-announce-self.c
tests/Makefile.include +2 -0
index 19b4c0a696..57ce722d73 100644
@@ -143,6 +143,8 @@ check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF)
 
 check-qtest-generic-y += tests/device-introspect-test$(EXESUF)
 check-qtest-generic-y += tests/cdrom-test$(EXESUF)
+check-qtest-generic-y += tests/test-announce-self$(EXESUF)
+gcov-files-generic-y = migration/savevm.c
 
 check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
 
tests/test-announce-self.c new file +77 -0
new file mode 100644
index 0000000000..2ff0c77255
@@ -0,0 +1,83 @@
+/*
+ * QTest testcase for qemu_announce_self
+ *
+ * Copyright (c) 2017 Red hat, Inc.
+ * Copyright (c) 2014 SUSE LINUX Products GmbH
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "libqtest.h"
+#include "qapi/qmp/qdict.h"
+#include "qemu-common.h"
+#include "qemu/sockets.h"
+#include "qemu/iov.h"
+#include "libqos/libqos-pc.h"
+#include "libqos/libqos-spapr.h"
+
+#ifndef ETH_P_RARP
+#define ETH_P_RARP 0x8035
+#endif
+
+static QTestState *test_init(int socket)
+{
+    char *args;
+
+    args = g_strdup_printf("-netdev socket,fd=%d,id=hs0 -device "
+                           "virtio-net-pci,netdev=hs0", socket);
+
+    return qtest_start(args);
+}
+
+
+static void test_announce(int socket)
+{
+    char buffer[60];
+    int len;
+    QDict *rsp;
+    int ret;
+    uint16_t *proto = (uint16_t *)&buffer[12];
+
+    rsp = qmp("{ 'execute' : 'announce-self', "
+                  " 'arguments': {"
+                      " 'params': {"
+                          " 'initial': 50, 'max': 550,"
+                          " 'rounds': 10, 'step': 50 } } }");
+    assert(!qdict_haskey(rsp, "error"));
+    qobject_unref(rsp);
+
+    /* Catch the packet and make sure it's a RARP */
+    ret = qemu_recv(socket, &len, sizeof(len), 0);
+    g_assert_cmpint(ret, ==,  sizeof(len));
+    len = ntohl(len);
+
+    ret = qemu_recv(socket, buffer, len, 0);
+    g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
+}
+
+static void setup(gconstpointer data)
+{
+    QTestState *qs;
+    void (*func) (int socket) = data;
+    int sv[2], ret;
+
+    ret = socketpair(PF_UNIX, SOCK_STREAM, 0, sv);
+    g_assert_cmpint(ret, !=, -1);
+
+    qs = test_init(sv[1]);
+    func(sv[0]);
+
+    /* End test */
+    close(sv[0]);
+    qtest_quit(qs);
+}
+
+int main(int argc, char **argv)
Quoted 8 lines
Quoted 8 lines
tests/test-announce-self.c new file +6 -0
+{
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_data_func("/virtio/net/test_announce_self", test_announce, setup);
+
+    return g_test_run();
+}
Signature · 1 line
2.20.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on the v1 series
#20 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 16 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a reworking of a few sets of patches from 2017
that were put together by myself, Germano and Vlad that make the network announce system more flexible.

Firstly, it's parameterised, so that you can change the number
of packets and the gap between them; the number can be set to 0 to disable announce completely.

Secondly, you can force an announce by a qmp or hmp command at
any time. This is useful if you need the guest to do an announce for a different reason; for example if the management layer has just juggled some bonding configuration around.

Quoted 6 lines

The packet creation and timing also moves to net/ from migration/

The previous set was:

     https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05594.html

Dave

Who's applying this? Jason?

Quoted 41 lines

Dr. David Alan Gilbert (9):
net: Introduce announce timer
migration: Add announce parameters
virtio-net: Switch to using announce timer
migration: Switch to using announce timer
net: Add a network device specific self-announcement ability
virtio-net: Allow qemu_announce_self to trigger virtio announcements
qmp: Add announce-self command
hmp: Add hmp_announce_self
tests: Add a test for qemu self announcments

 hmp-commands.hx                |  14 ++++
 hmp.c                          |  33 ++++++++
 hmp.h                          |   1 +
 hw/net/trace-events            |   8 ++
 hw/net/virtio-net.c            |  69 ++++++++++++----
 include/hw/virtio/virtio-net.h |   4 +-
 include/migration/misc.h       |  12 +--
 include/net/announce.h         |  41 ++++++++++
 include/net/net.h              |   2 +
 include/qemu/typedefs.h        |   2 +
 include/sysemu/sysemu.h        |   2 -
 migration/migration.c          | 103 +++++++++++++++++++++++-
 migration/migration.h          |   4 +
 migration/savevm.c             |  72 +----------------
 migration/trace-events         |   1 -
 net/Makefile.objs              |   1 +
 net/announce.c                 | 141 +++++++++++++++++++++++++++++++++
 net/trace-events               |   4 +
 qapi/migration.json            |  56 ++++++++++++-
 qapi/net.json                  |  43 ++++++++++
 tests/Makefile.include         |   2 +
 tests/test-announce-self.c     |  83 +++++++++++++++++++
 tests/test-hmp.c               |   1 +
 23 files changed, 595 insertions(+), 104 deletions(-)
 create mode 100644 include/net/announce.h
 create mode 100644 net/announce.c
 create mode 100644 tests/test-announce-self.c
Signature · 1 line
2.20.1
#21 lore raw
Quoted 19 lines · * Michael S. Tsirkin ([email protected]) wrote:
Quoted 18 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
This is a reworking of a few sets of patches from 2017
that were put together by myself, Germano and Vlad that make the network announce system more flexible.

Firstly, it's parameterised, so that you can change the number
of packets and the gap between them; the number can be set to 0 to disable announce completely.

Secondly, you can force an announce by a qmp or hmp command at
any time. This is useful if you need the guest to do an announce for a different reason; for example if the management layer has just juggled some bonding configuration around.

The packet creation and timing also moves to net/ from migration/

Quoted 8 lines
Quoted 4 lines

The previous set was:

     https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05594.html

Dave

Who's applying this? Jason?

That would seem most appropriate.

Dave

Quoted 40 lines
Quoted 40 lines

Dr. David Alan Gilbert (9):
net: Introduce announce timer
migration: Add announce parameters
virtio-net: Switch to using announce timer
migration: Switch to using announce timer
net: Add a network device specific self-announcement ability
virtio-net: Allow qemu_announce_self to trigger virtio announcements
qmp: Add announce-self command
hmp: Add hmp_announce_self
tests: Add a test for qemu self announcments

 hmp-commands.hx                |  14 ++++
 hmp.c                          |  33 ++++++++
 hmp.h                          |   1 +
 hw/net/trace-events            |   8 ++
 hw/net/virtio-net.c            |  69 ++++++++++++----
 include/hw/virtio/virtio-net.h |   4 +-
 include/migration/misc.h       |  12 +--
 include/net/announce.h         |  41 ++++++++++
 include/net/net.h              |   2 +
 include/qemu/typedefs.h        |   2 +
 include/sysemu/sysemu.h        |   2 -
 migration/migration.c          | 103 +++++++++++++++++++++++-
 migration/migration.h          |   4 +
 migration/savevm.c             |  72 +----------------
 migration/trace-events         |   1 -
 net/Makefile.objs              |   1 +
 net/announce.c                 | 141 +++++++++++++++++++++++++++++++++
 net/trace-events               |   4 +
 qapi/migration.json            |  56 ++++++++++++-
 qapi/net.json                  |  43 ++++++++++
 tests/Makefile.include         |   2 +
 tests/test-announce-self.c     |  83 +++++++++++++++++++
 tests/test-hmp.c               |   1 +
 23 files changed, 595 insertions(+), 104 deletions(-)
 create mode 100644 include/net/announce.h
 create mode 100644 net/announce.c
 create mode 100644 tests/test-announce-self.c
Quoted 2 lines
Quoted 2 lines
Signature · 1 line
2.20.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#22 lore raw
In reply to Dr. David Alan Gilbert (git)

git-am gripes:

Applying: net: Introduce announce timer .git/rebase-apply/patch:159: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: migration: Add announce parameters
Applying: virtio-net: Switch to using announce timer .git/rebase-apply/patch:20: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: migration: Switch to using announce timer .git/rebase-apply/patch:309: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: net: Add a network device specific self-announcement ability
Applying: virtio-net: Allow qemu_announce_self to trigger virtio announcements
Applying: qmp: Add announce-self command .git/rebase-apply/patch:28: new blank line at EOF.
+
.git/rebase-apply/patch:56: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Applying: hmp: Add hmp_announce_self
Applying: tests: Add a test for qemu self announcments

#23 lore raw
Quoted 1 line · * Markus Armbruster ([email protected]) wrote:

git-am gripes:

Thanks, fixed.

Dave

Quoted 15 lines

Applying: net: Introduce announce timer .git/rebase-apply/patch:159: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: migration: Add announce parameters
Applying: virtio-net: Switch to using announce timer .git/rebase-apply/patch:20: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: migration: Switch to using announce timer .git/rebase-apply/patch:309: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: net: Add a network device specific self-announcement ability
Applying: virtio-net: Allow qemu_announce_self to trigger virtio announcements

Quoted 8 lines

Applying: qmp: Add announce-self command .git/rebase-apply/patch:28: new blank line at EOF. +
.git/rebase-apply/patch:56: new blank line at EOF. +
warning: 2 lines add whitespace errors.
Applying: hmp: Add hmp_announce_self
Applying: tests: Add a test for qemu self announcments

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#24 lore raw
In reply to Dr. David Alan Gilbert (git)
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14 === TEST SCRIPT END ===

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=2.0
ERROR: unknown option --with-sdlabi=2.0
Try '/tmp/qemu-test/src/configure --help' for more information
# QEMU configure log Sun Feb 3 15:52:37 UTC 2019
# Configured with: '/tmp/qemu-test/src/configure' '--enable-werror' '--target-list=x86_64-softmmu,aarch64-softmmu' '--prefix=/tmp/qemu-test/install' '--python=/usr/bin/python3' '--cross-prefix=x86_64-w64-mingw32-' '--enable-trace-backends=simple' '--enable-gnutls' '--enable-nettle' '--enable-curl' '--enable-vnc' '--enable-bzip2' '--enable-guest-agent' '--with-sdlabi=2.0'
---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 634 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c
config-temp/qemu-conf.c:2:2: error: #error __linux__ not defined
#error __linux__ not defined
^~~~~

---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 686 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c config-temp/qemu-conf.c:2:2: error: #error __i386__ not defined
#error __i386__ not defined
^~~~~

---
funcs: do_compiler do_cc compile_object check_define main
lines: 92 122 617 689 0
x86_64-w64-mingw32-gcc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -c -o config-temp/qemu-conf.o config-temp/qemu-conf.c config-temp/qemu-conf.c:2:2: error: #error __ILP32__ not defined
#error __ILP32__ not defined
^~~~~

---
lines: 92 128 920 0
x86_64-w64-mingw32-gcc -mthreads -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -g -liberty /usr/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -liberty
collect2: error: ld returned 1 exit status
Failed to run 'configure'
Traceback (most recent call last):
File "./tests/docker/docker.py", line 563, in <module>

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]