qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: pradeep <psuriset@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, kvm-devel <kvm@vger.kernel.org>,
	Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] qemu aborts if i add a already registered device from qemu monitor ..
Date: Tue, 19 Oct 2010 10:11:44 -0200	[thread overview]
Message-ID: <20101019101144.47362c8c@doriath> (raw)
In-Reply-To: <20101019152737.234e2e51@skywalker>

On Tue, 19 Oct 2010 15:27:37 +0530
pradeep <psuriset@linux.vnet.ibm.com> wrote:

> Hi
> 
> I tried to add a device to guest from upstream qemu monitor using
> "device_add".

Are you developing a new device or does it happen with existing ones?

If it's the latter, can you describe steps to reproduce it?

> Unknowingly i try to add already registered devices from qemu
> monitor, my qemu monitor is aborted. I don't see a reason to kill
> monitor. I think abort() is a bit rough. we need a better way to handle
> it.  If a user try to add a already registered device, qemu should
> convey this to user saying that, this device already registered and an
> error message should be fine than aborting qemu.
> 
> 
>         QLIST_FOREACH(block, &ram_list.blocks, next) {
>         if (!strcmp(block->idstr, new_block->idstr)) {
>             fprintf(stderr, "RAMBlock \"%s\" already registered,
>         abort!\n",
>                     new_block->idstr);
>             abort();
>         }
> 
> 
> If i return some other value in above code, instead of abort(), I
> would  need change the code for every device, which i dont want to. 
> Is there a way to check, if device is already enrolled or not in the very beginning of "device_add"
> call.
> 
> 
> 
> Thanks
> Pradeep
> 

      reply	other threads:[~2010-10-19 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  9:57 [Qemu-devel] qemu aborts if i add a already registered device from qemu monitor pradeep
2010-10-19 12:11 ` Luiz Capitulino [this message]

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=20101019101144.47362c8c@doriath \
    --to=lcapitulino@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=psuriset@linux.vnet.ibm.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).