Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EB57C433DB for ; Fri, 29 Jan 2021 20:07:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF96164E02 for ; Fri, 29 Jan 2021 20:07:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF96164E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eik.bme.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5a3T-0004Ur-ND for qemu-devel@archiver.kernel.org; Fri, 29 Jan 2021 15:07:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5a2J-0003mg-9E for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:06:31 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:37577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5a2G-00066V-M3 for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:06:30 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id C5E6A7462E1; Fri, 29 Jan 2021 21:06:25 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 9B5277462D3; Fri, 29 Jan 2021 21:06:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 999217462BD; Fri, 29 Jan 2021 21:06:25 +0100 (CET) Date: Fri, 29 Jan 2021 21:06:25 +0100 (CET) From: BALATON Zoltan To: Paolo Bonzini Subject: Re: [PATCH v2 2/2] pci: add romsize property In-Reply-To: <9aae8014-8f86-ad1c-1a67-f08312aeb8d9@redhat.com> Message-ID: References: <20210129192838.582771-1-pbonzini@redhat.com> <20210129192838.582771-3-pbonzini@redhat.com> <9aae8014-8f86-ad1c-1a67-f08312aeb8d9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com, dgilbert@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 29 Jan 2021, Paolo Bonzini wrote: > On 29/01/21 20:51, BALATON Zoltan wrote: >> otherwise the BIOS emulator in the guest firmware crashes and this works so >> I think romfile can be empty and it's a useful feature to have in this case >> for example. I don't know if this patch changes anything about that but the >> commit message saying that romfile cannot be empty may be wrong. > > The empty property value configures the device not to have a ROM file at all. > The commit message says that ROM files (if they exist) cannot be empty, > corresponding to this code in pci_add_option_rom: > > } else if (size == 0) { > error_setg(errp, "romfile \"%s\" is empty", pdev->romfile); > g_free(path); > return; > } OK, then it was just not clear to me that the commit message talks about the romfile itself and not the property. By the way, does it make sense to compare uint32_t value to -1 and could that provoke some compiler/sanitiser warnings? Is it better to have a signed type or use UINT32_MAX or simlar instead? Regards, BALATON Zoltan