Received: from eggs.gnu.org ([2001:4830:134:3::10]:48358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmHql-0001IR-9e for qemu-devel@nongnu.org; Mon, 19 May 2014 03:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmHqd-0000DA-Pz for qemu-devel@nongnu.org; Mon, 19 May 2014 03:19:07 -0400 Received: from oxygen.pond.sub.org ([144.76.244.19]:34849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmHqd-0008Kq-Jt for qemu-devel@nongnu.org; Mon, 19 May 2014 03:18:59 -0400 From: Markus Armbruster In-Reply-To: <5377517C.7060408@gmail.com> (Jun Li's message of "Sat, 17 May 2014 20:09:32 +0800") References: <1397658057-12086-1-git-send-email-junmuzi@gmail.com> <20140515150748.GA29436@redhat.com> <5377517C.7060408@gmail.com> Date: Mon, 19 May 2014 09:18:52 +0200 Message-ID: <87iop2i6cj.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] Add remove_boot_device_path() function for hot-unplug device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Li Cc: kwolf@redhat.com, aliguori@amazon.com, "Michael S. Tsirkin" , juli@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com, afaerber@suse.de Jun Li writes: > On 05/15/2014 11:07 PM, Michael S. Tsirkin wrote: >> On Wed, Apr 16, 2014 at 10:20:57PM +0800, Jun Li wrote: [...] >>> diff --git a/vl.c b/vl.c >>> index 9975e5a..1713c68 100644 >>> --- a/vl.c >>> +++ b/vl.c >>> @@ -1184,6 +1184,22 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, >>> QTAILQ_INSERT_TAIL(&fw_boot_order, node, link); >>> } >>> +void remove_boot_device_path(int32_t bootindex, DeviceState >>> *dev, >>> + const char *suffix) >> Why do we need suffix here? >> It seems unused. dev is unused as well. > Hi Michael, > > I just want to keep the same as function "add_boot_device_path". Such as: > void add_boot_device_path(int32_t bootindex, DeviceState *dev, > const char *suffix) Functions creating something commonly take different arguments than the function to destroy it. > I also find another function has define mon, but not be used in this function. Such as: > ---file vl.c--- > do_usb_del(Monitor *mon, const QDict *qdict) > { > const char *devname = qdict_get_str(qdict, "devname"); > if (usb_device_del(devname) < 0) { > error_report("could not delete USB device '%s'", devname); > } > } This one has a compelling reason: it's a mon_cmd_t mhandler.cmd callback.