From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmNrp-0006l9-7N for qemu-devel@nongnu.org; Mon, 19 May 2014 09:44:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmNrf-0005K0-J2 for qemu-devel@nongnu.org; Mon, 19 May 2014 09:44:37 -0400 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:56091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmNrf-0005Jl-AX for qemu-devel@nongnu.org; Mon, 19 May 2014 09:44:27 -0400 Received: by mail-pa0-f52.google.com with SMTP id fa1so5834437pad.39 for ; Mon, 19 May 2014 06:44:26 -0700 (PDT) Message-ID: <537A0AAE.2030902@gmail.com> Date: Mon, 19 May 2014 21:44:14 +0800 From: Jun Li MIME-Version: 1.0 References: <1397658057-12086-1-git-send-email-junmuzi@gmail.com> <20140515150748.GA29436@redhat.com> <5377517C.7060408@gmail.com> <87iop2i6cj.fsf@blackfin.pond.sub.org> In-Reply-To: <87iop2i6cj.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Markus Armbruster 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 On 05/19/2014 03:18 PM, Markus Armbruster wrote: > 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. ok, I will submit a update version for this patch. > >> 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. oh, thanks for your explanation. Best Regards, Jun Li