From nobody Thu May 2 08:10:01 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; dkim=fail; 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=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521729300337950.4528349755733; Thu, 22 Mar 2018 07:35:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05D55ACB2; Thu, 22 Mar 2018 14:34:58 +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 C57897E66C; Thu, 22 Mar 2018 14:34:57 +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 894894CA9D; Thu, 22 Mar 2018 14:34:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2MEYuhe020915 for ; Thu, 22 Mar 2018 10:34:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED354825FA; Thu, 22 Mar 2018 14:34:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6106825E7 for ; Thu, 22 Mar 2018 14:34:51 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 035C612E371 for ; Thu, 22 Mar 2018 14:34:49 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id u11-v6so5416558plq.1 for ; Thu, 22 Mar 2018 07:34:48 -0700 (PDT) Received: from localhost.localdomain ([14.139.160.235]) by smtp.gmail.com with ESMTPSA id c62sm14928380pfk.179.2018.03.22.07.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Mar 2018 07:34:47 -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; bh=iFAcwkYYHOw/fdyDtijmJzu+hVfsxNRjf+1/gYHDIPo=; b=iAMvcv/iOqCod7B9En6mQFwUw86IwqxHmIR7vAgUv1Nf0t26MXWfXZN8+4FHPMxDoo mW3LXIYVwsEIbSqzzDgb1AoAIeO4ZJzcz+YU66I12OUse8j3NuoCMD17iOesykcBKhVC JU849ACA1SzpFDzj3urNUtcDvRoksBMaCrh5vJOqHrwKgVCQTeQWN/gxw4O6/1hkmtEy dipxP+JrXMB3M/c3XSqJ5d2jM1YBuabJtF3oOAB23SDNEOMgJtw41U8sXTc4anUgv/m/ 46qAxE0Ryx7MtSGx0KcHKRD8O7nOMyHlZN7I4SPm5fZQCzhafSPPJZsOjeoH5GwwOPjM cC8w== 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; bh=iFAcwkYYHOw/fdyDtijmJzu+hVfsxNRjf+1/gYHDIPo=; b=XIT8OXVdfDd5nUqFsoIHOS3bTCyUfmS0uwF5Tj901X+pfwODVevVr+6aQY08fZmJLu J9zNxElHF9vmeXD8xa9rB+/M6uPKl+KQ+ieT95CEOEpGphedQi0PLrdIr2dS3cKm6O24 2ksKnKOawP87AjTzRLeWcR9D/JRh4hg+X8jBQg2PoyLoLbJAS9Zy6erjQq9BQF0bEaze WdjdjyADn1phi0GsOF7de5EMqQaQzgt7pLenBvnQhkfzUc+CE7pWrxfHOCpE5KT6vE9J I0cZuvBAfkNct0wy+dVNC90inFpiN9MDeR2XB3wIKneudlbuSG+cEnq/xMlHvfNiYA2I c1vQ== X-Gm-Message-State: AElRT7F7Sln8z56wBoakjMQVVacZV7Z4dSIZVSfWbjIXt1deH43fe1ld O5TjHe2hK4rOUdpTTXQBJMkToj4H X-Google-Smtp-Source: AG47ELth6DFBLDMjvJILBRlgZ5tqf2gv8XT9STMuRk1fSIpeculvuWjAfDTKybVGClXAiRUyqRsFDQ== X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr17171169plh.84.1521729288269; Thu, 22 Mar 2018 07:34:48 -0700 (PDT) From: Prafull To: libvir-list@redhat.com Date: Thu, 22 Mar 2018 20:04:35 +0530 Message-Id: <1521729275-31177-1-git-send-email-talep158@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 22 Mar 2018 14:34:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 22 Mar 2018 14:34:49 +0000 (UTC) for IP:'209.85.160.68' DOMAIN:'mail-pl0-f68.google.com' HELO:'mail-pl0-f68.google.com' FROM:'talep158@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.12 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.160.68 mail-pl0-f68.google.com 209.85.160.68 mail-pl0-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Prafull Subject: [libvirt] [PATCH] lxc: report error message raised by the failing function 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: , MIME-Version: 1.0 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 22 Mar 2018 14:34:58 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The code that calls VIR_WARN after a function fails, doesn't report the error message raised by the failing function. Such error messages are now reported in lxc/lxc_driver.c Signed-off-by: Prafullkumar T --- src/lxc/lxc_driver.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 4f6b93b..4f600f3 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -3915,8 +3915,8 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver, major(sb.st_rdev), minor(sb.st_rdev), perms) < 0) - VIR_WARN("cannot deny device %s for domain %s", - src, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + src, vm->def->name, virGetLastErrorMessage()); goto cleanup; } =20 @@ -4011,8 +4011,8 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn, goto cleanup; } else { VIR_WARN("setting bandwidth on interfaces of " - "type '%s' is not implemented yet", - virDomainNetTypeToString(actualType)); + "type '%s' is not implemented yet: %s", + virDomainNetTypeToString(actualType), virGetLastError= Message()); } } =20 @@ -4116,8 +4116,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDrive= rPtr driver, if (virUSBDeviceFileIterate(usb, virLXCTeardownHostUSBDeviceCgroup, priv->cgroup) < 0) - VIR_WARN("cannot deny device %s for domain %s", - src, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + src, vm->def->name, virGetLastErrorMessage()); goto cleanup; } =20 @@ -4190,8 +4190,8 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverP= tr driver, major(sb.st_rdev), minor(sb.st_rdev), VIR_CGROUP_DEVICE_RWM) < 0) - VIR_WARN("cannot deny device %s for domain %s", - def->source.caps.u.storage.block, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + def->source.caps.u.storage.block, vm->def->name, virG= etLastErrorMessage()); goto cleanup; } =20 @@ -4262,8 +4262,8 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr = driver, major(sb.st_rdev), minor(sb.st_rdev), VIR_CGROUP_DEVICE_RWM) < 0) - VIR_WARN("cannot deny device %s for domain %s", - def->source.caps.u.storage.block, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + def->source.caps.u.storage.block, vm->def->name, virG= etLastErrorMessage()); goto cleanup; } =20 @@ -4434,8 +4434,8 @@ lxcDomainDetachDeviceDiskLive(virDomainObjPtr vm, =20 if (virCgroupDenyDevicePath(priv->cgroup, src, VIR_CGROUP_DEVICE_RWM, false) !=3D 0) - VIR_WARN("cannot deny device %s for domain %s", - src, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + src, vm->def->name, virGetLastErrorMessage()); =20 virDomainDiskRemove(vm->def, idx); virDomainDiskDefFree(def); @@ -4567,8 +4567,8 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr d= river, if (virUSBDeviceFileIterate(usb, virLXCTeardownHostUSBDeviceCgroup, priv->cgroup) < 0) - VIR_WARN("cannot deny device %s for domain %s", - dst, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + dst, vm->def->name, virGetLastErrorMessage()); =20 virObjectLock(hostdev_mgr->activeUSBHostdevs); virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb); @@ -4623,8 +4623,8 @@ lxcDomainDetachDeviceHostdevStorageLive(virDomainObjP= tr vm, =20 if (virCgroupDenyDevicePath(priv->cgroup, def->source.caps.u.storage.b= lock, VIR_CGROUP_DEVICE_RWM, false) !=3D 0) - VIR_WARN("cannot deny device %s for domain %s", - def->source.caps.u.storage.block, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + def->source.caps.u.storage.block, vm->def->name, virGetLa= stErrorMessage()); =20 virDomainHostdevRemove(vm->def, idx); virDomainHostdevDefFree(def); @@ -4673,8 +4673,8 @@ lxcDomainDetachDeviceHostdevMiscLive(virDomainObjPtr = vm, =20 if (virCgroupDenyDevicePath(priv->cgroup, def->source.caps.u.misc.char= dev, VIR_CGROUP_DEVICE_RWM, false) !=3D 0) - VIR_WARN("cannot deny device %s for domain %s", - def->source.caps.u.misc.chardev, vm->def->name); + VIR_WARN("cannot deny device %s for domain %s: %s", + def->source.caps.u.misc.chardev, vm->def->name, virGetLas= tErrorMessage()); =20 virDomainHostdevRemove(vm->def, idx); virDomainHostdevDefFree(def); --=20 2.1.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list