qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: qemu list <qemu-devel@nongnu.org>, Markus Armbruster <armbru@redhat.com>
Subject: Re: [question] qemu abort when object-add is called with an already used id
Date: Thu, 18 Jun 2020 18:12:54 +0100	[thread overview]
Message-ID: <20200618171254.GL671599@redhat.com> (raw)
In-Reply-To: <0f47e285-3811-ba08-297f-e3ff5bd5f2c3@redhat.com>

On Thu, Jun 18, 2020 at 06:15:57PM +0200, Auger Eric wrote:
> Hi,
> 
> While testing PCDIMM hotplug/coldplug I noted qemu aborts if we attempt
> to add from the QMP monitor an object whose id is already in use.
> 
> for instance
> object-add qom-type=memory-backend-ram id=mem1 props.size=4294967296
> while mem1 is already used.
> 
> We get:
> Unexpected error in object_property_try_add() at qom/object.c:1167:
> attempt to add duplicate property 'mem1' to object (type 'container')
> 
> This is due to the fact &error_abort is passed to object_property_try_add().
> 
> Is it the expected behavior?

No, this is highly undesirable. A user/mgmt app mistake in reusing a
property ID shouldn't result in loss of the entire running VM and the
user's live data within.

We must gracefully report the error back to the QMP client.

error_abort should really only be used in scenarios which are
not expected to happen in real world. eg it is more like an
assert() in terms of where it should be used.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2020-06-18 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:15 [question] qemu abort when object-add is called with an already used id Auger Eric
2020-06-18 17:12 ` Daniel P. Berrangé [this message]
2020-06-19 15:39   ` Auger Eric

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=20200618171254.GL671599@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eric.auger@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).