From nobody Thu May 2 16:46:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490892954913274.01343291619867; Thu, 30 Mar 2017 09:55:54 -0700 (PDT) Received: from localhost ([::1]:36799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctdMX-0003Jh-Sf for importer@patchew.org; Thu, 30 Mar 2017 12:55:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctdLp-0002z2-GI for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctdLk-0002QH-Hd for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:55:09 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctdLk-0002Ph-8M for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:55:04 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2UGs7ln019050 for ; Thu, 30 Mar 2017 12:55:01 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 29h4bn5e23-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 30 Mar 2017 12:55:01 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Mar 2017 10:55:00 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Mar 2017 10:54:57 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2UGsuTM11141408; Thu, 30 Mar 2017 09:54:56 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B26A46A048; Thu, 30 Mar 2017 10:54:56 -0600 (MDT) Received: from localhost (unknown [9.53.92.194]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 9D8416A041; Thu, 30 Mar 2017 10:54:56 -0600 (MDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 30 Mar 2017 11:54:12 -0500 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 17033016-0012-0000-0000-000013F77267 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006875; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00840853; UDB=6.00413915; IPR=6.00618865; BA=6.00005248; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014865; XFM=3.00000013; UTC=2017-03-30 16:54:59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17033016-0013-0000-0000-00004C9AA531 Message-Id: <1490892852-6771-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-30_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703300147 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH for-2.9] qga: don't fail if mount doesn't have slave devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In some cases the slave devices of a virtual block device are tracked by the parent in the corresponding sysfs node. For instance, if we have a loop-back mount of the form: /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=3Dordered) this will be reflected in sysfs as: /sys/devices/virtual/block/loop3/ ... /sys/devices/virtual/block/loop3/slaves /sys/devices/virtual/block/loop3/loop3p1 The current code however assumes the mounted virtual block device, loop3p1 in this case, contains the slaves directory, and reports an error otherwise. This breaks 'make check' in certain environments. Fix this by simply skipping attempts to generate disk topology information in these cases. Since this information is documented in QAPI as optionally-reported, this should be ok from an API perspective. In the future, this can possibly be improved upon by collecting topology information from the parent in these cases. Reported-by: Peter Maydell Cc: Peter Maydell Signed-off-by: Michael Roth Tested-by: Peter Maydell --- qga/commands-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 73d93eb..915df9e 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -999,7 +999,9 @@ static void build_guest_fsinfo_for_virtual_device(char = const *syspath, dirpath =3D g_strdup_printf("%s/slaves", syspath); dir =3D opendir(dirpath); if (!dir) { - error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath); + if (errno !=3D ENOENT) { + error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath); + } g_free(dirpath); return; } --=20 2.7.4