* [Qemu-devel] qemu aborts if i add a already registered device from qemu monitor ..
@ 2010-10-19 9:57 pradeep
2010-10-19 12:11 ` Luiz Capitulino
0 siblings, 1 reply; 2+ messages in thread
From: pradeep @ 2010-10-19 9:57 UTC (permalink / raw)
To: kvm-devel, qemu-devel, Avi Kivity
Hi
I tried to add a device to guest from upstream qemu monitor using
"device_add".
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] qemu aborts if i add a already registered device from qemu monitor ..
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
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Capitulino @ 2010-10-19 12:11 UTC (permalink / raw)
To: pradeep; +Cc: qemu-devel, kvm-devel, Avi Kivity
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-19 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).