From patchwork Fri Feb 14 05:55:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 865092 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1f8a:b0:38f:210b:807b with SMTP id hj10csp199388wrb; Thu, 13 Feb 2025 21:56:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHiMuHDSRdWtHR08HxbK7Nvth8p7bWDGOEH+bycPXt0rpyHdynvLXTTsXO3xeTKt9f+d0zSA==@linaro.org X-Google-Smtp-Source: AGHT+IFsykr62i5fD3p+PaTL65zvZH1pMx/Fmje/W+KK9Cm+DAhM05dsLF7u2QrWpR/BmsMZO+Wg X-Received: by 2002:a05:622a:4c7:b0:471:9b4f:e93b with SMTP id d75a77b69052e-471c01df0d9mr93028021cf.17.1739512577057; Thu, 13 Feb 2025 21:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739512577; cv=none; d=google.com; s=arc-20240605; b=Y8858aeBzZQa5sHpCCCgn8EUJOh5iGmX8grWGFnKVMnv0VrZuxN638B91OPEEB4w8D Dl3iF/GnO1uqF2NOw+tZmJnFnNKvMFqpklL824ByLEWvlaBDcyXTJ3cvMOE9mHkRG+p/ cc2xdbLA7+uQ9iBcvhb73wT9dS9OXBAZJ2Ixg++fTULILjEUPeRH7p1Yo2ggL458r5+N 6KBfc+BiUymcH6Sb9j89QpXpQ9IRNC1Pi8QGdHtOX2yfydh0fZ4WAuwONZg+z9QI3snD BIbu4Zqx7D1aBB0afuQtoWhYLsBQTibBglDN9eI2B638a2zScF2IYDNJChMNhTZuKjV9 03Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=IgOaq4STNfs0XHcAbpHL77xzWIfsm+0bOws6w55FPP8=; fh=IMXbw0xx+6Q/2UEl1nyvDi1qBBGGml6rPCVUBtTSKyg=; b=ZiUl5IN0sDs1GbD06LqQcwgAgqxXcSUZ2n/AiYbh+aaMlmvathJ83bpztNiCW4bsNf +uptcR5tkg6GB0hcN1uV0wsWB/bSbZvi0Oj/I0s/wCgYcNJUTp+47MPAuu0C7YiyKoyj rghVVsX4U1V/mPDd/hxk8bN+LmhZ6N48VoQ1wXGj3bgMIyU67a4qw6FRDSHQjO1EvW6l pDzOzf2ah1hh8eZSWul+exwmEHuALag4hEfgRPSQaC6154QJDKR+busYZV+CgBh++mzc ESX07FFGZpFpucBHdQRMPCHPi7k1sGS684xrmnN8bojQqiFqyB6YnbwgTqsSRdjxHSWj Jy6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-471c2b2bffdsi28019871cf.245.2025.02.13.21.56.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2025 21:56:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiofk-0000aS-SD; Fri, 14 Feb 2025 00:55:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tiofi-0000Yp-FH; Fri, 14 Feb 2025 00:55:30 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tiofg-00084H-Sp; Fri, 14 Feb 2025 00:55:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BE866EAB0D; Fri, 14 Feb 2025 08:55:12 +0300 (MSK) Received: from gandalf.tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with ESMTP id BDE691B5FC3; Fri, 14 Feb 2025 08:55:20 +0300 (MSK) Received: by gandalf.tls.msk.ru (Postfix, from userid 1000) id AB8AF53462; Fri, 14 Feb 2025 08:55:20 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-trivial@nongnu.org, Michael Tokarev Subject: [PULL 2/4] qemu/timer: Clarify timer_new*() must be freed with timer_free() Date: Fri, 14 Feb 2025 08:55:18 +0300 Message-Id: <20250214055520.3159764-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250214055520.3159764-1-mjt@tls.msk.ru> References: <20250214055520.3159764-1-mjt@tls.msk.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé There was not mention QEMUTimer created with timer_new*() must be released with timer_free() instead of g_free(), because then active timers are removed from the active list. Update the documentation mentioning timer_free(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- include/qemu/timer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index cc167bd825..abd2204f3b 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -507,6 +507,8 @@ static inline void timer_init_ms(QEMUTimer *ts, QEMUClockType type, * with an AioContext---each of them runs its timer callbacks in its own * AioContext thread. * + * The timer returned must be freed using timer_free(). + * * Returns: a pointer to the timer */ static inline QEMUTimer *timer_new_full(QEMUTimerListGroup *timer_list_group, @@ -530,6 +532,8 @@ static inline QEMUTimer *timer_new_full(QEMUTimerListGroup *timer_list_group, * and associate it with the default timer list for the clock type @type. * See timer_new_full for details. * + * The timer returned must be freed using timer_free(). + * * Returns: a pointer to the timer */ static inline QEMUTimer *timer_new(QEMUClockType type, int scale, @@ -548,6 +552,8 @@ static inline QEMUTimer *timer_new(QEMUClockType type, int scale, * associated with the clock. * See timer_new_full for details. * + * The timer returned must be freed using timer_free(). + * * Returns: a pointer to the newly created timer */ static inline QEMUTimer *timer_new_ns(QEMUClockType type, QEMUTimerCB *cb, @@ -566,6 +572,8 @@ static inline QEMUTimer *timer_new_ns(QEMUClockType type, QEMUTimerCB *cb, * associated with the clock. * See timer_new_full for details. * + * The timer returned must be freed using timer_free(). + * * Returns: a pointer to the newly created timer */ static inline QEMUTimer *timer_new_us(QEMUClockType type, QEMUTimerCB *cb, @@ -584,6 +592,8 @@ static inline QEMUTimer *timer_new_us(QEMUClockType type, QEMUTimerCB *cb, * associated with the clock. * See timer_new_full for details. * + * The timer returned must be freed using timer_free(). + * * Returns: a pointer to the newly created timer */ static inline QEMUTimer *timer_new_ms(QEMUClockType type, QEMUTimerCB *cb,