From nobody Mon Feb 9 05:41:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1712749451; cv=none; d=zohomail.com; s=zohoarc; b=lG878KCOj6y5nFExU08iiVIWBBE692YxTre6J0oJxTWeGjs9MW22NKntm9MYe6LIX6Ry4iFMRs/PyFNQ8xeiC1en3pxsP+3SrbjWVTZcDJA1JG4iJtwP9xG+f3iSQ7tmmOkkFQFivTOhH/+7q/izW7giw3k2ZKbyycTG5eSbNwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712749451; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=30QgisvmYFSN9sJ9N9ya959fCAYBnhZkkLkxzE/5MPo=; b=UM7obld+exzwenqMKlcllNJxu1ebaVt2Xi/lXYXc3ZA9p7EFBgkurHV0idN9pY5EfFsc104pZjj3I8YKZTSlI2gZWVhuncdRPKl8myJncNTfNsRclGOPfSWIOWmcnbQ0Z+u7F5fR7KcYoDXKjrUzPeS+HJtNbH0BvC2N6bOMKgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1712749451514781.7740415112158; Wed, 10 Apr 2024 04:44:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.703048.1098857 (Exim 4.92) (envelope-from ) id 1ruWMl-0003kh-Dd; Wed, 10 Apr 2024 11:43:47 +0000 Received: by outflank-mailman (output) from mailman id 703048.1098857; Wed, 10 Apr 2024 11:43:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ruWMl-0003kY-Aj; Wed, 10 Apr 2024 11:43:47 +0000 Received: by outflank-mailman (input) for mailman id 703048; Wed, 10 Apr 2024 11:43:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ruWMj-0003jg-UJ for xen-devel@lists.xenproject.org; Wed, 10 Apr 2024 11:43:45 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 94dcd558-f72f-11ee-94a3-07e782e9044d; Wed, 10 Apr 2024 13:43:42 +0200 (CEST) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-516d536f6f2so5502176e87.2 for ; Wed, 10 Apr 2024 04:43:42 -0700 (PDT) Received: from localhost.localdomain (adsl-125.109.242.226.tellas.gr. [109.242.226.125]) by smtp.gmail.com with ESMTPSA id a20-20020a05600c349400b00416a7313deasm1622874wmq.4.2024.04.10.04.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 04:43:41 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 94dcd558-f72f-11ee-94a3-07e782e9044d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712749422; x=1713354222; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=30QgisvmYFSN9sJ9N9ya959fCAYBnhZkkLkxzE/5MPo=; b=dNmQDbqR/u7QQuz8XOmtBiYVVo+sQBzYAsaMCslLxG06neU88pxNATocQXWndqXowz KwEcFTeggRSquqiHP/uIabTek85XxDLfG+HHVLCs7EjObWaqt0vhGtI6stNxxrhq5d0y h2S2I6RgxQifLhZkVpLsaTp3HRDP1qU+cAOUNvHHjKSxgpJSJZ+dNBaSZL4JCeYxZwj2 q8I29wKi1SYXqN6aM5m35iQA4Ern4GOWVfYjqxRAX1qosP28n1vyCpszDcoqaawQ1Ctb m190ePTXN8bd2qXYvQUvz0PipqbpZF7DLGvyfuLAjcROLnsorxJQPp3SwsZnAZ2BjGvP 5YQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712749422; x=1713354222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=30QgisvmYFSN9sJ9N9ya959fCAYBnhZkkLkxzE/5MPo=; b=JZy5qWKY7naxRqoSvr644uIGuQY6wCsOuY4QTjMGwTVG9RcMsorQe+zncnWGRxoZkT 8U/bCj8fKgwgei1yb8sJUGB/metIg6Bi95i1K2AJip5RSlFrKGDHAgkH99R6oXlWKAfL fbmmI1LXWJ8SyVbFfkemcLIOPcv28fuoiZskw2MWxeRbjtf5P/IJ5sdkeeK75TJr9e5A Ra9+ukRx8+aFaIBSOQdCHFHqTTQy2ShDcoJN/WyozoKFJjvhuHg4qDFAjjSnTGZMlrKJ SDCcxUaNpTK+IYPm7uykuR5+Qc2UBdeVHR4jkd3VHQh3ZNdiJLPt0uqoK2dEHpfPCkoj BgOw== X-Gm-Message-State: AOJu0YzZ/7gGcbsVk4/CdVvBnTFWGQX/R/8U8WqzTBuxd4FnDFuZXoRe o7/3dAlv4/bENM7g/UEPQZmmkNE0bEaWC7BpsnOxelaGqByi6upQJYbpTNnohtt4FbaPw6NRiZW I X-Google-Smtp-Source: AGHT+IE20KzbMtODb8+bNw8FvlxwWB0TqrVoVzdK6c4JfiuP/AKDBh95JYCmXDDqLRdH4oCyP4D0EA== X-Received: by 2002:a19:f706:0:b0:513:c95c:4dc4 with SMTP id z6-20020a19f706000000b00513c95c4dc4mr1362819lfe.7.1712749422025; Wed, 10 Apr 2024 04:43:42 -0700 (PDT) From: Manos Pitsidianakis To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [RFC PATCH v1 1/2] libs/light: add device model start timeout env var Date: Wed, 10 Apr 2024 14:43:14 +0300 Message-Id: <334b5a46e31dbf3e8114e9ea8bafd92cf060f2af.1712748711.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1712749453358100005 Content-Type: text/plain; charset="utf-8" When debugging QEMU, the need to run it under Valgrind and asan meant the compile-time define LIBXL_DEVICE_MODEL_START_TIMEOUT must be changed to allow for `xl` to wait longer while the instrumented QEMU initializes. This commit adds support for reading the environment variable LIBXL_DEVICE_MODEL_START_TIMEOUT to configure the timeout value and otherwise fall back to the default 60. Signed-off-by: Manos Pitsidianakis --- docs/man/xl.1.pod.in | 11 +++++++++++ tools/libs/light/libxl_9pfs.c | 2 +- tools/libs/light/libxl_device.c | 2 +- tools/libs/light/libxl_dm.c | 6 +++--- tools/libs/light/libxl_dom_suspend.c | 2 +- tools/libs/light/libxl_internal.h | 6 ++++++ tools/libs/light/libxl_pci.c | 6 +++--- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git docs/man/xl.1.pod.in docs/man/xl.1.pod.in index bed8393473..c159877094 100644 --- docs/man/xl.1.pod.in +++ docs/man/xl.1.pod.in @@ -1993,6 +1993,17 @@ Otherwise the build time default in LIBXL_BOOTLOADER= _TIMEOUT will be used. If defined the value must be an unsigned integer between 0 and INT_MAX, otherwise behavior is undefined. Setting to 0 disables the timeout. =20 +=3Ditem LIBXL_DEVICE_MODEL_START_TIMEOUT + +Timeout in seconds for starting the device model process. Useful in case t= he +device model takes an unusual amount of time to start=E2=80=94 for example= in case of +very slow I/O, in case of slow performance due to memory sanitizer usage, = etc. + +If undefined, the default hard-coded value of 60 seconds is used. + +If defined, the value must be an unsigned integer between 0 and INT_MAX, +otherwise behaviour is undefined. Setting the value to 0 disables the tim= eout. + =3Dback =20 =3Dhead1 SEE ALSO diff --git tools/libs/light/libxl_9pfs.c tools/libs/light/libxl_9pfs.c index 48f894f070..950a464b45 100644 --- tools/libs/light/libxl_9pfs.c +++ tools/libs/light/libxl_9pfs.c @@ -132,7 +132,7 @@ static int xen9pfsd_spawn(libxl__egc *egc, uint32_t dom= id, libxl_device_p9 *p9, aop9->spawn.ao =3D aodev->ao; aop9->spawn.what =3D "xen-9pfs daemon"; aop9->spawn.xspath =3D GCSPRINTF("%s/state", path); - aop9->spawn.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000; + aop9->spawn.timeout_ms =3D __libxl_device_model_start_timeout() * 1000; aop9->spawn.pidpath =3D GCSPRINTF("%s/pid", path); aop9->spawn.midproc_cb =3D libxl__spawn_record_pid; aop9->spawn.confirm_cb =3D xen9pfsd_confirm; diff --git tools/libs/light/libxl_device.c tools/libs/light/libxl_device.c index 6f0100d05e..452e55ba23 100644 --- tools/libs/light/libxl_device.c +++ tools/libs/light/libxl_device.c @@ -1436,7 +1436,7 @@ int libxl__wait_for_device_model_deprecated(libxl__gc= *gc, =20 path =3D DEVICE_MODEL_XS_PATH(gc, dm_domid, domid, "/state"); return libxl__xenstore_child_wait_deprecated(gc, domid, - LIBXL_DEVICE_MODEL_START_TIMEOUT, + __libxl_device_model_start_timeout(), "Device Model", path, state, spawning, check_callback, check_callback_userda= ta); } diff --git tools/libs/light/libxl_dm.c tools/libs/light/libxl_dm.c index 0b03a7c747..4369fef161 100644 --- tools/libs/light/libxl_dm.c +++ tools/libs/light/libxl_dm.c @@ -2629,7 +2629,7 @@ static void spawn_qmp_proxy(libxl__egc *egc, sdss->qmp_proxy_spawn.pidpath =3D GCSPRINTF("%s/image/qmp-proxy-pid", = dom_path); sdss->qmp_proxy_spawn.xspath =3D DEVICE_MODEL_XS_PATH(gc, LIBXL_TOOLST= ACK_DOMID, dm_domid, "/qmp-pr= oxy-state"); - sdss->qmp_proxy_spawn.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT = * 1000; + sdss->qmp_proxy_spawn.timeout_ms =3D __libxl_device_model_start_timeou= t() * 1000; sdss->qmp_proxy_spawn.midproc_cb =3D libxl__spawn_record_pid; sdss->qmp_proxy_spawn.confirm_cb =3D qmp_proxy_confirm; sdss->qmp_proxy_spawn.failure_cb =3D qmp_proxy_startup_failed; @@ -3011,7 +3011,7 @@ retry_transaction: spawn->what =3D GCSPRINTF("domain %d device model", domid); spawn->xspath =3D DEVICE_MODEL_XS_PATH(gc, LIBXL_TOOLSTACK_DOMID, domi= d, "/state"); - spawn->timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000; + spawn->timeout_ms =3D __libxl_device_model_start_timeout() * 1000; spawn->pidpath =3D GCSPRINTF("%s/image/device-model-pid", dom_path); spawn->midproc_cb =3D libxl__spawn_record_pid; spawn->confirm_cb =3D device_model_confirm; @@ -3435,7 +3435,7 @@ void libxl__spawn_qdisk_backend(libxl__egc *egc, libx= l__dm_spawn_state *dmss) =20 dmss->spawn.what =3D GCSPRINTF("domain %u Qdisk backend", domid); dmss->spawn.xspath =3D GCSPRINTF("device-model/%u/state", domid); - dmss->spawn.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000; + dmss->spawn.timeout_ms =3D __libxl_device_model_start_timeout() * 1000; /* * We cannot save Qemu pid anywhere in the xenstore guest dir, * because we will call this from unprivileged driver domains, diff --git tools/libs/light/libxl_dom_suspend.c tools/libs/light/libxl_dom_= suspend.c index 6091a5f3f6..29e51f6c40 100644 --- tools/libs/light/libxl_dom_suspend.c +++ tools/libs/light/libxl_dom_suspend.c @@ -517,7 +517,7 @@ void libxl__dm_resume(libxl__egc *egc, rc =3D libxl__ev_time_register_rel(dmrs->ao, &dmrs->time, dm_resume_timeout, - LIBXL_DEVICE_MODEL_START_TIMEOUT * 10= 00); + __libxl_device_model_start_timeout() = * 1000); if (rc) goto out; =20 switch (libxl__device_model_version_running(gc, domid)) { diff --git tools/libs/light/libxl_internal.h tools/libs/light/libxl_interna= l.h index 803dbc1a03..684390f822 100644 --- tools/libs/light/libxl_internal.h +++ tools/libs/light/libxl_internal.h @@ -97,6 +97,12 @@ /* QEMU may be slow to load and start due to a bug in Linux where the I/O * subsystem sometime produce high latency under load. */ #define LIBXL_DEVICE_MODEL_START_TIMEOUT 60 +static inline int __libxl_device_model_start_timeout(void) +{ + const char *timeout_env =3D getenv("LIBXL_DEVICE_MODEL_START_TIMEOUT"); + return timeout_env ? atoi(timeout_env) + : LIBXL_DEVICE_MODEL_START_TIMEOUT; +} #define LIBXL_DEVICE_MODEL_SAVE_FILE XEN_LIB_DIR "/qemu-save" /* .$domid */ #define LIBXL_DEVICE_MODEL_RESTORE_FILE XEN_LIB_DIR "/qemu-resume" /* .$do= mid */ #define LIBXL_QMP_CMD_TIMEOUT 10 diff --git tools/libs/light/libxl_pci.c tools/libs/light/libxl_pci.c index 96cb4da079..7bdd9f6c3b 100644 --- tools/libs/light/libxl_pci.c +++ tools/libs/light/libxl_pci.c @@ -1157,7 +1157,7 @@ static void do_pci_add(libxl__egc *egc, pas->xswait.what =3D "Device Model"; pas->xswait.path =3D DEVICE_MODEL_XS_PATH(gc, libxl_get_stubdom_id(CTX, domid), domid, "/state"); - pas->xswait.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOU= T * 1000; + pas->xswait.timeout_ms =3D __libxl_device_model_start_time= out() * 1000; pas->xswait.callback =3D pci_add_qemu_trad_watch_state_cb; rc =3D libxl__xswait_start(gc, &pas->xswait); if (rc) goto out; @@ -1719,7 +1719,7 @@ static void device_pci_add_stubdom_wait(libxl__egc *e= gc, rc =3D libxl__ev_devstate_wait(ao, &pas->pciback_ds, device_pci_add_stubdom_ready, state_path, XenbusStateConnected, - LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000); + __libxl_device_model_start_timeout() * 1000); if (rc) goto out; return; out: @@ -1976,7 +1976,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) prs->xswait.what =3D "Device Model"; prs->xswait.path =3D DEVICE_MODEL_XS_PATH(gc, libxl_get_stubdom_id(CTX, domid), domid, "/state"); - prs->xswait.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT * = 1000; + prs->xswait.timeout_ms =3D __libxl_device_model_start_timeout(= ) * 1000; prs->xswait.callback =3D pci_remove_qemu_trad_watch_state_cb; rc =3D libxl__xswait_start(gc, &prs->xswait); if (rc) goto out_fail; --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89 From nobody Mon Feb 9 05:41:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1712749449; cv=none; d=zohomail.com; s=zohoarc; b=A/p/9IvCv9zN3U67uJBWXQsndbjstflfercE65y75w1LHB2wtJO5UY/IEKhOVkvgYv5lGMs7AqItbZotWJKmG7l6hciV25+dD8M6b4iHfVZA/YH50szpdDgDZUIMskTtPgDl6AST19/DDwSq0uZXOAa1Kk295uw1RZbuL/42UAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712749449; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SdOOUOZq9LZ5gV0smnTOUe9GEEiQVAIyweoYczkDsxA=; b=dXYNCC5Mjd064T46RPQrZIjhHMAlwhQiA1pP4h+A2dLkNa2yZ0wmHi6WuJNwnSI+OC5teV3ysqjWn/FwxIEyepF9WQKoY9RGuiELfq+5yIq3rCEkSZI7Jb/yx5Eo9TWyIy9wIO816y8VnIvXON1PFX8s6k47dhZMyr79S5H7TO4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1712749449625880.9092475337741; Wed, 10 Apr 2024 04:44:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.703049.1098864 (Exim 4.92) (envelope-from ) id 1ruWMl-0003oE-Nc; Wed, 10 Apr 2024 11:43:47 +0000 Received: by outflank-mailman (output) from mailman id 703049.1098864; Wed, 10 Apr 2024 11:43:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ruWMl-0003nf-J2; Wed, 10 Apr 2024 11:43:47 +0000 Received: by outflank-mailman (input) for mailman id 703049; Wed, 10 Apr 2024 11:43:46 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ruWMk-0003V1-GP for xen-devel@lists.xenproject.org; Wed, 10 Apr 2024 11:43:46 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 96a5ca92-f72f-11ee-b907-491648fe20b8; Wed, 10 Apr 2024 13:43:45 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-516d0162fa1so7927262e87.3 for ; Wed, 10 Apr 2024 04:43:45 -0700 (PDT) Received: from localhost.localdomain (adsl-125.109.242.226.tellas.gr. [109.242.226.125]) by smtp.gmail.com with ESMTPSA id a20-20020a05600c349400b00416a7313deasm1622874wmq.4.2024.04.10.04.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 04:43:45 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 96a5ca92-f72f-11ee-b907-491648fe20b8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712749425; x=1713354225; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SdOOUOZq9LZ5gV0smnTOUe9GEEiQVAIyweoYczkDsxA=; b=LNqVY7BaXxURz6Y8EGrnq8lHjUnD2QUoeY/f/2PYLczzo9VvJ76Nsq8jQyc50lSy/P iNB8ZtRVJENOYVsWolPOpbQM1uvhZdW+UQW8N3Ns4W0qhCPaj+P4gFzM312eb/qJxkXt A7TzmwaFgFnoW/c/MbjqE8Pjol8x2tSgwpESRiMciWFZf2P3lJGTGg8aeepwRfrPmOn6 aRYXXEEa0rm3sswchDvz+xKa6BsamIL8XA672RRKSVesJHYnOt7kB0OfsA6rtvXswkK8 1LADQ2ab+uYb7gPnzRiN5s1dQsme+J5fRQXHGP1yvOhno8qDFx+ic/ca5tHb53RAgu2V 4KZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712749425; x=1713354225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SdOOUOZq9LZ5gV0smnTOUe9GEEiQVAIyweoYczkDsxA=; b=tONUfPY8+apuFHcXB4dOgs2kniuVcFuIWJ4itFqRNkxqIKeGPj8HZM2LJe8owk2S0z XddFodtio0al69iYqt3OANdAXxip4xT+QCgy4Fx7ccdiYjNk1UQIzP/31mgq35Xy2+Wa 0H5Q7YPW/+XUPbOpdd4DAqGWdWH7TfaWfH9DCJFKOlVOp+2lLZHc9MPCT/hPkPqIhgod 0aGsBYLhm0RGpoCzXatW+isO5Z/p3JLnAQhQYdQt8Jvj63QRYtYaQ2JXJ3b91uWkTjCU Vjv27aOrftNwdYuNv398mjDzQIjpR9unbgT5FhFyxDqrpa6gcj35ZvUWhuPUVOGiQmtO Nncg== X-Gm-Message-State: AOJu0Yy7BH7JutFkUPvzS28hzKsXCS1RGMt0wVQQHIQlwOXDIobkglhb +xcAVBergJHm1ydQMP5aN6mb8v2VRZqC5SPi/XiXijA8T59l24xM4uy6OS7KpiDTA60ssAP+rNz 3 X-Google-Smtp-Source: AGHT+IG/X340dtXOKOxCwIIO2gXgjMZdoqDI+lvwqfcPHVfGIpVcBcM+MFm8ik3Qw/FpZiEPSA1fPw== X-Received: by 2002:a2e:9911:0:b0:2d8:e159:23b6 with SMTP id v17-20020a2e9911000000b002d8e15923b6mr431080lji.16.1712749425283; Wed, 10 Apr 2024 04:43:45 -0700 (PDT) From: Manos Pitsidianakis To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [RFC PATCH v1 2/2] libs/light: expand device model start timeout use Date: Wed, 10 Apr 2024 14:43:15 +0300 Message-Id: <125210f392aacaa5dd605ce7036c7c9b9e783a2a.1712748711.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1712749451276100003 Content-Type: text/plain; charset="utf-8" Various timeout values that depend on the device model should also respect the device model start timeout setting. This commit adds the __libxl_device_model_start_timeout() value to those time outs without changing their default values. Signed-off-by: Manos Pitsidianakis --- tools/libs/light/libxl_dm.c | 4 ++-- tools/libs/light/libxl_domain.c | 5 +++-- tools/libs/light/libxl_pci.c | 4 ++-- tools/libs/light/libxl_usb.c | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git tools/libs/light/libxl_dm.c tools/libs/light/libxl_dm.c index 4369fef161..9ffdd50c69 100644 --- tools/libs/light/libxl_dm.c +++ tools/libs/light/libxl_dm.c @@ -2807,7 +2807,7 @@ static void stubdom_pvqemu_unpaused(libxl__egc *egc, dm_domid, sdss->dm.guest_domid); sdss->xswait.path =3D DEVICE_MODEL_XS_PATH(gc, dm_domid, sdss->dm.gues= t_domid, "/state"); - sdss->xswait.timeout_ms =3D LIBXL_STUBDOM_START_TIMEOUT * 1000; + sdss->xswait.timeout_ms =3D (__libxl_device_model_start_timeout() + LI= BXL_STUBDOM_START_TIMEOUT) * 1000; sdss->xswait.callback =3D stubdom_xswait_cb; rc =3D libxl__xswait_start(gc, &sdss->xswait); if (rc) goto out; @@ -3177,7 +3177,7 @@ static void device_model_spawn_outcome(libxl__egc *eg= c, =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { rc =3D libxl__ev_time_register_rel(ao, &dmss->timeout, devise_model_postconfig_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeo= ut() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; dmss->qmp.ao =3D ao; dmss->qmp.domid =3D dmss->guest_domid; diff --git tools/libs/light/libxl_domain.c tools/libs/light/libxl_domain.c index 6751fc785f..2fc3481f78 100644 --- tools/libs/light/libxl_domain.c +++ tools/libs/light/libxl_domain.c @@ -1882,7 +1882,8 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t dom= id, case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: rc =3D libxl__ev_time_register_rel(ao, &svos->timeout, set_vcpuonline_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_t= imeout() + + LIBXL_QMP_CMD_TIMEOUT) * 1= 000); if (rc) goto out; qmp->callback =3D set_vcpuonline_qmp_cpus_fast_queried; rc =3D libxl__ev_qmp_send(egc, qmp, "query-cpus-fast", NULL); @@ -2353,7 +2354,7 @@ static void retrieve_domain_configuration_lock_acquir= ed( */ rc =3D libxl__ev_time_register_rel(ao, &rdcs->timeout, retrieve_domain_configuration_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeout() + LIBXL_QMP_CMD_TIMEOUT)= * 1000); if (rc) goto out; libxl_bitmap_alloc(CTX, &rdcs->qemuu_cpus, d_config->b_info.max_vcpus); diff --git tools/libs/light/libxl_pci.c tools/libs/light/libxl_pci.c index 7bdd9f6c3b..3120649a8e 100644 --- tools/libs/light/libxl_pci.c +++ tools/libs/light/libxl_pci.c @@ -1165,7 +1165,7 @@ static void do_pci_add(libxl__egc *egc, case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: rc =3D libxl__ev_time_register_rel(ao, &pas->timeout, pci_add_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1= 000); + (__libxl_device_model_sta= rt_timeout() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; =20 pci_add_qmp_device_add(egc, pas); /* must be last */ @@ -2030,7 +2030,7 @@ static void pci_remove_qmp_device_del(libxl__egc *egc, =20 rc =3D libxl__ev_time_register_rel(ao, &prs->timeout, pci_remove_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeout()= + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; =20 QMP_PARAMETERS_SPRINTF(&args, "id", PCI_PT_QDEV_ID, diff --git tools/libs/light/libxl_usb.c tools/libs/light/libxl_usb.c index c5ae59681c..59db8a6f64 100644 --- tools/libs/light/libxl_usb.c +++ tools/libs/light/libxl_usb.c @@ -487,7 +487,7 @@ static void libxl__device_usbctrl_add(libxl__egc *egc, = uint32_t domid, =20 rc =3D libxl__ev_time_register_rel(ao, &aodev->timeout, device_usbctrl_add_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeo= ut() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto outrm; =20 qmp->ao =3D ao; @@ -644,7 +644,7 @@ static void device_usbctrl_usbdevs_removed(libxl__egc *= egc, =20 rc =3D libxl__ev_time_register_rel(ao, &aodev->timeout, device_usbctrl_remove_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeo= ut() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; =20 qmp->ao =3D ao; @@ -1794,7 +1794,7 @@ static void libxl__device_usbdev_add(libxl__egc *egc,= uint32_t domid, =20 rc =3D libxl__ev_time_register_rel(ao, &aodev->timeout, device_usbdev_add_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeo= ut() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; =20 aodev->qmp.ao =3D ao; @@ -1976,7 +1976,7 @@ static void libxl__device_usbdev_remove(libxl__egc *e= gc, uint32_t domid, =20 rc =3D libxl__ev_time_register_rel(ao, &aodev->timeout, device_usbdev_remove_timeout, - LIBXL_QMP_CMD_TIMEOUT * 1000); + (__libxl_device_model_start_timeo= ut() + LIBXL_QMP_CMD_TIMEOUT) * 1000); if (rc) goto out; =20 aodev->qmp.ao =3D ao; --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89