From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDbOF-0003uG-9u for qemu-devel@nongnu.org; Tue, 20 Jan 2015 11:10:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDbOA-000624-Pu for qemu-devel@nongnu.org; Tue, 20 Jan 2015 11:10:51 -0500 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:42508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDbOA-00061q-HK for qemu-devel@nongnu.org; Tue, 20 Jan 2015 11:10:46 -0500 Received: by mail-we0-f170.google.com with SMTP id x3so12160877wes.1 for ; Tue, 20 Jan 2015 08:10:45 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54BE7E02.4030602@redhat.com> Date: Tue, 20 Jan 2015 17:10:42 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1421673818-11224-1-git-send-email-arei.gonglei@huawei.com> <1421673818-11224-2-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1421673818-11224-2-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/4] qdev: support to get a device firmware path directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: weidong.huang@huawei.com, peter.huangpeng@huawei.com, subo7@huawei.com, mst@redhat.com On 19/01/2015 14:23, arei.gonglei@huawei.com wrote: > @@ -780,6 +788,12 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size) > d = bus_get_fw_dev_path(dev->parent_bus, dev); > } > if (d) { > + l += snprintf(p + l, size - l, "%s/", d); > + g_free(d); > + } > + > + d = qdev_get_own_fw_dev_path_from_handler(dev->parent_bus, dev); This changes preexisting behavior. If d was true, you wouldn't go down the following else. Now it does. I was thinking it should be handled though the "suffix" argument to add_boot_device_path, but that's harder now that the suffix has to be passed to device_add_bootindex_property. Perhaps you could call qdev_get_own_fw_dev_path_from_handler in get_boot_devices_list, and convert non-NULL suffixes to implementations of FWPathProvider? Paolo > + if (d) { > l += snprintf(p + l, size - l, "%s", d); > g_free(d); > } else {