From nobody Mon May 6 07:25:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534887344737108.12570463958377; Tue, 21 Aug 2018 14:35:44 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B6C663002707; Tue, 21 Aug 2018 21:35: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 ADE6977EF9; Tue, 21 Aug 2018 21:35:40 +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 8D1174BB75; Tue, 21 Aug 2018 21:35:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7LLVfaN015424 for ; Tue, 21 Aug 2018 17:31:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6373826DE5; Tue, 21 Aug 2018 21:31:41 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59E0D26DDC for ; Tue, 21 Aug 2018 21:31:38 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADD638553D for ; Tue, 21 Aug 2018 21:31:36 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id D0E5E418F7 for ; Tue, 21 Aug 2018 21:31:34 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixKStt7WpXXE for ; Wed, 22 Aug 2018 00:31:33 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id AF302411F8 for ; Wed, 22 Aug 2018 00:31:33 +0300 (MSK) Received: from localhost (172.17.128.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 22 Aug 2018 00:31:33 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received:received; s= mta-01; t=1534887093; x=1536701494; bh=VBCwCCq1JEvqiuEbSZTEHPiJk CoMSoFVFeg1NUc8qnI=; b=WSHZRYy7LaDqjl3LkwGFA4dzx6dZPUdsNAnFl7+lH ihNyejFT+mUnqts+MUpj9AGZou7Qy1x/3RqZgd1zG7WeV0lKMzKGwah5CMICMLiw ACCv7HfMtPamtyUhBIsNG0tAyE0g9rjQUfILLSOSoqQL4NFlx6c79EWG5gXKDe6K 3Y= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 22 Aug 2018 00:31:29 +0300 Message-ID: <20180821213129.11381-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.128.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 212 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 21 Aug 2018 21:31:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 21 Aug 2018 21:31:36 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH] qemu: Start domain on a node without cpu affinity 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 21 Aug 2018 21:35:43 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" libvirt affinity wrappers don't support macOS Thread Affinity API: https://developer.apple.com/library/archive/releasenotes/Performance/RN-Aff= inityAPI/index.html virProcessSetAffinity stub prevents libvirt from starting a qemu domain on macOS: $ virsh start vm error: Failed to start domain vm error: Process CPU affinity is not supported on this platform: Function not= implemented With the patch a VM can be started on macOS but some affinity-related commands will return errors: $ virsh vcpuinfo vm error: Requested operation is not valid: cpu affinity is not supported $ virsh vcpupin vm VCPU: CPU Affinity ---------------------------------- 0: 0-7 $ virsh vcpupin vm --live --vcpu 0 --cpulist 7 error: operation failed: Virt type 'qemu' does not support vCPU pinning $ virsh emulatorpin vm emulator: CPU Affinity ---------------------------------- *: 0-7 $ virsh emulatorpin vm --live --cpulist 7 error: Requested operation is not valid: cpu affinity is not supported The patch also fixes virmacmaptest on macOS Signed-off-by: Roman Bolshakov --- src/qemu/qemu_driver.c | 6 ++++++ src/util/virprocess.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 21e9e87ddd..2e225b1ede 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5245,6 +5245,12 @@ qemuDomainPinEmulator(virDomainPtr dom, if (virDomainPinEmulatorEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 + if (!qemuDomainHasVcpuPids(vm)) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cpu affinity is not supported")); + goto cleanup; + } + if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) goto cleanup; =20 diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 3988f5546c..7eaafd29f2 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -598,7 +598,7 @@ int virProcessSetAffinity(pid_t pid ATTRIBUTE_UNUSED, { virReportSystemError(ENOSYS, "%s", _("Process CPU affinity is not supported on this = platform")); - return -1; + return 0; } =20 virBitmapPtr --=20 2.15.2 (Apple Git-101.1) -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list