qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] chardev: Avoid adding duplicate chardev


From: Stefano Garzarella
Subject: Re: [Qemu-devel] [PATCH v2] chardev: Avoid adding duplicate chardev
Date: Tue, 29 Jan 2019 09:34:57 +0100
User-agent: NeoMutt/20180716

On Tue, Jan 29, 2019 at 11:58:01AM +0530, Pankaj Gupta wrote:
> Hotplugging existing char chardev with qmp, dereferences(removes) 
> existing chardev. This patch avoids adding a chardev if a chardev 
> with same id exists.
> 
> RH BZ 1660831: 
> 
> # (host) ls -lt /tmp/helloworld*
> srwxr-xr-x.  /tmp/helloworld1
> srwxr-xr-x.  /tmp/helloworld2
> 
> Before this patch:
> 
> hotplug existed chardev(channel1) in qmp:
> {"execute":"chardev-add","arguments":{"id":"charchannel1","backend":{"type":"socket",
> "data":{"addr":{"type":"unix", "data": {"path": "/tmp/helloworld1"}}}}}}
> 
> {"error": {"class": "GenericError", "desc": "attempt to add duplicate 
> property 'charchannel1' to object (type 'container')"}}
> 
> # ls -lt /tmp/helloworld*
> srwxr-xr-x. 1 root root 0 Dec 19 16:39 /tmp/helloworld2
> 
> After this patch:
> 
> {"execute":"chardev-add","arguments":{"id":"charchannel1","backend":{"type":"socket",
> "data":{"addr":{"type":"unix", "data": {"path": "/tmp/helloworld1"}}}}}}
> {"error": {"class": "GenericError", "desc": "Chardev 'charchannel1' already 
> exists"}}
> 
> # ls -lt /tmp/helloworld*
> srwxr-xr-x. 1 /tmp/helloworld1
> srwxr-xr-x. 1 /tmp/helloworld2
>  
> Reported-by: Xiaohui Li <address@hidden>
> Signed-off-by: Pankaj Gupta <address@hidden>
> ---
> 
> v1->v2
>  Correct error message - Eric 
> 
>  chardev/char.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Reviewed-by: Stefano Garzarella <address@hidden>



reply via email to

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