From patchwork Thu Oct 5 08:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9986571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA7B660247 for ; Thu, 5 Oct 2017 08:46:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB7A928C0A for ; Thu, 5 Oct 2017 08:46:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFA7428C12; Thu, 5 Oct 2017 08:46:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E47D28C0A for ; Thu, 5 Oct 2017 08:46:21 +0000 (UTC) Received: from localhost ([::1]:38456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e01nQ-0002t4-0J for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Oct 2017 04:46:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e01mi-0002nK-Lb for qemu-devel@nongnu.org; Thu, 05 Oct 2017 04:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e01mf-0005xi-Jd for qemu-devel@nongnu.org; Thu, 05 Oct 2017 04:45:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22533) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e01mf-0005w2-D7 for qemu-devel@nongnu.org; Thu, 05 Oct 2017 04:45:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDA62914E9; Thu, 5 Oct 2017 08:45:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EDA62914E9 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.redhat.com (ovpn-117-229.ams2.redhat.com [10.36.117.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id A316A17A6F; Thu, 5 Oct 2017 08:45:06 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Cornelia Huck , Christian Borntraeger Date: Thu, 5 Oct 2017 10:45:05 +0200 Message-Id: <1507193105-15627-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 05 Oct 2017 08:45:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Farman , Janosch Frank , Halil Pasic , Yi Min Zhao , Jason J Herne , David Hildenbrand , Pierre Morel , Farhan Ali , Jing Liu , Claudio Imbrenda , QingFeng Hao , Xiao Feng Ren , Fei Li , Dong Jia Shi , Yang Chen Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The "sclpquiesce" device is just an internal device that should not be created by the user directly. Though it currently does not seem to cause any obvious trouble when the user instantiates an additional device, let's better mark it with user_creatable = false to avoid unexpected behavior, e.g. because the quiesce notifier gets registered multiple times. Signed-off-by: Thomas Huth Reviewed-by: Halil Pasic Reviewed-by: Claudio Imbrenda --- hw/s390x/sclpquiesce.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c index 762cb18..0241643 100644 --- a/hw/s390x/sclpquiesce.c +++ b/hw/s390x/sclpquiesce.c @@ -118,8 +118,13 @@ static void quiesce_class_init(ObjectClass *klass, void *data) dc->reset = quiesce_reset; dc->vmsd = &vmstate_sclpquiesce; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - k->init = quiesce_init; + /* + * Reason: This is just an internal device - the notifier should + * not be registered multiple times in quiesce_init() + */ + dc->user_creatable = false; + k->init = quiesce_init; k->get_send_mask = send_mask; k->get_receive_mask = receive_mask; k->can_handle_event = can_handle_event;