From nobody Mon Feb 9 02:14:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1630940353; cv=none; d=zohomail.com; s=zohoarc; b=cPtp9eby3l3DhO9XeFXVJyhNwHfrQi+ctSnp29fiiCJItUGUqDuJEOwcAbvD/e0TP2hHLed2Mv9NI5wP4Xb7h5nmUfRbYDJohDqwkHv43ElPY7gyhndwI/0XJWz2ZAvCWicYtDXUHQoEaLQC4ooogySyszvKi4FqBIrflqa22JU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630940353; 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=fDH9ZDdmpsVrkPigrgJkLKd4pOrjyA9seT70m+t2QQQ=; b=b55uQd5Xzs+F/AUuSJFP2OQJKDhdcV5krGcclCvFli879j3OfaB1UsFyTxXW5cP0W1/fJ7/puctUUhpcr+VOLty2UbT7po4aNC3mfKASYa2P/IxS14q7tw+d+cG9c9d14Zna9wsNt4CkUSlX6pQWMibO4ulMvgBpG1qIuQaF/qs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1630940353208138.91929234234215; Mon, 6 Sep 2021 07:59:13 -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-5-xZuEnJvDNpKkHy-Q8xnqOw-1; Mon, 06 Sep 2021 10:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB3FA18766D4; Mon, 6 Sep 2021 14:59:04 +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 903B36A255; Mon, 6 Sep 2021 14:59:04 +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 636B7180B44F; Mon, 6 Sep 2021 14:59:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 186EwwTf004497 for ; Mon, 6 Sep 2021 10:58:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 24D60779D2; Mon, 6 Sep 2021 14:58:58 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A39656608B for ; Mon, 6 Sep 2021 14:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630940352; 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=fDH9ZDdmpsVrkPigrgJkLKd4pOrjyA9seT70m+t2QQQ=; b=E5PHN7kEL362gbSafvJqCVLqmA2vneZh1VZrkMupGjrclKzsB1HGPNjj+Dm8RJ6vphVoqD u9ZH7aLY4z/1nAJoJI6Eu0frnIoFJDCGcMQXRHPxz9Oq2JY4fzCVm5P+GBeyL2cYPQ7lxu o0cnwYQHhn/SGujtwpuq1WP/5IKHh7U= X-MC-Unique: xZuEnJvDNpKkHy-Q8xnqOw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/6] libxl: use g_auto in libxlDomainGetEmulatorType Date: Mon, 6 Sep 2021 16:58:49 +0200 Message-Id: <7d71b1862b11f83985824afabdf05c44d63178ed.1630939770.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630940355365100001 Signed-off-by: J=C3=A1n Tomko --- src/libxl/libxl_capabilities.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index ef77bec7a0..a516910215 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -715,13 +715,13 @@ int libxlDomainGetEmulatorType(const virDomainDef *def) { int ret =3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; - virCommand *cmd =3D NULL; + g_autoptr(virCommand) cmd =3D NULL; g_autofree char *output =3D NULL; =20 if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) { if (def->emulator) { if (!virFileExists(def->emulator)) - goto cleanup; + return ret; =20 cmd =3D virCommandNew(def->emulator); =20 @@ -729,14 +729,12 @@ libxlDomainGetEmulatorType(const virDomainDef *def) virCommandSetOutputBuffer(cmd, &output); =20 if (virCommandRun(cmd, NULL) < 0) - goto cleanup; + return ret; =20 if (strstr(output, LIBXL_QEMU_DM_STR)) ret =3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; } } =20 - cleanup: - virCommandFree(cmd); return ret; } --=20 2.31.1