Patchwork [2/2] virtio-console: no need to remove char handlers explicitly

login
register
mail settings
Submitter Amit Shah
Date Jan. 13, 2012, 9:54 a.m.
Message ID <915d33eb055b4d388fda85c385b459e5631f91fe.1326448314.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/135765/
State New
Headers show

Comments

Amit Shah - Jan. 13, 2012, 9:54 a.m.
qdev is now equipped (thanks to the last commit) to disassociate
chardevs from the qdev devices on the devices going away.  So doing it
in the virtio-console driver is not necessary.

Since that was the only thing being done in the qdev exit method, drop
it entirely.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-console.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
Amit Shah - Jan. 13, 2012, 9:58 a.m.
On (Fri) 13 Jan 2012 [15:24:59], Amit Shah wrote:
> qdev is now equipped (thanks to the last commit) to disassociate
> chardevs from the qdev devices on the devices going away.  So doing it
> in the virtio-console driver is not necessary.
> 
> Since that was the only thing being done in the qdev exit method, drop
> it entirely.

Commit message is correct, patch is not.  Updated patch coming soon..

> diff --git a/hw/virtio-console.c b/hw/virtio-console.c
> index 73d866a..9275fd9 100644
> --- a/hw/virtio-console.c
> +++ b/hw/virtio-console.c
> @@ -127,16 +127,6 @@ static int virtconsole_initfn(VirtIOSerialPort *port)
>  
>  static int virtconsole_exitfn(VirtIOSerialPort *port)
>  {
> -    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
> -
> -    if (vcon->chr) {
> -	/*
> -	 * Instead of closing the chardev, free it so it can be used
> -	 * for other purposes.
> -	 */
> -	qemu_chr_add_handlers(vcon->chr, NULL, NULL, NULL, NULL);
> -    }
> -
>      return 0;
>  }

		Amit

Patch

diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 73d866a..9275fd9 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -127,16 +127,6 @@  static int virtconsole_initfn(VirtIOSerialPort *port)
 
 static int virtconsole_exitfn(VirtIOSerialPort *port)
 {
-    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
-
-    if (vcon->chr) {
-	/*
-	 * Instead of closing the chardev, free it so it can be used
-	 * for other purposes.
-	 */
-	qemu_chr_add_handlers(vcon->chr, NULL, NULL, NULL, NULL);
-    }
-
     return 0;
 }