From nobody Mon Nov 25 13:35:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1600084275; cv=none; d=zohomail.com; s=zohoarc; b=B5N8DLPhX9nE+cxTpwKBcTc66LGBZQueagsE5RscuzDm79fV87y9TfJE1TRnalXcAQAgFlgZaiMDw2ZwEpwhdK+vKh/cLvZlx/mwUWRX15zWvqRG6xiPcosXE1SZz6/MFxub2jcsJZ4UZeBZ71ZqLbvjE0kVKV+xunYAt5pnzW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600084275; 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=Mm1W+hLrsM8vxdu9orfSWWJmlCuNaLK3hH2pZ+skQcM=; b=nkNkGnciDR2aM8VRWyxET27wwoXxGwJAO8cYRhUI/wvyDHuRBrmdeYxxwdy+QzjctRln5xNQOp+WCFeqsCQus2QTmZwAhTnBcS44Orov+mdYu5eUwmK7jxe3pID2Z7s3ayMQzp6Ej+QQr7BAG+WYwdDRlcitxXK4INHmqxwYfHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1600084275243489.4977585717719; Mon, 14 Sep 2020 04:51:15 -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-256-y5vikrmmOc2Qi4OjtA0qjg-1; Mon, 14 Sep 2020 07:51:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD8B5802B46; Mon, 14 Sep 2020 11:51:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB8C11014160; Mon, 14 Sep 2020 11:51:06 +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 7A1EF1832FE3; Mon, 14 Sep 2020 11:51:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08EBovVK002530 for ; Mon, 14 Sep 2020 07:50:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6722810021AA; Mon, 14 Sep 2020 11:50:57 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id E383C1014160 for ; Mon, 14 Sep 2020 11:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600084274; 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=Mm1W+hLrsM8vxdu9orfSWWJmlCuNaLK3hH2pZ+skQcM=; b=PbqKt21kLM/F3WByDC/y8ZBJ208Gxhqr1TWoj++ycRi0VnnoHCKH835wvKVhTHVGjOYxzI tfX6s4xoEwWypyXrx5eAoy1pmfoVDS0Wimt/YEn8RHWBAMSWxQ1uVRVhyK3+etv4x+pq/N 5aoNwxITnYwHNCSB3O3ob/JISya0UcA= X-MC-Unique: y5vikrmmOc2Qi4OjtA0qjg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] qemu: rename qemuDomainObjFreeJob -> qemuDomainObjClearJob Date: Mon, 14 Sep 2020 13:49:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This function does not free the job. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domainjob.c | 2 +- src/qemu/qemu_domainjob.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 785cee6f18..03917cf000 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1859,7 +1859,7 @@ qemuDomainObjPrivateFree(void *data) qemuDomainObjPrivateDataClear(priv); =20 virObjectUnref(priv->monConfig); - qemuDomainObjFreeJob(&priv->job); + qemuDomainObjClearJob(&priv->job); VIR_FREE(priv->lockState); VIR_FREE(priv->origname); =20 diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index eeaa089959..9f76f1ef04 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -246,7 +246,7 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj, } =20 void -qemuDomainObjFreeJob(qemuDomainJobObjPtr job) +qemuDomainObjClearJob(qemuDomainJobObjPtr job) { qemuDomainObjResetJob(job); qemuDomainObjResetAsyncJob(job); diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index fcbe3fe112..eedd84c503 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -274,7 +274,7 @@ int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobI= nfo, =20 bool qemuDomainTrackJob(qemuDomainJob job); =20 -void qemuDomainObjFreeJob(qemuDomainJobObjPtr job); +void qemuDomainObjClearJob(qemuDomainJobObjPtr job); =20 int qemuDomainObjInitJob(qemuDomainJobObjPtr job, --=20 2.26.2 From nobody Mon Nov 25 13:35:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1600084279; cv=none; d=zohomail.com; s=zohoarc; b=SvOmRe3NYwMe3sqJo4b/lIhTNQMdNp+qBW/Rp8IKhsfI3Tm9GpzOzxwMcEjcJ1rhCF3Je6CLGNc5CqoM87CxjX4BU44IfCE68FNYOTX63MCYUsHwx85iycV3NJtEp6GNRzAK5oQyRJO/qp99gA335gbyqPEvyL/eZngGkt9sGzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600084279; 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=32BeBCKUVmIJfz2E4Pq2IFiQjp+A99O7SlvVrSnNw1M=; b=Dvkd6dlhyGhE8nKl7Y7wevXVhAK8VJz6AjECs49saftxowqJ4axoDEjxCegF5KfeTbhtOw1FGU12Tduz6m0rSL9PqvY/5Vgpc027WiHUDzlbqipH8p7zGB3761NBIAq9GwfvXpJX1O/p4ZWEQvquaKfLjRY/MMTCs7oDz2gCGAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 160008427938876.50963712182659; Mon, 14 Sep 2020 04:51:19 -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-349-mGfMo8deMACV8iRKmdE1zA-1; Mon, 14 Sep 2020 07:51:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C79948730A8; Mon, 14 Sep 2020 11:51:09 +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 A21B01A8EC; Mon, 14 Sep 2020 11:51:09 +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 701408C7CE; Mon, 14 Sep 2020 11:51:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08EBp0pk002548 for ; Mon, 14 Sep 2020 07:51:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2F5A1002D42; Mon, 14 Sep 2020 11:51:00 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B87710021AA for ; Mon, 14 Sep 2020 11:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600084278; 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=32BeBCKUVmIJfz2E4Pq2IFiQjp+A99O7SlvVrSnNw1M=; b=Tse+sUmP/L8mJm5gyBl3nKp3gL1BqP8sBGz7U0J/yoOC2EPk8dskQON0gibz3AQBbP7a5L IhRCNy9nAD8d1OJ9AcA0CSzF+10dHUmIpJyMxI9rdrMODKAwo8VNOITDS1FPK6rP9qqNZV 6wacCAd3uMz7krLOtUBt7OkLle6h8Zo= X-MC-Unique: mGfMo8deMACV8iRKmdE1zA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] qemu: qemuDomainObjClearJob: use g_clear_pointer Date: Mon, 14 Sep 2020 13:49:55 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The function used g_clear_pointer for all but one pointer. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_domainjob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 9f76f1ef04..e5910a11a1 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -250,7 +250,7 @@ qemuDomainObjClearJob(qemuDomainJobObjPtr job) { qemuDomainObjResetJob(job); qemuDomainObjResetAsyncJob(job); - job->cb->freeJobPrivate(job->privateData); + g_clear_pointer(&job->privateData, job->cb->freeJobPrivate); g_clear_pointer(&job->current, qemuDomainJobInfoFree); g_clear_pointer(&job->completed, qemuDomainJobInfoFree); virCondDestroy(&job->cond); --=20 2.26.2 From nobody Mon Nov 25 13:35:32 2024 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=1600084276; cv=none; d=zohomail.com; s=zohoarc; b=d1hixtgKj5krTC1toGRgpcUio78mVoBP5w/nTLULOxKfSozsML7KnnWRGlLiPWeUQy5P0KpRDNrdtSY59WU3QC8asYZeI1/kVlTVIXeNdEymeuBRfc+Z3zzAvtEssbNG3/JKnFi9wCt7KRNtmetVmZh7C4UOjclqqi+1K54DkCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600084276; 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=HrXzoAZfIyOuHMCZnFysA0Xp0kQuaO9E7PlEzXQN8T0=; b=OPppwut2y1O3QW7A1a9obqZW+enByuwnHdS4nRXYtnmRAyz1FjDqtidSqUv3HzCNcxiBTcT4jz0tB55qMG+t8gRZf/m5yDm5ws70VgTuwoxTEOnB4YQHCQ9EgCt3jtbhD5pU/lUepu7QgLh5Iec0BoOTHyNgh1ETXmU6z+E7zcE= 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) header.from= 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 1600084276186539.9193546246473; Mon, 14 Sep 2020 04:51:16 -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-159-OvmVoxWfNFqMoDSFuvZoZA-1; Mon, 14 Sep 2020 07:51:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64A3818BA288; Mon, 14 Sep 2020 11:51:06 +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 37A7E5C3E0; Mon, 14 Sep 2020 11:51:06 +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 E44C48C7C3; Mon, 14 Sep 2020 11:51:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08EBp3HZ002560 for ; Mon, 14 Sep 2020 07:51:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id E9D401002D42; Mon, 14 Sep 2020 11:51:03 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 723D610021AA for ; Mon, 14 Sep 2020 11:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600084275; 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=HrXzoAZfIyOuHMCZnFysA0Xp0kQuaO9E7PlEzXQN8T0=; b=YWhhkaNSz7xs7KIsYk2LFwUQlO26KXJRxy0aKddUA+3C2kHSYZDEpzw9rRjr+GY63/h3Cl UBXx00oO3chbgl5vWWkdYg16pScPmVnOd5vo1oxBnTBKy79Ul/QKNbzIDxHOPexAlUj6YS F7Zwg84elGVjjj3KLu+jThQlstB+7I0= X-MC-Unique: OvmVoxWfNFqMoDSFuvZoZA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemuProcessReconnect: clear 'oldjob' Date: Mon, 14 Sep 2020 13:49:56 +0200 Message-Id: <04c0ba785af0d513fbd628c210d64db52533c0a9.1600084134.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) After we started copying the privateData pointer in qemuDomainObjRestoreJob, we should also free them once we're done with them. Register the clear function and use g_auto. Also add a check for job->cb to qemuDomainObjClearJob, to prevent freeing an uninitialized job. https://bugzilla.redhat.com/show_bug.cgi?id=3D1878450 Signed-off-by: J=C3=A1n Tomko Fixes: aca37c3fb2e8d733c2788ca4b796c153ea7ce391 Reviewed-by: Michal Privoznik --- src/qemu/qemu_domainjob.c | 3 +++ src/qemu/qemu_domainjob.h | 1 + src/qemu/qemu_process.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index e5910a11a1..3c2c6b9179 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -248,6 +248,9 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj, void qemuDomainObjClearJob(qemuDomainJobObjPtr job) { + if (!job->cb) + return; + qemuDomainObjResetJob(job); qemuDomainObjResetAsyncJob(job); g_clear_pointer(&job->privateData, job->cb->freeJobPrivate); diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index eedd84c503..79f0127252 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -275,6 +275,7 @@ int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobI= nfo, bool qemuDomainTrackJob(qemuDomainJob job); =20 void qemuDomainObjClearJob(qemuDomainJobObjPtr job); +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(qemuDomainJobObj, qemuDomainObjClearJob); =20 int qemuDomainObjInitJob(qemuDomainJobObjPtr job, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b1af35b933..a345edd7fb 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8081,7 +8081,7 @@ qemuProcessReconnect(void *opaque) virQEMUDriverPtr driver =3D data->driver; virDomainObjPtr obj =3D data->obj; qemuDomainObjPrivatePtr priv; - qemuDomainJobObj oldjob; + g_auto(qemuDomainJobObj) oldjob =3D { 0 }; int state; int reason; g_autoptr(virQEMUDriverConfig) cfg =3D NULL; --=20 2.26.2