From nobody Mon Nov 25 10:54:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1606226908; cv=none; d=zohomail.com; s=zohoarc; b=FluXA+88MBThCqqKsfetLlXQJQYWF25+PxfVrk90YHy51mmsZTHF+OTwZG4ao9I59VkYv3UEn7byMg5KFnDFKqwxbV+7HCCgNGVFfhEwCFNmp1lX6En63mRy+D8B5Lj/NxKSrfs6HO1z4bbP54YuMptqwB5qj9sjlBQnyKCViOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606226908; 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=KnA7dBpb/tBz+9vI51FR7gPKqHoFZdmi2HUVawshOAg=; b=HUhwN3MQ10OUleExrsmv628NVP2iBhIg+P27dsxWRJiI67DoyevQDMsuJh4bfe4xk/gzJv9wUS06uOdM2CwIIxpRHInvflE4zpcdg1dhGxLqOtLDSmFI/DVgA7M60Hl02G+JLdEThXqQzv5NCGVZryitnKQniZw+DoszKXZX/58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606226908367105.42068079183764; Tue, 24 Nov 2020 06:08:28 -0800 (PST) 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-318-IWYWauHKPMyELEgAUXuWlQ-1; Tue, 24 Nov 2020 09:02:51 -0500 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 40169805BE0; Tue, 24 Nov 2020 14:02:41 +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 0E29019C71; Tue, 24 Nov 2020 14:02:41 +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 C6F6B57682; Tue, 24 Nov 2020 14:02:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AOE2buN023732 for ; Tue, 24 Nov 2020 09:02:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 35AC05D9CD; Tue, 24 Nov 2020 14:02:37 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2D3E5D9CC for ; Tue, 24 Nov 2020 14:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606226575; 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=KnA7dBpb/tBz+9vI51FR7gPKqHoFZdmi2HUVawshOAg=; b=Av9KJOLAPsfTbk/WvWdmEPm7aCvf8Jn3Z85AV3QFHLyXHW2umXy0DS8K/gxj0ur2aVAchx JFRbRFm67/CljZvvuCkjV4VhHZ7YurlW4U31z6CPBnLt0t26rtQBsXLox5lJawRjaQdTrw r3EcIMrDqMS/sEDLxmNs/vFQt5B8MaI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606226907; 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=KnA7dBpb/tBz+9vI51FR7gPKqHoFZdmi2HUVawshOAg=; b=cq1h0klVs3jhYIHnIk6A+I6XHpVwOQSS6ncyqUiaZp4loneF8woPeWjnlpSfylZHETxnYX SAyRN9iOLSQSy+W4gM0+aZpj1pAwS1rxaYH+L9REkGvohgqAYIBVoCZUJUJwn985Ijbnbi f8wuAL2ZZ3GBm5cUwj1qBzKC6M7+mSU= X-MC-Unique: IWYWauHKPMyELEgAUXuWlQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu: use qemuVirCommandGetDevSet less Date: Tue, 24 Nov 2020 15:02:27 +0100 Message-Id: <6076ad81b8530022d15db0117ca8c53a04a6989d.1606226180.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) (identity @redhat.com) Do not look up the index of the passed FD in places where we already have it. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d9c6c4bc43..33f9b96bf8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4628,7 +4628,6 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManage= r, { if (logManager) { g_autofree char *fdset =3D NULL; - g_autofree char *fdpath =3D NULL; int flags =3D 0; int logfd; size_t idx; @@ -4652,10 +4651,7 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManag= er, virCommandAddArg(cmd, "-add-fd"); virCommandAddArg(cmd, fdset); =20 - if (!(fdpath =3D qemuVirCommandGetDevSet(cmd, logfd))) - return -1; - - virBufferAsprintf(buf, ",%s=3D%s,%s=3Don", filearg, fdpath, append= arg); + virBufferAsprintf(buf, ",%s=3D/dev/fdset/%zu,%s=3Don", filearg, id= x, appendarg); } else { virBufferAsprintf(buf, ",%s=3D", filearg); virQEMUBuildBufferEscapeComma(buf, fileval); @@ -8204,7 +8200,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, =20 virCommandPassFDIndex(cmd, vdpafd, VIR_COMMAND_PASS_FD_CLOSE_PAREN= T, &idx); fdset =3D qemuBuildFDSet(vdpafd, idx); - vdpafdName =3D qemuVirCommandGetDevSet(cmd, vdpafd); + vdpafdName =3D g_strdup_printf("/dev/fdset/%zu", idx); /* set opaque to the devicepath so that we can look up the fdset l= ater * if necessary */ addfdarg =3D g_strdup_printf("%s,opaque=3D%s", fdset, --=20 2.26.2