From nobody Thu May 2 20:24:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1579163358; cv=none; d=zohomail.com; s=zohoarc; b=XHYnnEEAN5GsTzfw7pyUfKkEpIwGcU04l55R0tYBcCssrLhHsxSE8sGtoe9QHOIAEmuNTQ0j4qmHtM1En7xkc3V1h/TVuoBZihpQ8eHqF4eZgA33EKNSn86q9yXfRjIN921AJgOBTPLOoDRBrCT8f2MdMBDA/7JT/azHeWpj0vI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579163358; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T3OVo0+sT0EdW8GBjk0geQ5mDOB1EdtJF7EOqbfqiFs=; b=mjr5jOB9bXmzR0BQ7DgnR+INHbz707OAoM4cXHLJ13pGylHt3MC6qf1g+dpRTF5h8vqpvDrNN2BrZLek3ilxBcOmqutG/tWKmnWns3ECKG8HRfxnI+qzlx8BW4/DufBkbyc3HsB8R1VMnubfXffIF5ktX7YQsE+IMszDGaEem4I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157916335894615.959526503761367; Thu, 16 Jan 2020 00:29:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-QgXI1LHLPY-cRGMhTX0MBw-1; Thu, 16 Jan 2020 03:29:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3339107ACC7; Thu, 16 Jan 2020 08:29:08 +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 4BBCD88888; Thu, 16 Jan 2020 08:29:08 +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 697478251E; Thu, 16 Jan 2020 08:29:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00G8T3KP000623 for ; Thu, 16 Jan 2020 03:29:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id D1D12F18D1; Thu, 16 Jan 2020 08:29:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD03AF18DD for ; Thu, 16 Jan 2020 08:29:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5EDE51011E26 for ; Thu, 16 Jan 2020 08:29:01 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-hVHZFn2fM7G2BMHKr6Wbbw-1; Thu, 16 Jan 2020 03:28:59 -0500 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1is0WQ-0008MN-Bh; Thu, 16 Jan 2020 08:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579163357; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=T3OVo0+sT0EdW8GBjk0geQ5mDOB1EdtJF7EOqbfqiFs=; b=GnzZOifu7l/xyPkhhNP3rOXx++oiu/BCAsHHdvBuuiVgLHEo2Whz8apisEiKuuVnezkX2t cIidh/lNU6wPPuqiXTNoRzB+mh76gUhmvODLuA6Y+xQ4+/FbdH17mfsewHkYLOTcan4oqy guYGTnz6BxZXQn5zmzCgxaF/MtS8b5k= From: Christian Ehrhardt To: libvir-list@redhat.com Date: Thu, 16 Jan 2020 09:28:55 +0100 Message-Id: <20200116082856.4040-2-christian.ehrhardt@canonical.com> In-Reply-To: <20200116082856.4040-1-christian.ehrhardt@canonical.com> References: <20200116082856.4040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 X-MC-Unique: hVHZFn2fM7G2BMHKr6Wbbw-1 X-MC-Unique: QgXI1LHLPY-cRGMhTX0MBw-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00G8T3KP000623 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Guido=20G=C3=BCnther?= , Daniel Henrique Barboza , Christian Ehrhardt Subject: [libvirt] [PATCH v2 1/2] test: let qemuhotplugtest report details of init fails 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If virHostdevManagerGetDefault in qemuhotplugtest fails it works for quite a while to later segfault when accessing mgr->activePCIHostdevs. Report the error details and break on a failed init to see the real issue right away. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Christian Ehrhardt Reviewed-by: Andrea Bolognani --- tests/qemuhotplugtest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index a60c8d1c93..6a3e61c54b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -634,6 +634,11 @@ mymain(void) return EXIT_FAILURE; =20 driver.hostdevMgr =3D virHostdevManagerGetDefault(); + if (driver.hostdevMgr =3D=3D NULL) { + VIR_TEST_VERBOSE("Could not initialize HostdevManager - %s\n", + virGetLastErrorMessage()); + return EXIT_FAILURE; + } =20 =20 #define DO_TEST(file, ACTION, dev, fial, kep, ...) \ --=20 2.25.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 20:24:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1579163358; cv=none; d=zohomail.com; s=zohoarc; b=ErSKFkj3H6W5ki4CvkKpl5K1OJyF7Uz9O5pOsvlz3L/nIj97mPMGpIddg+z5IgOnj0oS6cIGBwcDb8ysv+cHYoF1/IYCBxudUnVwqe0mK88yk9DqR6+Qpwg8WnTDjWL/00jltPdzytgRW4Qyatp0CcUJOJ+8NtGLmImKND0bHkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579163358; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hXff0MhVXoQQeCOsKAJxeckJl1miKZWS5shY6LNbsxU=; b=Pwk+t4LpY3xXa+p7R6zEnxjyQGPZml3a9Xo09IVFT3x+SAxcqi4ND2jBMKcMzoa5fEfUXZ5t8eYj04sBV+UIgkP2J8ei2+OJrin6NvT5UcLNaCimJjP2SXM9ETjt33txK3tLOAy4JtsdveyD9JIyzqfEK/qfOq1YG+vI7Tw76p0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579163358712887.232153263339; Thu, 16 Jan 2020 00:29:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-vBQQt4QIMC-hz5qn8Dz9Nw-1; Thu, 16 Jan 2020 03:29:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05B0710054E3; Thu, 16 Jan 2020 08:29:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8FEF8889C; Thu, 16 Jan 2020 08:29:08 +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 1062818089CD; Thu, 16 Jan 2020 08:29:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00G8T65l000638 for ; Thu, 16 Jan 2020 03:29:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7E4B5202A941; Thu, 16 Jan 2020 08:29:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 799742024517 for ; Thu, 16 Jan 2020 08:29:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C50C802891 for ; Thu, 16 Jan 2020 08:29:04 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-WpK1e_lBOFORrCDKfY7Faw-1; Thu, 16 Jan 2020 03:28:59 -0500 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1is0WQ-0008MN-KJ; Thu, 16 Jan 2020 08:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579163357; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hXff0MhVXoQQeCOsKAJxeckJl1miKZWS5shY6LNbsxU=; b=KjnMS0io0ZoN4w3v3SPEVmE8dF7f2dfJa65EzHKsbOURXWQ3QMHEyhc1FMaEdUayI3UBqq F6SQJEN/PsTKtmeDGS8nUAfWVzqz9DROBfDKBieKp2270QJSmOofbQHWenM9PGXNRFmMvm otHhuqtp/8rXXMQ16YFdBg0dn2DXSpw= From: Christian Ehrhardt To: libvir-list@redhat.com Date: Thu, 16 Jan 2020 09:28:56 +0100 Message-Id: <20200116082856.4040-3-christian.ehrhardt@canonical.com> In-Reply-To: <20200116082856.4040-1-christian.ehrhardt@canonical.com> References: <20200116082856.4040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 X-MC-Unique: WpK1e_lBOFORrCDKfY7Faw-1 X-MC-Unique: vBQQt4QIMC-hz5qn8Dz9Nw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00G8T65l000638 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Guido=20G=C3=BCnther?= , Daniel Henrique Barboza , Christian Ehrhardt Subject: [libvirt] [PATCH v2 2/2] test: qemuhotplugtest mock virFileMakePath 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In certain build environments (e.g. Debian and Ubuntu) $HOME is set to a non existing path intentionally. That breaks and crashes qemuhotplugtest by failing the init in virHostdevManagerGetDefault. Avoid that issue by mocking the virFileMakePath behavior if it is passed a path that matches $HOME and doesn't exists. That fixes qemuhotplugtest in Debian/Ubuntu builds of v6.0.0. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Christian Ehrhardt --- tests/qemuhotplugmock.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c index 43a9d79051..06a28742d4 100644 --- a/tests/qemuhotplugmock.c +++ b/tests/qemuhotplugmock.c @@ -18,6 +18,7 @@ =20 #include =20 +#include "virmock.h" #include "qemu/qemu_hotplug.h" #include "conf/domain_conf.h" =20 @@ -31,3 +32,19 @@ qemuDomainGetUnplugTimeout(virDomainObjPtr vm G_GNUC_UNU= SED) return 200; return 100; } + +VIR_MOCK_IMPL_RET_ARGS(virFileMakePath, int, + const char *, path) +{ + const char *home; + + VIR_MOCK_REAL_INIT(virFileMakePath); + + /* ignore non-existing homes (e.g. in build environments) */ + home =3D getenv("HOME"); + if (strstr(path, home)) { + if (!g_file_test (home, G_FILE_TEST_EXISTS)) + return 0; + } + return real_virFileMakePath(path); +} --=20 2.25.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list