From nobody Mon Feb 9 10:54:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1682065563; cv=none; d=zohomail.com; s=zohoarc; b=dF+LUA4Jh12GE1e415Yh8qPGqfV6BuOqdMdQ78mabQeJCQLUcUYNtCK/mDsAaxeG1RI1OBTZ4BU32Ff6lCiXeCjbmJ+QHtMbcGknK3xe52QkbDzZaX03/FvWvANp1ECHbFSNpueZMEOxgvJyWaQY5RXkkEIHzedNT/BdRqFXmNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065563; 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=/jgFnU0GkIbi8DSEck3yBLLz82B7QFSADL00SAedCXQ=; b=YrhH+2qI379dYIe5uk0zOyGr8PXUuww71d0QNYPiUNWA1DcH6VHn99pll18WxhhKzvqmItS7vKloLUNoV0B5DNrv8wvHKJ/qNWNKx2UPpD+lu7j3KPysKfbTsuX6Be7BPjlyxT1ZqOVclXpzebjllBUiqF7c+YB8Dlffr2Owb9Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1682065563772646.8768189623092; Fri, 21 Apr 2023 01:26:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-KylYdp9INbisJ7_dhLJUqg-1; Fri, 21 Apr 2023 04:25:23 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A032C2999B2A; Fri, 21 Apr 2023 08:25:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BA21492C13; Fri, 21 Apr 2023 08:25:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 71A6D1946A40; Fri, 21 Apr 2023 08:25:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 43DBC19466DF for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3A18163A51; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D63CD63A68 for ; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065562; 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=/jgFnU0GkIbi8DSEck3yBLLz82B7QFSADL00SAedCXQ=; b=DmZZUJm4xigIwlf5HkymqVViFBlwvZZ33c04fpo3jbVCeidunM/TCnEwSMwntDLGbBWy43 dAGcQ/X6onpAGaGxTTKh6JCUiI0ffuxBbwyiQ1dFZXFe9m0/P6GBsp/9LwfakSBqw481/T BxVqRLW55kWJX72yvMaqlxRnmEsmOSM= X-MC-Unique: KylYdp9INbisJ7_dhLJUqg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 10/11] qemuhotplugtest: use g_autoptr(virDomainDeviceDef) Date: Fri, 21 Apr 2023 10:25:09 +0200 Message-Id: <55f25c6b9f560538b7a4830626caee4314b33150.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1682065565036100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This brings us one step closer to the caller of qemuDomainAttachDeviceLive() (qemuDomainAttachDeviceLiveAndConfig()). Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- tests/qemuhotplugtest.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d5ceb1373b..fffb4a3410 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -154,7 +154,7 @@ testQemuHotplug(const void *data) bool keep =3D test->keep; unsigned int device_parse_flags =3D 0; virDomainObj *vm =3D NULL; - virDomainDeviceDef *dev =3D NULL; + g_autoptr(virDomainDeviceDef) dev =3D NULL; g_autoptr(qemuMonitorTest) test_mon =3D NULL; qemuDomainObjPrivate *priv =3D NULL; =20 @@ -229,11 +229,6 @@ testQemuHotplug(const void *data) switch (test->action) { case ATTACH: ret =3D qemuDomainAttachDeviceLive(vm, dev, &driver); - if (ret =3D=3D 0) { - /* vm->def stolen dev->data.* so we just need to free the dev - * envelope */ - VIR_FREE(dev); - } if (ret =3D=3D 0 || fail) ret =3D testQemuHotplugCheckResult(vm, result_xml, result_filename, fail); @@ -262,7 +257,6 @@ testQemuHotplug(const void *data) virObjectUnref(vm); test->vm =3D NULL; } - virDomainDeviceDefFree(dev); return ((ret < 0 && fail) || (!ret && !fail)) ? 0 : -1; } =20 --=20 2.39.2