All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Amit Shah <amit.shah@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] vmstate registration: check return values
Date: Tue, 10 Jan 2017 10:44:37 +0000	[thread overview]
Message-ID: <CAFEAcA8ek-VPxFx4g+mDS2JEwY-VywUYojTtDQ5LMsG70UnfyA@mail.gmail.com> (raw)
In-Reply-To: <20170110103400.GC2423@work-vm>

On 10 January 2017 at 10:34, Dr. David Alan Gilbert <dgilbert@redhat.com> wrote:
> However, it's a bit optimistic of the memory region to claim the name
> is just for debug; Migration/ram.c transmits the RAMBlock's idstr on
> the wire (as does postcopy) - so I think the memory.h comment
> is wrong.

We'd better fix that, then, or we'll find ourselves breaking
migration compat by accident...

> I don't think it's a big problem since you're unlikely to hit these
> big names in practice; but it would be better to return an error
> rather than assert/abort since then you wouldn't abort as part
> of a hot-add.

Almost all of the calls aren't going to be hot-add, though.

> So it's worth taking the common cases as this patch does; I don't
> think it's worth the hastle of changing 100+ calls though.

You also have the code paths via memory_region_allocate_system_memory
which end up calling vmstate_register_ram_global which then calls
qemu_ram_set_idstr -- none of that has support for returning an
error.

(Aside: at some point I want to introduce a
memory_region_allocate_aux_memory() which wraps the common
pattern
    memory_region_init_ram(mr, NULL, name, size, &error_fatal);
    vmstate_register_ram_global(mr);
so we have a simple way to create RAM blocks which aren't
the main system ram, by analogy with memory_region_allocate_system_memory().)

thanks
-- PMM

  reply	other threads:[~2017-01-10 10:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 20:13 [Qemu-devel] [PATCH 0/3] Protect against long IDs Dr. David Alan Gilbert (git)
2017-01-09 20:13 ` [Qemu-devel] [PATCH 1/3] vmstate_register_with_alias_id: Take an Error ** Dr. David Alan Gilbert (git)
2017-02-01 12:56   ` Juan Quintela
2017-01-09 20:13 ` [Qemu-devel] [PATCH 2/3] migration: Check for ID length Dr. David Alan Gilbert (git)
2017-02-01 12:57   ` Juan Quintela
2017-01-09 20:13 ` [Qemu-devel] [PATCH 3/3] vmstate registration: check return values Dr. David Alan Gilbert (git)
2017-01-09 21:39   ` Peter Maydell
2017-01-10  9:26     ` Dr. David Alan Gilbert
2017-01-10 10:10       ` Peter Maydell
2017-01-10 10:34         ` Dr. David Alan Gilbert
2017-01-10 10:44           ` Peter Maydell [this message]
2017-02-01 12:58   ` Juan Quintela

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=CAFEAcA8ek-VPxFx4g+mDS2JEwY-VywUYojTtDQ5LMsG70UnfyA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.