All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 11 of 13] serial: open a null device if the CharDriverState argument is null
Date: Mon, 02 Mar 2009 17:22:35 +0000	[thread overview]
Message-ID: <49AC15DB.9000407@eu.citrix.com> (raw)

Import "serial: open a null device if the CharDriverState argument is
null" from qemu mainstream.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6366 c046a42c-6fe2-441c-8c8c-71466251a162

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---

diff -r 183c9b430c7e hw/serial.c
--- a/hw/serial.c	Mon Feb 16 11:19:23 2009 +0000
+++ b/hw/serial.c	Mon Feb 16 11:20:28 2009 +0000
@@ -712,7 +712,7 @@
 {
     s->irq = irq;
     s->baudbase = baudbase;
-    s->chr = chr;
+    s->chr = chr ?: qemu_chr_open("null", "null", NULL);
 
     s->modem_status_poll = qemu_new_timer(vm_clock, (QEMUTimerCB *) serial_update_msl, s);
 
@@ -722,6 +722,8 @@
     qemu_register_reset(serial_reset, s);
     serial_reset(s);
 
+    qemu_chr_add_handlers(s->chr, serial_can_receive1, serial_receive1,
+                          serial_event, s);
 }
 
 /* If fd is zero, it means that the serial device uses the console */
@@ -740,8 +742,6 @@
 
     register_ioport_write(base, 8, 1, serial_ioport_write, s);
     register_ioport_read(base, 8, 1, serial_ioport_read, s);
-    qemu_chr_add_handlers(chr, serial_can_receive1, serial_receive1,
-                          serial_event, s);
     return s;
 }
 
@@ -839,8 +839,6 @@
                                              serial_mm_write, s);
         cpu_register_physical_memory(base, 8 << it_shift, s_io_memory);
     }
-    qemu_chr_add_handlers(chr, serial_can_receive1, serial_receive1,
-                          serial_event, s);
     serial_update_msl(s);
     return s;
 }

                 reply	other threads:[~2009-03-02 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=49AC15DB.9000407@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.