From patchwork Thu Nov 17 17:36:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9434837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3DDA60755 for ; Thu, 17 Nov 2016 17:39:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E57EB2939E for ; Thu, 17 Nov 2016 17:39:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA49C29687; Thu, 17 Nov 2016 17:39:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7C882939E for ; Thu, 17 Nov 2016 17:39:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7QcO-0000TL-Sk; Thu, 17 Nov 2016 17:37:00 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7QcM-0000OD-Ps for xen-devel@lists.xen.org; Thu, 17 Nov 2016 17:36:58 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id F2/57-20989-ABAED285; Thu, 17 Nov 2016 17:36:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsVyuP0uq+7OV7o RBr9/Slgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBkzLqxnKdg3jbGi48FdtgbGJyldjJwcQgJL GCX+7OMAsdkE7CW6/hxlArFFBKQlrn2+zAhiMwuUSOx92gFmCws4SjROOwdWwyKgKnFo8i5mE JtXwELi+NN/LCC2hIC8xIWrp8BsTqD4gcPnmCF2mUu8ebOACaJeUOLkzCdANRxA89Ul1s8Tgl glL9G8dTbzBEbeWUiqZiFUzUJStYCReRWjRnFqUVlqka6RgV5SUWZ6RkluYmaOrqGBmV5uanF xYnpqTmJSsV5yfu4mRmBIMQDBDsZfywIOMUpyMCmJ8jK/1I0Q4kvKT6nMSCzOiC8qzUktPsQo w8GhJMH78wVQTrAoNT21Ii0zBxjcMGkJDh4lEV5JkFbe4oLE3OLMdIjUKUZFKXHeMJCEAEgio zQPrg0WUZcYZaWEeRmBDhHiKUgtys0sQZV/xSjOwagkzLsIZApPZl4J3PRXQIuZgBbvEdABWV ySiJCSamBs2HB8az+fnqPcMc2ZpueynkZY3BG0MzH0/yrDExRb8tr021yhpIbm1X9L15/PjKx LKNn7M7PG01w+Y8+zO72djzQjkzX3r1t48LlJtdlBV9t9M1Ovv9jIa+eQ5qh3Ouff2ZVKnzZ+ 2Lj0i4zlMj6BD3vX1MkLRF7dzvV2hefhWU3HXFwWK/krsRRnJBpqMRcVJwIAaNPt36MCAAA= X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1479404216!43749993!1 X-Originating-IP: [195.135.221.5] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44430 invoked from network); 17 Nov 2016 17:36:57 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-15.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Nov 2016 17:36:57 -0000 Received: from laptop.vms (mhy71-2-88-167-63-197.fbx.proxad.net [88.167.63.197]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 17 Nov 2016 18:36:55 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Thu, 17 Nov 2016 18:36:07 +0100 Message-Id: <20161117173617.6697-26-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161117173617.6697-1-cbosdonnat@suse.com> References: <20161117173617.6697-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , Cedric Bosdonnat Subject: [Xen-devel] [PATCH v2 25/35] libxl/libxl_pci.c: used LOG*D functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cedric Bosdonnat Use LOG*D logging functions where possible instead of the LOG* ones. Signed-off-by: Cédric Bosdonnat --- tools/libxl/libxl_pci.c | 153 +++++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 74 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 6f8f49c..3b707f3 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -86,7 +86,7 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, front = flexarray_make(gc, 16, 1); back = flexarray_make(gc, 16, 1); - LOG(DEBUG, "Creating pci backend"); + LOGD(DEBUG, domid, "Creating pci backend"); /* add pci device */ libxl__device_from_pcidev(gc, domid, pcidev, &device); @@ -141,7 +141,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d back = flexarray_make(gc, 16, 1); - LOG(DEBUG, "Adding new pci device to xenstore"); + LOGD(DEBUG, domid, "Adding new pci device to xenstore"); num = atoi(num_devs); libxl_create_pci_backend_device(gc, back, num, pcidev); flexarray_append_pair(back, "num_devs", GCSPRINTF("%d", num + 1)); @@ -207,7 +207,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx if (domtype == LIBXL_DOMAIN_TYPE_PV) { if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) { - LOG(DEBUG, "pci backend at %s is not ready", be_path); + LOGD(DEBUG, domid, "pci backend at %s is not ready", be_path); return ERROR_FAIL; } } @@ -222,7 +222,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx } } if (i == num) { - LOG(ERROR, "Couldn't find the device on xenstore"); + LOGD(ERROR, domid, "Couldn't find the device on xenstore"); return ERROR_INVAL; } @@ -236,7 +236,7 @@ retry_transaction: if (domtype == LIBXL_DOMAIN_TYPE_PV) { if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", XenbusStateConnected)) < 0) { - LOG(DEBUG, "pci backend at %s is not ready", be_path); + LOGD(DEBUG, domid, "pci backend at %s is not ready", be_path); return ERROR_FAIL; } } @@ -981,9 +981,9 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid, vdevfn = libxl__xs_read(gc, XBT_NULL, path); path = DEVICE_MODEL_XS_PATH(gc, dm_domid, domid, "/state"); if ( rc < 0 ) - LOG(ERROR, "qemu refused to add device: %s", vdevfn); + LOGD(ERROR, domid, "qemu refused to add device: %s", vdevfn); else if ( sscanf(vdevfn, "0x%x", &pcidev->vdevfn) != 1 ) { - LOG(ERROR, "wrong format for the vdevfn: '%s'", vdevfn); + LOGD(ERROR, domid, "wrong format for the vdevfn: '%s'", vdevfn); rc = -1; } xs_write(ctx->xsh, XBT_NULL, path, state, strlen(state)); @@ -1000,6 +1000,8 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i unsigned long long start, end, flags, size; int irq, i, rc, hvm = 0; uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED; + uint32_t domainid = domid; + bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid); if (type == LIBXL_DOMAIN_TYPE_INVALID) return ERROR_FAIL; @@ -1031,7 +1033,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i irq = 0; if (f == NULL) { - LOGE(ERROR, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); return ERROR_FAIL; } for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) { @@ -1042,10 +1044,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i if (flags & PCI_BAR_IO) { rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 1); if (rc < 0) { - LOGE(ERROR, - "Error: xc_domain_ioport_permission error 0x%llx/0x%llx", - start, - size); + LOGED(ERROR, domainid, + "Error: xc_domain_ioport_permission error 0x%llx/0x%llx", + start, + size); fclose(f); return ERROR_FAIL; } @@ -1053,10 +1055,10 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT, (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 1); if (rc < 0) { - LOGE(ERROR, - "Error: xc_domain_iomem_permission error 0x%llx/0x%llx", - start, - size); + LOGED(ERROR, domainid, + "Error: xc_domain_iomem_permission error 0x%llx/0x%llx", + start, + size); fclose(f); return ERROR_FAIL; } @@ -1068,19 +1070,19 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i pcidev->bus, pcidev->dev, pcidev->func); f = fopen(sysfs_path, "r"); if (f == NULL) { - LOGE(ERROR, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); goto out; } if ((fscanf(f, "%u", &irq) == 1) && irq) { rc = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq); if (rc < 0) { - LOGE(ERROR, "Error: xc_physdev_map_pirq irq=%d", irq); + LOGED(ERROR, domainid, "Error: xc_physdev_map_pirq irq=%d", irq); fclose(f); return ERROR_FAIL; } rc = xc_domain_irq_permission(ctx->xch, domid, irq, 1); if (rc < 0) { - LOGE(ERROR, "Error: xc_domain_irq_permission irq=%d", irq); + LOGED(ERROR, domainid, "Error: xc_domain_irq_permission irq=%d", irq); fclose(f); return ERROR_FAIL; } @@ -1091,22 +1093,22 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i if (pcidev->permissive) { if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/permissive", pcidev) < 0 ) { - LOG(ERROR, "Setting permissive for device"); + LOGD(ERROR, domainid, "Setting permissive for device"); return ERROR_FAIL; } } out: - if (!libxl_is_stubdom(ctx, domid, NULL)) { + if (!isstubdom) { if (pcidev->rdm_policy == LIBXL_RDM_RESERVE_POLICY_STRICT) { flag &= ~XEN_DOMCTL_DEV_RDM_RELAXED; } else if (pcidev->rdm_policy != LIBXL_RDM_RESERVE_POLICY_RELAXED) { - LOGE(ERROR, "unknown rdm check flag."); + LOGED(ERROR, domainid, "unknown rdm check flag."); return ERROR_FAIL; } rc = xc_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev), flag); if (rc < 0 && (hvm || errno != ENOSYS)) { - LOGE(ERROR, "xc_assign_device failed"); + LOGED(ERROR, domainid, "xc_assign_device failed"); return ERROR_FAIL; } } @@ -1130,27 +1132,27 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned char *buf = GCSPRINTF(PCI_BDF, domain, bus, dev, func); rc = write(fd, buf, strlen(buf)); if (rc < 0) - LOG(ERROR, "write to %s returned %d", reset, rc); + LOGD(ERROR, domain, "write to %s returned %d", reset, rc); close(fd); return rc < 0 ? rc : 0; } if (errno != ENOENT) - LOGE(ERROR, "Failed to access pciback path %s", reset); + LOGED(ERROR, domain, "Failed to access pciback path %s", reset); reset = GCSPRINTF("%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func); fd = open(reset, O_WRONLY); if (fd >= 0) { rc = write(fd, "1", 1); if (rc < 0) - LOGE(ERROR, "write to %s returned %d", reset, rc); + LOGED(ERROR, domain, "write to %s returned %d", reset, rc); close(fd); return rc < 0 ? rc : 0; } if (errno == ENOENT) { - LOG(ERROR, - "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, - domain, bus, dev, func); + LOGD(ERROR, domain, + "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, + domain, bus, dev, func); } else { - LOGE(ERROR, "Failed to access reset path %s", reset); + LOGED(ERROR, domain, "Failed to access reset path %s", reset); } return -1; } @@ -1202,11 +1204,11 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide if (libxl__domain_type(gc, domid) == LIBXL_DOMAIN_TYPE_HVM) { rc = xc_test_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev)); if (rc) { - LOG(ERROR, - "PCI device %04x:%02x:%02x.%u %s?", - pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func, - errno == ENOSYS ? "cannot be assigned - no IOMMU" - : "already assigned to a different guest"); + 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" + : "already assigned to a different guest"); goto out; } } @@ -1221,21 +1223,21 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide } if (!libxl_pcidev_assignable(ctx, pcidev)) { - LOG(ERROR, "PCI device %x:%x:%x.%x is not assignable", - pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); + LOGD(ERROR, domid, "PCI device %x:%x:%x.%x is not assignable", + pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); rc = ERROR_FAIL; goto out; } rc = get_all_assigned_devices(gc, &assigned, &num_assigned); if ( rc ) { - LOG(ERROR, - "cannot determine if device is assigned, refusing to continue"); + LOGD(ERROR, domid, + "cannot determine if device is assigned, refusing to continue"); goto out; } if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func) ) { - LOG(ERROR, "PCI device already attached to a domain"); + LOGD(ERROR, domid, "PCI device already attached to a domain"); rc = ERROR_FAIL; goto out; } @@ -1255,7 +1257,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide if ( pcidev->vfunc_mask == LIBXL_PCI_FUNC_ALL ) { if ( !(pcidev->vdevfn >> 3) ) { - LOG(ERROR, "Must specify a v-slot for multi-function devices"); + LOGD(ERROR, domid, "Must specify a v-slot for multi-function devices"); rc = ERROR_INVAL; goto out; } @@ -1301,7 +1303,7 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl__ao *ao, uint32_t domid, for (i = 0; i < d_config->num_pcidevs; i++) { rc = libxl__device_pci_add(gc, domid, &d_config->pcidevs[i], 1); if (rc < 0) { - LOG(ERROR, "libxl_device_pci_add failed: %d", rc); + LOGD(ERROR, domid, "libxl_device_pci_add failed: %d", rc); goto out; } } @@ -1310,7 +1312,7 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl__ao *ao, uint32_t domid, rc = libxl__create_pci_backend(gc, domid, d_config->pcidevs, d_config->num_pcidevs); if (rc < 0) { - LOG(ERROR, "libxl_create_pci_backend failed: %d", rc); + LOGD(ERROR, domid, "libxl_create_pci_backend failed: %d", rc); goto out; } } @@ -1342,7 +1344,7 @@ static int qemu_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libxl__qemu_traditional_cmd(gc, domid, "pci-rem"); if (libxl__wait_for_device_model_deprecated(gc, domid, "pci-removed", NULL, NULL, NULL) < 0) { - LOG(ERROR, "Device Model didn't respond in time"); + LOGD(ERROR, domid, "Device Model didn't respond in time"); /* This depends on guest operating system acknowledging the * SCI, if it doesn't respond in time then we may wish to * force the removal. @@ -1367,6 +1369,9 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, libxl_domain_type type = libxl__domain_type(gc, domid); int hvm = 0, rc, num; int stubdomid = 0; + uint32_t domainid = domid; + bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid); + assigned = libxl_device_pci_list(ctx, domid, &num); if ( assigned == NULL ) @@ -1375,7 +1380,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, rc = ERROR_INVAL; if ( !is_pcidev_in_array(assigned, num, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func) ) { - LOG(ERROR, "PCI device not attached to this domain"); + LOGD(ERROR, domainid, "PCI device not attached to this domain"); goto out_fail; } @@ -1412,7 +1417,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, int i; if (f == NULL) { - LOGE(ERROR, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); goto skip1; } for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) { @@ -1423,18 +1428,18 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, if (flags & PCI_BAR_IO) { rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 0); if (rc < 0) - LOGE(ERROR, - "xc_domain_ioport_permission error 0x%x/0x%x", - start, - size); + LOGED(ERROR, domainid, + "xc_domain_ioport_permission error 0x%x/0x%x", + start, + size); } else { rc = xc_domain_iomem_permission(ctx->xch, domid, start>>XC_PAGE_SHIFT, (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 0); if (rc < 0) - LOGE(ERROR, - "xc_domain_iomem_permission error 0x%x/0x%x", - start, - size); + LOGED(ERROR, domainid, + "xc_domain_iomem_permission error 0x%x/0x%x", + start, + size); } } } @@ -1444,17 +1449,17 @@ skip1: pcidev->bus, pcidev->dev, pcidev->func); f = fopen(sysfs_path, "r"); if (f == NULL) { - LOGE(ERROR, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); goto out; } if ((fscanf(f, "%u", &irq) == 1) && irq) { rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq); if (rc < 0) { - LOGE(ERROR, "xc_physdev_unmap_pirq irq=%d", irq); + LOGED(ERROR, domainid, "xc_physdev_unmap_pirq irq=%d", irq); } rc = xc_domain_irq_permission(ctx->xch, domid, irq, 0); if (rc < 0) { - LOGE(ERROR, "xc_domain_irq_permission irq=%d", irq); + LOGED(ERROR, domainid, "xc_domain_irq_permission irq=%d", irq); } } fclose(f); @@ -1465,10 +1470,10 @@ out: libxl__device_pci_reset(gc, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); } - if (!libxl_is_stubdom(ctx, domid, NULL)) { + if (!isstubdom) { rc = xc_deassign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev)); if (rc < 0 && (hvm || errno != ENOSYS)) - LOGE(ERROR, "xc_deassign_device failed"); + LOGED(ERROR, domainid, "xc_deassign_device failed"); } stubdomid = libxl_get_stubdom_id(ctx, domid); @@ -1655,17 +1660,17 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid, FILE *f = fopen(pci_device_class_path, "r"); if (!f) { - LOGE(ERROR, - "pci device "PCI_BDF" does not have class attribute", - pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); + LOGED(ERROR, domid, + "pci device "PCI_BDF" does not have class attribute", + pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); continue; } read_items = fscanf(f, "0x%lx\n", &pci_device_class); fclose(f); if (read_items != 1) { - LOGE(ERROR, - "cannot read class of pci device "PCI_BDF, - pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); + LOGED(ERROR, domid, + "cannot read class of pci device "PCI_BDF, + pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); continue; } if (pci_device_class != 0x030000) /* VGA class */ @@ -1675,20 +1680,20 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid, ret = xc_domain_iomem_permission(CTX->xch, stubdom_domid, vga_iomem_start, 0x20, 1); if (ret < 0) { - LOGE(ERROR, - "failed to give stubdom%d access to iomem range " - "%"PRIx64"-%"PRIx64" for VGA passthru", - stubdom_domid, - vga_iomem_start, (vga_iomem_start + 0x20 - 1)); + LOGED(ERROR, domid, + "failed to give stubdom%d access to iomem range " + "%"PRIx64"-%"PRIx64" for VGA passthru", + stubdom_domid, + vga_iomem_start, (vga_iomem_start + 0x20 - 1)); return ret; } ret = xc_domain_iomem_permission(CTX->xch, domid, vga_iomem_start, 0x20, 1); if (ret < 0) { - LOGE(ERROR, - "failed to give dom%d access to iomem range " - "%"PRIx64"-%"PRIx64" for VGA passthru", - domid, vga_iomem_start, (vga_iomem_start + 0x20 - 1)); + LOGED(ERROR, domid, + "failed to give dom%d access to iomem range " + "%"PRIx64"-%"PRIx64" for VGA passthru", + domid, vga_iomem_start, (vga_iomem_start + 0x20 - 1)); return ret; } break;