From nobody Fri Dec 19 20:17:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629816303; cv=none; d=zohomail.com; s=zohoarc; b=JSssjo7zjLgTHBNksavw7oCAqNgZEuYI8b4wCUooOktNxe9Q1p4fGEFFWSpBPoe7DDiVb8S8M7DlEP6JO58BMVkSN5XCEzb4kBUvOYSJeLDAvEarnTv6qb5DvrHJaid01qNrJU10yZ0viZG1kXAnllUudsrKCQ0SSqX7mYN6HA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629816303; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Dh0Mb9LPkGc/4whNbY4AhCmNqUZMMmA0L+sLwqTmZC8=; b=IODi9ge53sHkTba94i94PisLk48A+uSDStULs/Vn8LSh4vg0ZMFG2WaeaSk3oLtwsfmUF6kPR5CAz8kjdHqShEautfVk3QEUjIBVYX5aCxS3xCiAu3VY8frWUX+hSOB9T9puaqsvLj/6AwXzon4pkMmVxlKsJnaxmk/Hk+lcUAU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162981630381939.325953626745104; Tue, 24 Aug 2021 07:45:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-ygoRmrLGNOCfwboC1dQ93w-1; Tue, 24 Aug 2021 10:44:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8309838E65; Tue, 24 Aug 2021 14:44:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AC1660E1C; Tue, 24 Aug 2021 14:44:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 515914BB7C; Tue, 24 Aug 2021 14:44:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17OEirib005444 for ; Tue, 24 Aug 2021 10:44:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id B56BF69323; Tue, 24 Aug 2021 14:44:53 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1635D18432 for ; Tue, 24 Aug 2021 14:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629816302; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Dh0Mb9LPkGc/4whNbY4AhCmNqUZMMmA0L+sLwqTmZC8=; b=PWCwowLLs0zpPHmEp2dqWotGLXYv4kQnZLRacsXp0SnptHzFP2h0HWnOudZ1x3CG0uulc4 ZwhhPbxyGFV5Euw/CP0hMubZBBts/Vv1eawdmQCdvRh33Oe8sFLrkYYifUj30TQRsuTt5A IZWpbBGvaxaOFYuCMp9dnvA4/oW9dIw= X-MC-Unique: ygoRmrLGNOCfwboC1dQ93w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/22] qemuMonitorJSONSetWatchdogAction: Use automatic memory clearing Date: Tue, 24 Aug 2021 16:44:22 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629816305872100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8e5af9f79a..8fb2bf4dc3 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8560,9 +8560,8 @@ int qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, const char *action) { - virJSONValue *cmd; - virJSONValue *reply =3D NULL; - int ret =3D -1; + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("watchdog-set-action", "s:action", action, @@ -8570,17 +8569,12 @@ qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, return -1; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + return -1; if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; - - ret =3D 0; + return -1; - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; + return 0; } --=20 2.31.1