On 12/07/09 15:59, Luiz Capitulino wrote:
+ chardev = qemu_opt_get(opts, "chardev");
+ chr = qemu_chr_find(chardev);
+ if (chardev == NULL) {
+ fprintf(stderr, "chardev \"%s\" not found\n", chardev);
+ exit(1);
+ }
We should check for NULL before calling qemu_chr_find().
No. qemu_chr_find() can deal with NULL just fine. We should check the
return value (chr) instead though. When fixing that it prints the error
message and exits as it should. Well, almost, because ...
The reason for the segfault is that the chardev 'monitor' is not found,
so qemu_chr_find() returns NULL, passing it down to:
... 'monitor' should be there, there is a default for the monitor
device. Hmm, checking why ...
cheers,
Gerd