From nobody Tue Apr 30 04:06:07 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381551; cv=none; d=zohomail.com; s=zohoarc; b=YSZ9DpSdrzHGIaWBrnczwqhJG9xUgxWFE0M7Bm80f+Uy8+WS/6xLPB4bptAez3mtifilyBJzRyhYfxy3Oqm9w9iIi1+Ubl9G7yY5LYD27m79iRUdutADS+Wuf6YM53Ik8HWAZo5BOJxj72F54C3fbYBToLrTWNAWQCAB5MjKY7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381551; h=Content-Type:Content-Transfer-Encoding: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=tvPyodbcZ6emJJt6YFumBMR9mzlztXuDGcrfxoGCzz8=; b=ROKhU79URRyvkCClWBx7OpPJYF7aL4N2iv1wfxyRCxYzDh0OJVWF6WIZbEZhe+pe4fRT1hg2BBkXsUxv+GIdugW4wZcQQZzbWVm/8TypO19ve2yK4lfbu9RuRj5zXWblbwEk/eJu3LdyXIBPMv7SfBWrp8o4ZX4BwcUzKT0gFjM= 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582381551151678.9205539998172; Sat, 22 Feb 2020 06:25:51 -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-436-tvGm6SwsMHyF06tccmNYgQ-1; Sat, 22 Feb 2020 09:25:47 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CC4D184B140; Sat, 22 Feb 2020 14:25:42 +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 EB16C5D9E2; Sat, 22 Feb 2020 14:25:41 +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 A2C50860D0; Sat, 22 Feb 2020 14:25:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPGwq008518 for ; Sat, 22 Feb 2020 09:25:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0990A90787; Sat, 22 Feb 2020 14:25:16 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7225B87B0A for ; Sat, 22 Feb 2020 14:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381550; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=tvPyodbcZ6emJJt6YFumBMR9mzlztXuDGcrfxoGCzz8=; b=ThBI4SR5asHpfSq1MFRPb+CGt/WFPmzPTQmLoKwiMv8qUABSFgqA5VoCr/QwdJvB41eDrj 3XVjZ1dgTnwIdqh8v+O7AL5TFmncrc2mjd+jvm709eIJoAL+t7WdgSM4Wm625FsR1HeJ0C dq47LwKg/WZAzgTjydvfNJWDoYxP6fM= X-MC-Unique: tvGm6SwsMHyF06tccmNYgQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/7] testutilsxen: error out on initialization failure Date: Sat, 22 Feb 2020 15:25:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.14 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" libxlDriverConfigNew can possibly fail on wrong firmware values (unlikely) or on failure to create the log directory (possible if you're debugging tests with VIR_FILE_ACCESS) Signed-off-by: J=C3=A1n Tomko Fixes: 4a4132b4625778cf80acb9c92d06351b44468ac3 Reviewed-by: Jim Fehlig --- tests/testutilsxen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index b73c79581d..76da33826c 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -94,7 +94,8 @@ libxlDriverPrivatePtr testXLInitDriver(void) return NULL; } =20 - driver->config =3D libxlDriverConfigNew(); + if (!(driver->config =3D libxlDriverConfigNew())) + return NULL; =20 driver->config->caps =3D testXLInitCaps(); =20 --=20 2.24.1 From nobody Tue Apr 30 04:06:07 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381530; cv=none; d=zohomail.com; s=zohoarc; b=URz7eiK58B5o4p+4zbM2i+xsSA+WE2eDDOcA5heQK2SsjATUQwccY4O8H1Jz1+XcN8MXuVRHuVAp2Xx6GcVGDWRFNVr/38/4FonII3SgdG4STnw07TwyfOy7/bKaq7lUB2ETpIYtE0HAqV+NyZOoqRzCFBT5ezKdPxb4p2sKPtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381530; h=Content-Type:Content-Transfer-Encoding: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=GjLJpu0pMOqv+tsGuRCXha5Q7LWj1Q2yhw8UKRakPNQ=; b=hVeWquvT0qSzQCvm7qujxgzu165Kf65FS63duT9lKTr+GuS0RvVtENcPVS7jWf9VfYRbPSxvToCCzhCjbbyVS3cTmAL1ewaMeisGrTXzy1671i3kb5idM9DYPVB/7I75xb47+8v5OZN3p9HatitbNkRTzA8Gm/UwtnQSy7TQIJM= 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=pass 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 1582381530519828.8208982687142; Sat, 22 Feb 2020 06:25:30 -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-50-_EtNplz1NnWkzHsOKTvFDA-1; Sat, 22 Feb 2020 09:25:26 -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 CA373800D5A; Sat, 22 Feb 2020 14:25:19 +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 784DE90784; Sat, 22 Feb 2020 14:25:19 +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 1D71A18034EA; Sat, 22 Feb 2020 14:25:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPHOD008525 for ; Sat, 22 Feb 2020 09:25:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3FED290787; Sat, 22 Feb 2020 14:25:17 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A71D87B0A for ; Sat, 22 Feb 2020 14:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381528; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=GjLJpu0pMOqv+tsGuRCXha5Q7LWj1Q2yhw8UKRakPNQ=; b=c/VMJnQlzxHAxvn7tIyc2j/8GPbFWFQqw/An4GPn/vBM3IR8WATvNai1/V7tktToILipk4 6UA3oO7ai+r6EDnJpejOnMHtgTBmIIqMeR70VavWAouJOWHKhiijtf1Q+/Jb3gnLCOxRIC GO5WX9t7w8VS/lKYbtHMJsLerxuXFuk= X-MC-Unique: _EtNplz1NnWkzHsOKTvFDA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/7] libxl: conf: move default keepalive settings to libxlDriverConfigNew Date: Sat, 22 Feb 2020 15:25:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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" These hardcoded defaults do not need to be read from the file. Move them out of libxlDriverConfigLoadFile. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jim Fehlig --- src/libxl/libxl_conf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 56deca7b7c..9c722342ba 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1763,6 +1763,10 @@ libxlDriverConfigNew(void) goto error; cfg->firmwares[cfg->nfirmwares - 1]->name =3D g_strdup(LIBXL_FIRMWARE_= DIR "/hvmloader"); =20 + /* defaults for keepalive messages */ + cfg->keepAliveInterval =3D 5; + cfg->keepAliveCount =3D 5; + return cfg; =20 error: @@ -1786,10 +1790,6 @@ int libxlDriverConfigLoadFile(libxlDriverConfigPtr c= fg, { g_autoptr(virConf) conf =3D NULL; =20 - /* defaults for keepalive messages */ - cfg->keepAliveInterval =3D 5; - cfg->keepAliveCount =3D 5; - /* Check the file is readable before opening it, otherwise * libvirt emits an error. */ --=20 2.24.1 From nobody Tue Apr 30 04:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381573; cv=none; d=zohomail.com; s=zohoarc; b=ebSHZ9M8KEKeu99IXLCENUFfVMgMyXHiV9tofgGNkdT/PINCTcvs5hH/fsRDsoxoKQevpLQP2tN1LEebF3qTcTB11fXP5NzooVTZJYLo0xlmQl0R8pmjh0n46MWvwUnAv46nH5ufYkYKE5DqRaDOWstM/HZwE2KNRUZZtaYqDe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381573; h=Content-Type:Content-Transfer-Encoding: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=FlHnugkPO99jv/cQ9J54whr7CfKFCW8QWlXoF1PLC/M=; b=Yedr1bAOHVkDfZ8X04DsGZTy3obqZz2M6gfcIY0+a89c5f8Ht8/mOrHiuB++GxbXwAQnHwxkMzUxLuBdb0ozYOSWtqyQOb7G5dQELFoEeox6kHZ0coAudf8ug/9CS88dOMgsu8y88txlj4WPuTjOuoxYJOOr6OsgPqScEwAMuw8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582381573370292.11640154778206; Sat, 22 Feb 2020 06:26:13 -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-429-YDZIVQcJNyCkYZJnF7gN6w-1; Sat, 22 Feb 2020 09:26:10 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECFE7800D54; Sat, 22 Feb 2020 14:26:04 +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 7D7955C219; Sat, 22 Feb 2020 14:26:04 +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 36A5018034EE; Sat, 22 Feb 2020 14:26:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPIoH008535 for ; Sat, 22 Feb 2020 09:25:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 45CA890787; Sat, 22 Feb 2020 14:25:18 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4DB287B0A for ; Sat, 22 Feb 2020 14:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381572; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=FlHnugkPO99jv/cQ9J54whr7CfKFCW8QWlXoF1PLC/M=; b=hV+GYx/mEJ6VKqDe4Fp2Lj39b/H9Xd5bby9EXYnc9Nej6c3uwKAJmQjJFaAmhvewmoSMtp yOsgnsR8bDhZ/gdFKkgwMT/xfulBy4bELwg68BhcuU4IxshrgS3Wg+vS6InJYGQ1U2mU3B QTLfj/KNGRCWrFgFVvVVbKxFRzjyrak= X-MC-Unique: YDZIVQcJNyCkYZJnF7gN6w-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/7] libxl: StateInitialize: use g_autofree Date: Sat, 22 Feb 2020 15:25:07 +0100 Message-Id: <51bf191c5eb9d61b5f4021b51064143c8fa5bc0d.1582381502.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.16 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" Use g_autofree to free the driver config file path. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jim Fehlig --- src/libxl/libxl_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 2b06f1be1e..0b88c9f9d9 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -652,7 +652,7 @@ libxlStateInitialize(bool privileged, void *opaque) { libxlDriverConfigPtr cfg; - char *driverConf =3D NULL; + g_autofree char *driverConf =3D NULL; char ebuf[1024]; bool autostart =3D true; =20 @@ -706,7 +706,6 @@ libxlStateInitialize(bool privileged, =20 if (libxlDriverConfigLoadFile(cfg, driverConf) < 0) goto error; - VIR_FREE(driverConf); =20 /* Register the callbacks providing access to libvirt's event loop */ libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->= ctx); @@ -822,7 +821,6 @@ libxlStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_COMPLETE; =20 error: - VIR_FREE(driverConf); libxlStateCleanup(); return VIR_DRV_STATE_INIT_ERROR; } --=20 2.24.1 From nobody Tue Apr 30 04:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381550; cv=none; d=zohomail.com; s=zohoarc; b=KScA+HWpTScPOeqmbNemh0jrPJMwU3SlPbggGi/8FDwp/hWpj+NMqeZCraecqgLNy3ePE+InxkMiookIGwGUBYDKUq39ybHXeeNu5zXKcaq5/bCB/eU0o5Is4egC7OkSghVJ/ytiMxq5xjR7cM82/7bB1N/DclphW52er5GIME4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381550; h=Content-Type:Content-Transfer-Encoding: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=VXpjq0koGwDjVxeT8Chz8XHkdljRxIc/+9fJzmwjnMM=; b=OpcOW9RiZMJSgHqj4Sue/hfTT4HpYLqV1s6Uh9+44oBHWez9/3mwrQ5tDQMK55XHV+52P55oWT2pr+mu/b7uw7dthk058iyfK+N7KQFbU7/231rUoH3yIXkcXzbP8s0kKO2Zt4XVUbIB57TpL9BzuoiiPwcCBkp3LvdRel7+Wng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582381550577182.31204534037; Sat, 22 Feb 2020 06:25:50 -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-201-SJzCy8uRN_eQ3_J4Peym9Q-1; Sat, 22 Feb 2020 09:25:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C58D5107ACC9; Sat, 22 Feb 2020 14:25:41 +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 990F75C1B5; Sat, 22 Feb 2020 14:25:41 +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 3BC7635AF3; Sat, 22 Feb 2020 14:25:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPJQf008547 for ; Sat, 22 Feb 2020 09:25:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3FFBA87B0A; Sat, 22 Feb 2020 14:25:19 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id A50FB90784 for ; Sat, 22 Feb 2020 14:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381549; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=VXpjq0koGwDjVxeT8Chz8XHkdljRxIc/+9fJzmwjnMM=; b=dC1X7YxK2RU4M77GLTLncATp6JFKbLsk8YQEfNQsnkH/hZ2aCVBcKxe2bmcfboW4vx8QVF aY15TIGEaJ8pvNf+2/yL7tdTkx52HWzWvXDJdlYoTfCjxh5yvwhOMVF2bPFoRbb0A4qx9b YXlPPKDjFznLZlI+FuIzptN22YRG7Do= X-MC-Unique: SJzCy8uRN_eQ3_J4Peym9Q-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/7] libxl: split out DriverConfigInit out of DriverConfigNew Date: Sat, 22 Feb 2020 15:25:08 +0100 Message-Id: <6e48e93a13fe7ed33dddfbd733ad75c958ebb1c4.1582381502.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.16 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" Take the parts affected by the host state out of DriverConfigNew and put them into a separate function. Adjust all the callers to call both functions. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jim Fehlig --- src/libxl/libxl_conf.c | 81 ++++++++++++++++++++++------------------ src/libxl/libxl_conf.h | 2 + src/libxl/libxl_driver.c | 3 ++ tests/testutilsxen.c | 3 ++ 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 9c722342ba..907df525c5 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1686,8 +1686,6 @@ libxlDriverConfigPtr libxlDriverConfigNew(void) { libxlDriverConfigPtr cfg; - char ebuf[1024]; - unsigned int free_mem; =20 if (libxlConfigInitialize() < 0) return NULL; @@ -1705,41 +1703,6 @@ libxlDriverConfigNew(void) cfg->autoDumpDir =3D g_strdup(LIBXL_DUMP_DIR); cfg->channelDir =3D g_strdup(LIBXL_CHANNEL_DIR); =20 - if (virFileMakePath(cfg->logDir) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to create log dir '%s': %s"), - cfg->logDir, - virStrerror(errno, ebuf, sizeof(ebuf))); - goto error; - } - - cfg->logger =3D libxlLoggerNew(cfg->logDir, virLogGetDefaultPriority()= ); - if (!cfg->logger) { - VIR_ERROR(_("cannot create logger for libxenlight, disabling drive= r")); - goto error; - } - - if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, (xentoollog_logger *)= cfg->logger)) { - VIR_ERROR(_("cannot initialize libxenlight context, probably not " - "running in a Xen Dom0, disabling driver")); - goto error; - } - - if ((cfg->verInfo =3D libxl_get_version_info(cfg->ctx)) =3D=3D NULL) { - VIR_ERROR(_("cannot version information from libxenlight, " - "disabling driver")); - goto error; - } - cfg->version =3D (cfg->verInfo->xen_version_major * 1000000) + - (cfg->verInfo->xen_version_minor * 1000); - - /* This will fill xenstore info about free and dom0 memory if missing, - * should be called before starting first domain */ - if (libxl_get_free_memory(cfg->ctx, &free_mem)) { - VIR_ERROR(_("Unable to configure libxl's memory management paramet= ers")); - goto error; - } - #ifdef DEFAULT_LOADER_NVRAM if (virFirmwareParseList(DEFAULT_LOADER_NVRAM, &cfg->firmwares, @@ -1774,6 +1737,50 @@ libxlDriverConfigNew(void) return NULL; } =20 +int +libxlDriverConfigInit(libxlDriverConfigPtr cfg) +{ + char ebuf[1024]; + unsigned int free_mem; + + if (virFileMakePath(cfg->logDir) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("failed to create log dir '%s': %s"), + cfg->logDir, + virStrerror(errno, ebuf, sizeof(ebuf))); + return -1; + } + + cfg->logger =3D libxlLoggerNew(cfg->logDir, virLogGetDefaultPriority()= ); + if (!cfg->logger) { + VIR_ERROR(_("cannot create logger for libxenlight, disabling drive= r")); + return -1; + } + + if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, (xentoollog_logger *)= cfg->logger)) { + VIR_ERROR(_("cannot initialize libxenlight context, probably not " + "running in a Xen Dom0, disabling driver")); + return -1; + } + + if ((cfg->verInfo =3D libxl_get_version_info(cfg->ctx)) =3D=3D NULL) { + VIR_ERROR(_("cannot version information from libxenlight, " + "disabling driver")); + return -1; + } + cfg->version =3D (cfg->verInfo->xen_version_major * 1000000) + + (cfg->verInfo->xen_version_minor * 1000); + + /* This will fill xenstore info about free and dom0 memory if missing, + * should be called before starting first domain */ + if (libxl_get_free_memory(cfg->ctx, &free_mem)) { + VIR_ERROR(_("Unable to configure libxl's memory management paramet= ers")); + return -1; + } + + return 0; +} + libxlDriverConfigPtr libxlDriverConfigGet(libxlDriverPrivatePtr driver) { diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index b61c52f1a5..07b3373170 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -164,6 +164,8 @@ struct _libxlSavefileHeader { =20 libxlDriverConfigPtr libxlDriverConfigNew(void); +int +libxlDriverConfigInit(libxlDriverConfigPtr cfg); =20 libxlDriverConfigPtr libxlDriverConfigGet(libxlDriverPrivatePtr driver); diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 0b88c9f9d9..d10529ac5b 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -707,6 +707,9 @@ libxlStateInitialize(bool privileged, if (libxlDriverConfigLoadFile(cfg, driverConf) < 0) goto error; =20 + if (libxlDriverConfigInit(cfg) < 0) + goto error; + /* Register the callbacks providing access to libvirt's event loop */ libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->= ctx); =20 diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 76da33826c..b1260dcebf 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -97,6 +97,9 @@ libxlDriverPrivatePtr testXLInitDriver(void) if (!(driver->config =3D libxlDriverConfigNew())) return NULL; =20 + if (libxlDriverConfigInit(driver->config) < 0) + return NULL; + driver->config->caps =3D testXLInitCaps(); =20 driver->xmlopt =3D libxlCreateXMLConf(driver); --=20 2.24.1 From nobody Tue Apr 30 04:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381531; cv=none; d=zohomail.com; s=zohoarc; b=Wn8JWwbgZhQd0l4CsEwQYtfCn76kQo4aKTyDkApTVo+CoQfXnvK0kKOEX3W0j/PGCc4qucBvZB3yT/OzWTbPDo97UnPI0MGdG1O2hEIOxrBI1yT0t5jQjpQ01rpvdNXLOu2C5AEYU4aqaWSCtnc97wKvzWw88xDb3SjNo5vTBDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381531; h=Content-Type:Content-Transfer-Encoding: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=9Tcwc9R8/pumXcK72l7jifJnSLt5n5ZGDNqVAuOg8zk=; b=IAgNAys2JLJf04TMLgxXdG5BhG/ACkdYiXsl2CdkPRlAUNOJ+lPOGkYPjF00sPlg+UD/TLRGuKKJF2q4dKUsu4Juy2J3StUj+XHUFi4TPTIf+4TJEBVf+FZOJmDn7vlWw2231CP+0MXs+3Ht4ruMNzu4IEWEpTvzMNthUHJdmZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1582381531198129.83024593213054; Sat, 22 Feb 2020 06:25:31 -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-336-VNaAJ8JUPi2pCWsxMxlUng-1; Sat, 22 Feb 2020 09:25:27 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21956100726B; Sat, 22 Feb 2020 14:25:21 +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 DF49427096; Sat, 22 Feb 2020 14:25:20 +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 8C7D318034ED; Sat, 22 Feb 2020 14:25:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPKN1008554 for ; Sat, 22 Feb 2020 09:25:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3695987B0A; Sat, 22 Feb 2020 14:25:20 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B10490787 for ; Sat, 22 Feb 2020 14:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381530; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=9Tcwc9R8/pumXcK72l7jifJnSLt5n5ZGDNqVAuOg8zk=; b=Y2dtDQbgkeE5pgXcNWK5To50ko+3X5SpXB/ZiBKOvJaQxlBQOspCasirEz+WF2qQwbXzel RPZSUMQDFHoG/BXhsIgP0F8BpjM6wsl53T3Ny+Q9dz0X15MPbPiAMdqHTAbDCIK/KdcjCt c5Fbwv4zcn+2tNdIxsBD+I1pjEfjHL8= X-MC-Unique: VNaAJ8JUPi2pCWsxMxlUng-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/7] libxl: do not mock virFileMakePath Date: Sat, 22 Feb 2020 15:25:09 +0100 Message-Id: <689de8b72a1779610155cdaef8da7d3497d7e4f1.1582381503.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.23 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" Point the logDir to abs_builddir instead. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jim Fehlig --- tests/libxlmock.c | 11 ----------- tests/testutilsxen.c | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/libxlmock.c b/tests/libxlmock.c index b995b34cc5..60e6b78129 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -94,17 +94,6 @@ VIR_MOCK_STUB_RET_ARGS(bind, const struct sockaddr *, addr, socklen_t, addrlen) =20 -VIR_MOCK_IMPL_RET_ARGS(virFileMakePath, int, - const char *, path) -{ - /* replace log path with a writable directory */ - if (strstr(path, "/log/")) { - g_snprintf((char*)path, strlen(path), "."); - return 0; - } - return real_virFileMakePath(path); -} - VIR_MOCK_IMPL_RET_ARGS(__xstat, int, int, ver, const char *, path, diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index b1260dcebf..d50c3003da 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -97,6 +97,9 @@ libxlDriverPrivatePtr testXLInitDriver(void) if (!(driver->config =3D libxlDriverConfigNew())) return NULL; =20 + g_free(driver->config->logDir); + driver->config->logDir =3D g_strdup(abs_builddir); + if (libxlDriverConfigInit(driver->config) < 0) return NULL; =20 --=20 2.24.1 From nobody Tue Apr 30 04:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381573; cv=none; d=zohomail.com; s=zohoarc; b=PbcP9rY+6A59b2KCM9QtCpFmpXkzx5JBBdN6iHzDNZwdqcY50wG4qxFjwJYegO5KhsYrOGQB1XmAhG6iI7PAg1m83rvywr1/2rDOiOIpvyGqVPdKg6ry5m3JabT+qsYggarvoDD/CMO5H9IegXNMb9OIIOQlGF2td7HrOsQca1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381573; h=Content-Type:Content-Transfer-Encoding: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=IYIiomWmhvjTFcd7AJhOG3ASD0yFr1qfQY6LHUSKJRs=; b=NKIfvLHMa/39wJVHQIsMYh88Z0yJLlDwm1vr9MuoEkaZYb240Ksx+73M41HzY8i7iR9ctI8P8jnzEOYXpOoGvFNN5lbQf+gT06pb8E6NOny6t7u9JYgBvJGDuqY+cgkTUO0dcxRwUOqguaiJMFFPr0wvaYGhY0N2y68QFTlmrAg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582381573498550.1102755515808; Sat, 22 Feb 2020 06:26:13 -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-437-9m99l3ljOzi-EWIVcereQg-1; Sat, 22 Feb 2020 09:26:10 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 91582184B144; Sat, 22 Feb 2020 14:26:04 +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 6B9445C1C3; Sat, 22 Feb 2020 14:26:04 +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 16966860D5; Sat, 22 Feb 2020 14:26:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPLgV008562 for ; Sat, 22 Feb 2020 09:25:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 31B8C87B0A; Sat, 22 Feb 2020 14:25:21 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9677490067 for ; Sat, 22 Feb 2020 14:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381572; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=IYIiomWmhvjTFcd7AJhOG3ASD0yFr1qfQY6LHUSKJRs=; b=Q/P6FWXClbvzV1jkEsCiQVT7dooYJBX45MMQL2aZDsVI58xLUdMcgD604oii79F/gY7KD0 9Iu/AmPM3hOycXtFY+2I2mQ6cZoL8g0hCh8DquGpuoC+WaeWeJ/wC2wxwt7XLhVsjv/fS9 1O5AxL/Jkuspy3SfAKEnAZa90ZTyp3w= X-MC-Unique: 9m99l3ljOzi-EWIVcereQg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/7] tests: link the libxl tests with libxltestdriver.la Date: Sat, 22 Feb 2020 15:25:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.16 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" This lets us mock functions from the libxl driver. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jim Fehlig --- tests/Makefile.am | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ed5255b62d..761c989e86 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -505,17 +505,20 @@ libxltestdriver_la_LIBADD =3D $(libxl_LDADDS) xlconfigtest_SOURCES =3D \ xlconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -xlconfigtest_LDADD =3D$(libxl_LDADDS) +xlconfigtest_LDADD =3D libxltestdriver.la \ + $(libxl_LDADDS) =20 xmconfigtest_SOURCES =3D \ xmconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -xmconfigtest_LDADD =3D $(libxl_LDADDS) +xmconfigtest_LDADD =3D libxltestdriver.la \ + $(libxl_LDADDS) =20 libxlxml2domconfigtest_SOURCES =3D \ libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h -libxlxml2domconfigtest_LDADD =3D $(libxl_LDADDS) $(LIBXML_LIBS) +libxlxml2domconfigtest_LDADD =3D libxltestdriver.la \ + $(libxl_LDADDS) $(LIBXML_LIBS) =20 libxlmock_la_SOURCES =3D \ libxlmock.c --=20 2.24.1 From nobody Tue Apr 30 04:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582381553; cv=none; d=zohomail.com; s=zohoarc; b=jQYmbHsQBNlBdMgMbD4JsVqyY5+jKmvSpwXORDi572AZQRjXEmjXaIxg/5Psz494R6yhLo11yng1AqN8964xSZQ+pStfPpsVxtVv49DezrZQuYqvOXno6DFzt7b0LVQHSzlbR6zt+74ExAVYlbLym2diCUJV6jBkoKNkUUK17A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582381553; h=Content-Type:Content-Transfer-Encoding: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=g0iMAayGwEOVSFANCxxTmnXpOxfafW6j0wk8gsbdeL0=; b=ZcD0WFv5QCXgZ0uOiQ4RFZHJJSt/eZ1FY/X2GP6NYhzZKfdxxAnC/Hny7TeSMPGH5RGo8VOYrThym33YNxK3mzSaDmnEvTryfTgnverCFd1yJrvOr4OcoQ4eS78lOKv8id8LObtrmyYVo9rQ/EwwwyhlpSmgeqi40VTheiPUFBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582381553089424.31150015930916; Sat, 22 Feb 2020 06:25:53 -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-87-FF8n614GNfGphInSZCZ5AQ-1; Sat, 22 Feb 2020 09:25:49 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D053F8017CC; Sat, 22 Feb 2020 14:25:43 +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 A9EE82709B; Sat, 22 Feb 2020 14:25:43 +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 61D0B18034EA; Sat, 22 Feb 2020 14:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MEPMB0008577 for ; Sat, 22 Feb 2020 09:25:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 43E1E90067; Sat, 22 Feb 2020 14:25:22 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 923F087B0A for ; Sat, 22 Feb 2020 14:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582381552; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=g0iMAayGwEOVSFANCxxTmnXpOxfafW6j0wk8gsbdeL0=; b=hQeXJbggT7UiOxUevE4rZadHCYAIy0Jr0TCBL0iuXzD7xMhArtsO6sNCjuhXR+aC/6IaeP ajcR8sP7T+ZpTJCkHiJS0WQNCLgji6QTCKf9LuxVDWmVqyXw6u1/L1ox4Tj+LN17KYntuF uYL4Yi1TLibTUlhVFQaquW/zcuSxI/w= X-MC-Unique: FF8n614GNfGphInSZCZ5AQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 7/7] tests: libxl: do not run the emulator Date: Sat, 22 Feb 2020 15:25:11 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.23 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" Ever since commit c5a00350 the libxl parser invokes the emulator to probe which device model to use. Commit b90c4b5 introduced a workaround that used a stable path which was very likely to result in the answer matching the default. However the test is still affected by the host state and the binary gets invoked if present. Mock the libxlDomainGetEmulatorType function to stop wasting CPU cycles every time a 'make check' is run on a system with xen installed. For example xlconfigtest gets faster by 90 % Signed-off-by: J=C3=A1n Tomko Fixes: b90c4b5f505698d600303c5b4f03f5d229b329dd Reviewed-by: Jim Fehlig --- src/libxl/libxl_capabilities.h | 3 ++- tests/libxlmock.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h index 9a7c8bf636..9efb836429 100644 --- a/src/libxl/libxl_capabilities.h +++ b/src/libxl/libxl_capabilities.h @@ -50,4 +50,5 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps, size_t nfirmwares); =20 int -libxlDomainGetEmulatorType(const virDomainDef *def); +libxlDomainGetEmulatorType(const virDomainDef *def) + G_GNUC_NO_INLINE; diff --git a/tests/libxlmock.c b/tests/libxlmock.c index 60e6b78129..a36ca135f6 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -30,6 +30,7 @@ =20 # include "virfile.h" # include "virsocket.h" +# include "libxl/libxl_capabilities.h" =20 VIR_MOCK_IMPL_RET_VOID(xs_daemon_open, struct xs_handle *) @@ -123,4 +124,10 @@ VIR_MOCK_IMPL_RET_ARGS(stat, int, return real_stat(path, sb); } =20 +int +libxlDomainGetEmulatorType(const virDomainDef *def G_GNUC_UNUSED) +{ + return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; +} + #endif /* WITH_LIBXL && WITH_YAJL */ --=20 2.24.1