From nobody Mon Feb 9 13:38:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601484647; cv=none; d=zohomail.com; s=zohoarc; b=dU7nNFDbGF4c5Wsd0i7/QlEJGjnFDuCOqxYEHlOdiZ23SgDCwMpDz7whzTyR/OKsnY7P8sh1yOUgD4y+bcTUnyIw5B0s8NOrsI8ygNcji7OIshpt1AsyXLJ6noyb1m0N5XrhGWzzT1yquVX7S+hleqhlRcOcvuTQKxEh5h0422Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601484647; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=jKQQNYZ2SLgmhNgWo9hIOt2yqMJ/mPmoThVu67DVxco=; b=A/SBdsNxA3D402hIf601hmTxvi2naf0uP/eZHwG7al1WZf0/mHTytQ8yNBIlUCPbtJBUBix4LZ+9nxlJc0bBJI6YFGAoWBm2jH7FFz8BdESvpqRSXtOxuW3qWZH/UIeedGxULC08uAqCQ2Zr4qrGVha8xNE5vtYVphLjEmDjieA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601484647798188.90938460609868; Wed, 30 Sep 2020 09:50:47 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-5GZxn8MfMa6zYXYtAyH8BA-1; Wed, 30 Sep 2020 12:50:42 -0400 Received: by mail-wm1-f72.google.com with SMTP id y18so60059wma.4 for ; Wed, 30 Sep 2020 09:50:42 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id v4sm3563456wml.46.2020.09.30.09.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 09:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601484646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jKQQNYZ2SLgmhNgWo9hIOt2yqMJ/mPmoThVu67DVxco=; b=ZnVP0b1fKSHfsdk+Ls6eICcxh62wyUZAEFSAUTmGstZSKvnYV5CNc5Hg/zD+xG3+o5b3QE Skiv61VKwAxlnKL1NYc3+qWcjVCPz3zw58w079tbDRK7ZzNmrJxrzyRb0mrr8dmu2EnWCc 0i/kWY9K61A6XB4A6GmjSdNmAgfp7KQ= X-MC-Unique: 5GZxn8MfMa6zYXYtAyH8BA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jKQQNYZ2SLgmhNgWo9hIOt2yqMJ/mPmoThVu67DVxco=; b=qfU2odMXg1yk2Uw+05IBfACLq+JJA27RuhXs4Kh8dyanX7/r1TqomxdsGIrJw4AS+o LdW9kjIKZCPcT+aHgaL6z3/m3Nt3pITXrJp7+0hQqj+bgWNpR3rqJjEuTSb+vs04K7P0 rbbyqDkOqxPdjrV4DtXaBytXNhigefz/ZNOcyxv1DBKJBfpU3H/rTb+jw7aM+IoIy+8q e1mSGZS4M/WsGcAWCqgkWS/Il5f6Eloh9NAzToBk/6pgO8ZIIBcGC6gIs89KJ1iMiEHv aZxVYuwOA7MW4N/XGpRv/GJgs1JUQsAK/s5b0mLwltkS5GDAI1pdIJVzINWEmuLUS59A KjxA== X-Gm-Message-State: AOAM530/GRe1RcRyU1ZvQMlKvWpo+DZbBdCONiq6E42OYtye6KqK7P0t WNAeMq/jScAUI1iUwx6pViNDdTLYUh6U+5lsyFF0OC/oPgVyw1zDqx/N2qxbsgDwvmkevPDSQXf p13fQT9kgbLut7A== X-Received: by 2002:a5d:444e:: with SMTP id x14mr3965089wrr.235.1601484640896; Wed, 30 Sep 2020 09:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnLfectrjk5rOG39NVLnIV5g6+m0NSAZsv7bRIwZo2gPt9mWfr/uMfChTftCeAlsvEum05fw== X-Received: by 2002:a5d:444e:: with SMTP id x14mr3965059wrr.235.1601484640690; Wed, 30 Sep 2020 09:50:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Laurent Vivier Cc: Ronnie Sahlberg , Eric Blake , Kevin Wolf , Marcel Apfelbaum , Richard Henderson , Michael Roth , Eduardo Habkost , Peter Lieven , Markus Armbruster , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Paolo Bonzini , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 09/11] hw/core: Add qdev stub for user-mode Date: Wed, 30 Sep 2020 18:49:47 +0200 Message-Id: <20200930164949.1425294-10-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930164949.1425294-1-philmd@redhat.com> References: <20200930164949.1425294-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) While user-mode does not use peripherals (devices), it uses a CPU which is a device. In the next commit we will reduce the QAPI generated code for user-mode. Since qdev.c calls qapi_event_send_device_deleted() in device_finalize, let's add a stub for it. Suggested-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Meson rebase --- stubs/qdev-system.c | 24 ++++++++++++++++++++++++ stubs/meson.build | 1 + 2 files changed, 25 insertions(+) create mode 100644 stubs/qdev-system.c diff --git a/stubs/qdev-system.c b/stubs/qdev-system.c new file mode 100644 index 0000000000..2b4b54f621 --- /dev/null +++ b/stubs/qdev-system.c @@ -0,0 +1,24 @@ +/* + * QAPI qdev stubs + * + * Copyright (c) 2020 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daud=C3=A9 + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-events-qdev.h" + +void qapi_event_send_device_deleted(bool has_device, + const char *device, const char *path) +{ + /* + * Called in user-mode in fork() when a CPUState is qdev::finalize()'d. + * Simply ignore the QAPI event there. + */ +} diff --git a/stubs/meson.build b/stubs/meson.build index 2e231590e1..71d42c34d6 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -25,6 +25,7 @@ stub_ss.add(files('monitor.c')) stub_ss.add(files('monitor-core.c')) stub_ss.add(files('pci-bus.c')) stub_ss.add(files('pci-host-piix.c')) +stub_ss.add(files('qdev-system.c')) stub_ss.add(files('qemu-timer-notify-cb.c')) stub_ss.add(files('qmp_memory_device.c')) stub_ss.add(files('qtest.c')) --=20 2.26.2