From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>,
qemu-devel@nongnu.org, jasowang@redhat.com, armbru@redhat.com,
laine@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 3/4] net/announce: Add optional ID
Date: Mon, 10 Jun 2019 14:53:43 -0500 [thread overview]
Message-ID: <e602e259-f5db-c73a-7a4e-f63a2d48e85c@redhat.com> (raw)
In-Reply-To: <20190610184402.7090-4-dgilbert@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 3403 bytes --]
On 6/10/19 1:44 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Previously there was a single instance of the timer used by
> monitor triggered announces, that's OK, but when combined with the
> previous change that lets you have announces for subsets of interfaces
> it's a bit restrictive if you want to do different things to different
> interfaces.
>
> Add an 'id' field to the announce, and maintain a list of the
> timers based on id.
>
> This allows you to for example:
> a) Start an announce going on interface eth0 for a long time
> b) Start an announce going on interface eth1 for a long time
> c) Kill the announce on eth0 while leaving eth1 going.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> +++ b/include/net/announce.h
> @@ -23,8 +23,12 @@ struct AnnounceTimer {
> /* Returns: update the timer to the next time point */
> int64_t qemu_announce_timer_step(AnnounceTimer *timer);
>
> -/* Delete the underlying timer and other data */
> -void qemu_announce_timer_del(AnnounceTimer *timer);
> +/*
> + * Delete the underlying timer and other datas
'data' is already plural, 'datas' is not a word.
> + * If 'free_named' true and the timer is a named timer, then remove
> + * it from the list of named timers and free the AnnounceTimer itself.
> + */
> +void qemu_announce_timer_del(AnnounceTimer *timer, bool free_named);
>
> +++ b/qapi/net.json
> @@ -702,6 +702,10 @@
> # @interfaces: An optional list of interface names, which restrict the
> # announcment to the listed interfaces. (Since 4.1)
> #
> +# @id: A name to be used to identify an instance of announce-timers
> +# and to allow it to modified later. Not for use as
> +# part of the migration paramters. (Since 4.1)
parameters
> +#
> # Since: 4.0
> ##
>
> @@ -710,7 +714,8 @@
> 'max': 'int',
> 'rounds': 'int',
> 'step': 'int',
> - '*interfaces': ['str'] } }
> + '*interfaces': ['str'],
> + '*id' : 'str' } }
>
> ##
> # @announce-self:
> @@ -725,7 +730,7 @@
> # -> { "execute": "announce-self",
> # "arguments": {
> # "initial": 50, "max": 550, "rounds": 10, "step": 50,
> -# "interfaces": ["vn2","vn3"] } }
> +# "interfaces": ["vn2","vn3"], "id": "bob" } }
> # <- { "return": {} }
> #
Worth an example of deleting a timer by id?
> # Since: 4.0
> diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
> index 163126cf07..7184e2bff4 100644
> --- a/tests/virtio-net-test.c
> +++ b/tests/virtio-net-test.c
> @@ -186,7 +186,7 @@ static void announce_self(void *obj, void *data, QGuestAllocator *t_alloc)
> rsp = qmp("{ 'execute' : 'announce-self', "
> " 'arguments': {"
> " 'initial': 50, 'max': 550,"
> - " 'rounds': 10, 'step': 50 } }");
> + " 'rounds': 10, 'step': 50, 'id': 'bob' } }");
And here, is it worth testing that you can delete by id, rather than
just create with an id?
> assert(!qdict_haskey(rsp, "error"));
> qobject_unref(rsp);
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-06-10 19:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 18:43 [Qemu-devel] [PATCH v3 0/4] network announce; interface selection & IDs Dr. David Alan Gilbert (git)
2019-06-10 18:43 ` [Qemu-devel] [PATCH v3 1/4] net/announce: Allow optional list of interfaces Dr. David Alan Gilbert (git)
2019-06-10 19:47 ` Eric Blake
2019-06-11 10:36 ` Dr. David Alan Gilbert
2019-06-10 18:44 ` [Qemu-devel] [PATCH v3 2/4] net/announce: Add HMP optional interface list Dr. David Alan Gilbert (git)
2019-06-10 18:44 ` [Qemu-devel] [PATCH v3 3/4] net/announce: Add optional ID Dr. David Alan Gilbert (git)
2019-06-10 19:53 ` Eric Blake [this message]
2019-06-12 15:32 ` Dr. David Alan Gilbert
2019-06-10 18:44 ` [Qemu-devel] [PATCH v3 4/4] net/announce: Add HMP " Dr. David Alan Gilbert (git)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e602e259-f5db-c73a-7a4e-f63a2d48e85c@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=laine@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).