qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: William Dauchy <wdauchy@gmail.com>
To: qemu-devel@nongnu.org
Cc: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Subject: Re: [Qemu-devel] [PATCH] Remove a detached device from qemu_device_opts.
Date: Mon, 07 Feb 2011 15:40:09 +0100	[thread overview]
Message-ID: <1297089609.27183.5.camel@hitchhiker.gandi.net> (raw)
In-Reply-To: <20110127180057.eb28d17f.oomichi@mxs.nes.nec.co.jp>

On Thu, 2011-01-27 at 18:00 +0900, Ken'ichi Ohmichi wrote:
> Hi,
> 
> When I tried to attach the interface after detaching the same interface,
> the virsh command output the following and it failed:
> 
>   # virsh detach-interface Domain01 network --mac 52:54:00:0d:78:92
>   Interface detached successfully
> 
>   # virsh attach-interface Domain01 network default --mac 52:54:00:0d:78:92
>   error: Failed to attach interface
>   error: internal error unable to execute QEMU command 'device_add': Duplicate ID 'net0' for device
>   #
> 
> The reason is that a detached device is not removed from the list
> "qemu_device_opts", and this patch fixes it.
> Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
> ---
> --- a/hw/qdev.c	2011-01-27 17:42:25.000000000 +0900
> +++ b/hw/qdev.c	2011-01-27 17:43:46.000000000 +0900
> @@ -905,6 +905,8 @@ int do_device_del(Monitor *mon, const QD
>          qerror_report(QERR_DEVICE_NOT_FOUND, id);
>          return -1;
>      }
> +    qemu_opts_del(qemu_opts_find(&qemu_device_opts, id));
> +
>      return qdev_unplug(dev);
>  }

I successfully applied and tested this patch. It resolves the attach
problem.

-- 
William

  reply	other threads:[~2011-02-07 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27  9:00 [Qemu-devel] [PATCH] Remove a detached device from qemu_device_opts Ken'ichi Ohmichi
2011-02-07 14:40 ` William Dauchy [this message]
2011-02-12 21:28   ` William Dauchy
2011-02-14  6:19 ` Wen Congyang
2011-02-15  2:32   ` Minoru Usui
2011-02-23  9:42     ` William Dauchy
2011-02-25  4:52       ` Minoru Usui
2011-02-25  9:40         ` Markus Armbruster

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=1297089609.27183.5.camel@hitchhiker.gandi.net \
    --to=wdauchy@gmail.com \
    --cc=oomichi@mxs.nes.nec.co.jp \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).