qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [FOR 0.12 PATCH v3 17/21] rework -monitor handling, sw


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [FOR 0.12 PATCH v3 17/21] rework -monitor handling, switch to QemuOpts
Date: Mon, 07 Dec 2009 16:18:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]