From patchwork Fri Dec 2 15:08:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9458749 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 C46F860236 for ; Fri, 2 Dec 2016 15:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5718284E2 for ; Fri, 2 Dec 2016 15:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA5AA28556; Fri, 2 Dec 2016 15:12:04 +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 B99CE28542 for ; Fri, 2 Dec 2016 15:12:03 +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 1cCpSo-0003Nv-Lw; Fri, 02 Dec 2016 15:09:26 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpSm-0003IB-QY for xen-devel@lists.xen.org; Fri, 02 Dec 2016 15:09:25 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id 10/10-28568-4AE81485; Fri, 02 Dec 2016 15:09:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsVyuP0uq+7iPsc Ig9O/eC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy/Gy4xFzybxlhxceMd9gbGjtQuRi4OIYEl jBL7Jkxj6WLk5GATsJfo+nOUCcQWEZCWuPb5MiOIzSxQItF0rpMZxBYWcJRonHYOrIZFQFXi1 bZFrCA2r4ClxOXdJ8HmSAjISyw8fwSshhMo/qDlOtgcIQELieYbd1gg6gUlTs58AmRzAM1Xl1 g/TwhilbxE89bZzBMYeWchqZqFUDULSdUCRuZVjBrFqUVlqUW6huZ6SUWZ6RkluYmZObqGBmZ 6uanFxYnpqTmJScV6yfm5mxiBQcUABDsYb28MOMQoycGkJMprmuMYIcSXlJ9SmZFYnBFfVJqT WnyIUYaDQ0mC16wbKCdYlJqeWpGWmQMMb5i0BAePkgivK0iat7ggMbc4Mx0idYpRUUqcNw4kI QCSyCjNg2uDxdQlRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCfNqgEzhycwrgZv+CmgxE9Diju v2IItLEhFSUg2MUy/PVbOc9d0+Qd9FvLVf4nLs26aXTUonba4fX/wk8fGjrrw0QZn69TmWHe0 a+/hOKNc/FZzveJXVyHjzG2+uyaLcb5L6lmb5vzB0OpRaccdQkSNtpVF8guH/tfO95lWHHSyQ 9WQ4Ilyjv3/7+impjRX/9nwPXRmw5PbrjoN3F9w0qGJp+8imxFKckWioxVxUnAgAtgyGpqQCA AA= X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1480691362!22506415!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 58194 invoked from network); 2 Dec 2016 15:09:23 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Dec 2016 15:09:23 -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); Fri, 02 Dec 2016 16:09:21 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 2 Dec 2016 16:08:31 +0100 Message-Id: <20161202150841.31227-26-cbosdonnat@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161202150841.31227-1-cbosdonnat@suse.com> References: <20161202150841.31227-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Ian Jackson , Wei Liu , 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 Acked-by: Wei Liu --- 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;