From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 6ACC2C433EF for ; Sun, 12 Sep 2021 15:17:19 +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 DC05D6108F for ; Sun, 12 Sep 2021 15:17:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC05D6108F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPREL-0000wV-OC for qemu-devel@archiver.kernel.org; Sun, 12 Sep 2021 11:17:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPRCJ-0008Iq-W7 for qemu-devel@nongnu.org; Sun, 12 Sep 2021 11:15:13 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:33470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPRCH-0001tI-RI for qemu-devel@nongnu.org; Sun, 12 Sep 2021 11:15:11 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 192-20020a1c04c9000000b002f7a4ab0a49so3786839wme.0 for ; Sun, 12 Sep 2021 08:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=akbSip+eYvF6qNH2otzONcJ5LkTBDHsahUFkbFRYc7g=; b=kkkkcq2KY3LhgfJIOILC+f+E/oP8Syvv2jsbbIopwWdwe6y82J01rkHX9Z3nwZ9KZN igVCXNNE5SucIp4SXN9qVzdwoQQaI2eiezmt0VBEF+oOIFFCMyZuf3dwDJ6b6LkJy08W 9CfiodUJ1t3YbjIIqP9RJIjO0XwqVKuyEQU52JolYR0dlGmOhE5HbE+TFEI6A4xiJCUI 03oK5tOk6KGjSK1pjtZfPvNY4QpAPegXwR1ay+VjFlsNb2+sUw+20154KdJexBmtlGRC N3p0XkEw5X9Duym+GeOTydXq/zqbDxJMl4io5qMA6S/UJYwzAYz7KaIXB1H4WqmM3Vtv 3UbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=akbSip+eYvF6qNH2otzONcJ5LkTBDHsahUFkbFRYc7g=; b=x86AsWG7m7TDwG3orNbuf3zQPQApF5RCyIy+zNOOT65RiWKcfvf7KKvGbUHIOpC6eQ yyO7MUBq0eFsMj5+5VALlQV2tLyPoMP0IN0rAJiF5HyN4h3gGd2qcXQyCBz06ZXbLxsa le4qru4VB0BfIWNKU62fPkgbapJUrB2UbmGT/TLE4HeTQ6uYL08LSV+SQkUfftd0zIlJ s4YRyAjGw+7FOw9/hly8RlJ5tc6mh7MZomvqGKif55DkL3Dlgi6XK3MYh0v/r8bhf+zf zC8qYNWuAC9YDlzm59ks2vfkwucLc5tkZ0vvZfpFVA+DB+wAiIzh2jGHhMiv9W+v7oKC KFAg== X-Gm-Message-State: AOAM5313dRQikM+8n6qOmnMeuFhrMXEPzqy9JheMl5wKFCPPj4xXckdC icvvNOpEnQvpLVm5Nw3AN0w= X-Google-Smtp-Source: ABdhPJwlcHV0u8u2HfUTMwRUnwR/Y+WKe3wybX4wFi0t22pLhLlPQSMYXdBgl43eV/n86Ctg6ZW80A== X-Received: by 2002:a7b:c35a:: with SMTP id l26mr7196184wmj.124.1631459707825; Sun, 12 Sep 2021 08:15:07 -0700 (PDT) Received: from [192.168.1.36] (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id z1sm4372856wmi.34.2021.09.12.08.15.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Sep 2021 08:15:07 -0700 (PDT) Subject: Re: [PATCH 03/20] nubus-device: add device slot parameter To: Mark Cave-Ayland , qemu-devel@nongnu.org, laurent@vivier.eu References: <20210912074914.22048-1-mark.cave-ayland@ilande.co.uk> <20210912074914.22048-4-mark.cave-ayland@ilande.co.uk> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <2ade04c9-59f8-04cc-d80f-f9eab22bc4ff@amsat.org> Date: Sun, 12 Sep 2021 17:15:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210912074914.22048-4-mark.cave-ayland@ilande.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-3.584, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: > This prepares for allowing Nubus devices to be placed in a specific slot instead > of always being auto-allocated by the bus itself. > > Signed-off-by: Mark Cave-Ayland > --- > hw/nubus/nubus-device.c | 6 ++++++ > include/hw/nubus/nubus.h | 2 +- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c > index 36203848e5..c1832f73da 100644 > --- a/hw/nubus/nubus-device.c > +++ b/hw/nubus/nubus-device.c > @@ -191,12 +191,18 @@ static void nubus_device_realize(DeviceState *dev, Error **errp) > nubus_register_format_block(nd); > } > > +static Property nubus_device_properties[] = { > + DEFINE_PROP_INT32("slot", NubusDevice, slot, -1), > + DEFINE_PROP_END_OF_LIST() > +}; > + > static void nubus_device_class_init(ObjectClass *oc, void *data) > { > DeviceClass *dc = DEVICE_CLASS(oc); > > dc->realize = nubus_device_realize; > dc->bus_type = TYPE_NUBUS_BUS; > + device_class_set_props(dc, nubus_device_properties); Can we reorder this after #4 where you sanity check 'slot' in nubus_device_realize()? First sanity check, then expose the property.