From nobody Sun May 19 10:38:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1594914152; cv=none; d=zohomail.com; s=zohoarc; b=OZEMH+xSjg574P5dFDiYdynsMQ3ilZ9x//C9OAkwHwKwm3820RneAgagqJ9BYTyjx0583iwweLMuv6j+bzlK4nQJQdqP7/LXr1jBtvyg2o6gNjeF96gn94E8mQ4uvnDaq5/7AjI+48T8Ajqg22A0fGj5xSDdoyQe1Y1GlMiTXzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594914152; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=TFEeAigEIjpMhWK7DoHcFuCUqfcQKRxgqCRDpAIxz64=; b=QgXxJGvzoWLKnJEem3JWhA9esqiB5X5rRTWEYZBqg1oadvs3N6HnoUGK/coDlcvlEAGmhBqJKQgIq9adjFbn1QtaCxdYv+dwQNbVURAoBJmqmhPlgq7SYMvi/rTBfmnqL+4Z6xc4cidkSgrha0mQVdCZum1fRd5/Pq/pbc7Zh6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594914152380698.0314526190658; Thu, 16 Jul 2020 08:42:32 -0700 (PDT) Received: from localhost ([::1]:51916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jw61n-00028s-6P for importer@patchew.org; Thu, 16 Jul 2020 11:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jw60g-00019c-CF for qemu-devel@nongnu.org; Thu, 16 Jul 2020 11:41:22 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jw60e-0007d1-3s for qemu-devel@nongnu.org; Thu, 16 Jul 2020 11:41:22 -0400 Received: by mail-wm1-x341.google.com with SMTP id f139so12046923wmf.5 for ; Thu, 16 Jul 2020 08:41:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j15sm9505012wrx.69.2020.07.16.08.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 08:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TFEeAigEIjpMhWK7DoHcFuCUqfcQKRxgqCRDpAIxz64=; b=W4ELa6bwjHcVX3CesooMK/yVwoBCd4shwKHFCmu4wGfLzoUIsZXDRR1Yx95nfvgIZw U4BvBX894c6gdLfZcBnJvpzXdlUf9w2ot03j7TfFHpSYcZw2SSQx9arc3ED4CZ+FRuwU 77xDC8265rpV2KmIR0fpIMJjL7216ugylwpN7j7zhTUziRJdTjn3U4r1GJ3TPJspGX4I 5v5TJxDpBePh1/D70ijoluJVa/YU0lc6MXh+Z86GmGSdrrSrM1FhMqXlmb4DWjhU1lyJ AoDxLT40WRM3JsNgLzSXU5OxMeEaBuq0rM3Bt4xPcH/FrdM0KZYd6aOoRO1Km7ipvAGg frtg== 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:mime-version :content-transfer-encoding; bh=TFEeAigEIjpMhWK7DoHcFuCUqfcQKRxgqCRDpAIxz64=; b=KbUNClKSQshALZ9vxeHUCLdFj+nNU8AlQAmVu90PWsc3Vhkuc4A/w6vi3KLQQikrVb dZYK70EBkvSWexc/ZBaePDJmNZAaLG45WvcYhZmLzlepLd/WLBefGHSt/mLxqxLVe6lw UoNbWCW/a96BqxEFZdlY/WYIeG4lH0gLsUjEzQxflgwZ9vzIASsWKX6byUmtIeib7zlY 1GAsx7jtKhVepPtyvwU1x9OrKm/l/7L8FLtkW1TEpYvvy9F8bJk6NKi+fshGtNubVKp7 ZDwOC88gsQPy+VM2YKUaz5fUQup+sG9WlXcAf/4TYFkKThPoXWAfsAtvwAmmZUEiuu6c RQTg== X-Gm-Message-State: AOAM532S3tGu7vCCaz4vGdfQqyuvvUcqVM1kbrSrCrnApFJU2K+rZ42e t0tLZ8lzCC1dxF5bKFjYvtmueRocTM6sCg== X-Google-Smtp-Source: ABdhPJwUs/Re27mBoKaIarf4T99MABoHs/uKrZYIOZ6y7XA4AJfSaNnVZnELXcF/WVfradYvyPug8g== X-Received: by 2002:a7b:c313:: with SMTP id k19mr4935929wmj.67.1594914077203; Thu, 16 Jul 2020 08:41:17 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Subject: [PATCH] osdep.h: Add doc comment for qemu_get_thread_id() Date: Thu, 16 Jul 2020 16:41:14 +0100 Message-Id: <20200716154114.10838-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Add a documentation comment for qemu_get_thread_id(): since this is rather host-OS-specific it's useful if people writing the implementation and people thinking of using the function know what the purpose and limitations are. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake --- Based on conversation with Dan on IRC, and prompted by the recent patch to add OpenBSD support. Q: should we document exactly what the thread-id value is for each host platform in the QMP documentation ? Somebody writing a management layer app should ideally not have to grovel through the application to figure out what they should do with the integer value they get back from query-cpus... include/qemu/osdep.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 4841b5c6b5f..8279f72e5ed 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -515,6 +515,20 @@ bool qemu_has_ofd_lock(void); =20 bool qemu_write_pidfile(const char *pidfile, Error **errp); =20 +/** + * qemu_get_thread_id: Return OS-specific ID of current thread + * + * This function returns an OS-specific identifier of the + * current thread. This will be used for the "thread-id" field in + * the response to the QMP query-cpus and query-iothreads commands. + * The intention is that a VM management layer application can then + * use it to tie specific QEMU vCPU and IO threads to specific host + * CPUs using whatever the host OS's CPU affinity setting API is. + * New implementations of this function for new host OSes should + * return the most sensible integer ID that works for that purpose. + * + * This function should not be used for anything else inside QEMU. + */ int qemu_get_thread_id(void); =20 #ifndef CONFIG_IOVEC --=20 2.20.1