From patchwork Sun Jun 14 16:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Uriasz X-Patchwork-Id: 11603355 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C44BA618 for ; Sun, 14 Jun 2020 16:19:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 928CB206D7 for ; Sun, 14 Jun 2020 16:19:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OgmSgp0Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 928CB206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkVKC-0004tY-NZ; Sun, 14 Jun 2020 16:17:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jkVKA-0004tT-Kj for xen-devel@lists.xenproject.org; Sun, 14 Jun 2020 16:17:34 +0000 X-Inumbo-ID: 8d9f0812-ae5a-11ea-8496-bc764e2007e4 Received: from mail-ej1-x642.google.com (unknown [2a00:1450:4864:20::642]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8d9f0812-ae5a-11ea-8496-bc764e2007e4; Sun, 14 Jun 2020 16:17:34 +0000 (UTC) Received: by mail-ej1-x642.google.com with SMTP id q19so14836778eja.7 for ; Sun, 14 Jun 2020 09:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C3mRdoRg64BYc4ys1yIyprFZdBXkem8fN8ugpNmuLtA=; b=OgmSgp0YvbM4MjXhwP44uDmQ9IJchTdgBfvwlcsY4z0Knp2mv3PlL6fcJcdpuNKafO 1itnNmVeSD44yfoyyoVvnyGiTCmMQZi+2fxf9j+tNpyj45zMHojjthi+HrdZvsqga9VT CcxaV92AnGeqoXnsZZYFcom6qGjnFkpQKaAViILeMdHtQ08KrVUfLlDrUr3HVqhTirpP JS1Z/8K5xNQ3Ey0afUOGavvpflzd3cKTr1aWTn4jw+uZVabvC10AuR6HjTED73OLi45V F/ddhM+o7fp3RAO1otiEaNDoN6PkPgOXW5NUvQ8QSI4HhKdPTr0Z13Y5nIDy4YUCpCkd ss+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C3mRdoRg64BYc4ys1yIyprFZdBXkem8fN8ugpNmuLtA=; b=SxU3gKfRhF+TXzG6hRxJOZ0mP5eOy76Geyb9jcJdZodOv6jGDK/JlRFKx3AT7wmtE9 mathdpxNh3FgVADYqs04GhUtvIeOaHWop6RWa7UDHmUy9p3JB+Np8jNKoMieG7Q5bSn5 GhO+0HD7+XxxDYmwmogrxa89HEqnaXibLklNqTJq/Hjy9tdZgWa3627p/CqmhFcvpCmx miPWHhZFJDsQHLK/ToAPlpJ5r0qEaIUJVfPYqDjK+yxVZHMR4m8LUqKdH728/ja47SdR A7aKLCciq6hhToBNVbkp5nuwFQaM6U2/bysbYs+KMggtcFldgXbl8R0eoV5J0DbMFSLA 0BGw== X-Gm-Message-State: AOAM530kcSaIGB6LjWfIOuVndE7KW7NgUI9wngiVkRn76MJOZdETVRQ1 SwVRckc71JTQO6MiRkSVm2QrG2lvyX/4tg== X-Google-Smtp-Source: ABdhPJzu809FPnL+SaqbdfLTTjXT3ClJxmAO7HnV+sg36krRUjBee4Bzk6FUlRj35IvMH7D64wzQhw== X-Received: by 2002:a17:906:1fcd:: with SMTP id e13mr21718301ejt.472.1592151452843; Sun, 14 Jun 2020 09:17:32 -0700 (PDT) Received: from localhost.localdomain (public-gprs354212.centertel.pl. [37.47.14.229]) by smtp.gmail.com with ESMTPSA id g25sm6752429edq.34.2020.06.14.09.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 09:17:32 -0700 (PDT) From: Grzegorz Uriasz To: xen-devel@lists.xenproject.org Subject: [PATCH] libxl: tooling expects wrong errno Date: Sun, 14 Jun 2020 16:17:08 +0000 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , jakub@bartmin.ski, Ian Jackson , marmarek@invisiblethingslab.com, Grzegorz Uriasz , j.nowak26@student.uw.edu.pl, Anthony PERARD , contact@puzio.waw.pl Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When iommu is not enabled for a given domain then pci passthrough hypercalls such as xc_test_assign_device return EOPNOTSUPP. The code responsible for this is in "iommu_do_domctl" inside xen/drivers/passthrough/iommu.c This patch fixes the error message reported by libxl when assigning pci devices to domains without iommu. Signed-off-by: Grzegorz Uriasz Tested-by: Grzegorz Uriasz Acked-by: Ian Jackson --- tools/libxl/libxl_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 957ff5c8e9..bc5843b137 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1561,7 +1561,7 @@ void libxl__device_pci_add(libxl__egc *egc, uint32_t domid, LOGD(ERROR, domid, "PCI device %04x:%02x:%02x.%u %s?", pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func, - errno == ENOSYS ? "cannot be assigned - no IOMMU" + errno == EOPNOTSUPP ? "cannot be assigned - no IOMMU" : "already assigned to a different guest"); goto out; }