From patchwork Thu Dec 14 14:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 753930 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp786078wrr; Thu, 14 Dec 2023 06:43:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy5nZI98R5Y/Z3Lsbwg3pxsdPWeX4pW83PAcOixFjpXNeaour1fdcXPfVTXi6EyK3qPDmu X-Received: by 2002:ac8:5802:0:b0:425:4043:8d3a with SMTP id g2-20020ac85802000000b0042540438d3amr9408088qtg.85.1702565023264; Thu, 14 Dec 2023 06:43:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702565023; cv=none; d=google.com; s=arc-20160816; b=R5Lwif5JhD6kFbLucsqoDPrIXI/5iPd3FDKdczDHe4teWXdLF18yLDV5y4sQO6KxnU UImv/DtMtfBISuIYkyt3daNVJBPPIznbYyOInuubIgGAtQDvWeopdxQpzHyWjr3DcaDe /ROo9ABDsEG2UuTbvPeL4R9XG0vhjND/kMNCRELQ60qQpbPol1kXZSFyCh/Vj43w7Bbv MSNQGqj3O5UNOHrgyD3JCwohh5c5uGQ5JzjS/iLHQHX5gTzcRYCSYJ5J5ssm1l0vVIyR vuVH+G/XsWmWYoIy9CtO6mBhLwRabQ2WmdOTOCKKvGPSXrOBRjdHHG1o15IXUEqNOe3O Gnwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=1SWxyyNzlsjwPy0q/4QbwRxuffpVyZhHt3UlcyYmbr8=; fh=o4ck4AEsCYcp/SZGIlDJThLkUdxsh98kBsNbvZ3WOKA=; b=OAupVe+gyAIAVZ6Y25ZQ/1WOvGOSdWjYlIZ0nuqA/Pq6FCqzzAoHNjsvBKCsMN9ag5 HRPmGW9x/cnuQ7vyCmyUukMsqVgKkNtcumibOophrrbDXSuZ5jpRRbCBdLelPfLJRjVW hFuQRkfjBDWbN3s4DZ9dBAY6GH+Dnbw7PgkK6113OzyZPA4KLTWP0QX/AQ8lYnZznXnO BfV8yqTie5/08nwc1yhbtRHRGoVetZgFE0WCBSdCwhg0+v6p8wI4idV4Oq14Lij9eSBG LGrgfcPDhO1aNFYTpgALwiRv+ViUIFgNisr1974t3liRklxH4ZNZ//klbRSZi6FJjxAV ICDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4CQJGMC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a11-20020a05622a02cb00b0042574ea09e3si8965427qtx.429.2023.12.14.06.43.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Dec 2023 06:43:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4CQJGMC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDmvQ-0002ul-UN; Thu, 14 Dec 2023 09:42:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDmvN-0002u0-ID for qemu-devel@nongnu.org; Thu, 14 Dec 2023 09:42:53 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDmvL-00009l-Sa for qemu-devel@nongnu.org; Thu, 14 Dec 2023 09:42:53 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3364a5ccbb1so464234f8f.1 for ; Thu, 14 Dec 2023 06:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702564969; x=1703169769; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1SWxyyNzlsjwPy0q/4QbwRxuffpVyZhHt3UlcyYmbr8=; b=a4CQJGMCUQZO0XoGp0Xtm7OekR5ZVr6yBwyIWX9TBVJj54vc0ZwOggwFPQoEAnnVgg SjbXZgHW18J5/rA3YkNtBcNYKTV4aNKbyO+nQxZat1KitqA1HXu3raczm6hBt8Yry1jv 8b0oZNaQDdQiiojpuITkZ5NvlMEECmutRLj9anJ+Sp2dBM4EmV2q38JX6+VKXu09dSki peOJl1xksaEK5BP55wCnTlK51t8NdzPq1C3INJMiz/mnxwODJhe4JZIw4y5CdcuEZA2O FRsu/sUaPSbUKiCua7/LCXlaElQihoqYkISYDrDtucIpcv1U4bxyRGSDPg+w+J/yNzrP hKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702564969; x=1703169769; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1SWxyyNzlsjwPy0q/4QbwRxuffpVyZhHt3UlcyYmbr8=; b=fi4w50utfdcd5XYhtcKbgnt+PJyOLoiayQAiF48m7JhlOxA0sA345wxWbqd/Kv6ccz y/BvzuB3yQVACGApXSmYRKwM7qxdUb9E279lflNxMBZdPC0K/ujYLq7jYPJkG3TGw8Mr fsL8ihCFDsbqrK7yEid4zebZ63SXfZ9y5q6IkmQOTRav+yWxpkX/ba/+sMwCW0Rgudv5 2K0Aw8tbrGjUkDy7hjVin0YB0J1J4z6chyxX6xS/19/m1R5JMZ1Tbx66gCnw+ZKu7e/R gt6ClR26Kg5225TiOehrOD/EhUjXllSujIbEpikpxxSs5nkfo79jnlJRk9+xYI77F8Ev rGOA== X-Gm-Message-State: AOJu0Yw0uuyzGmH0EawsxQzsUrH7epytHfvAlNCVlpE5xAjHR2plCtkb iURZ2Z0uWCL9tsksvqog0nsl0g== X-Received: by 2002:a05:6000:1b86:b0:333:5247:be11 with SMTP id r6-20020a0560001b8600b003335247be11mr5103718wru.119.1702564969390; Thu, 14 Dec 2023 06:42:49 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j4-20020adfea44000000b00336471bc7ffsm1917888wrn.109.2023.12.14.06.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:42:49 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A4FC25F7A7; Thu, 14 Dec 2023 14:42:48 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , David Woodhouse , Paul Durrant , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Paolo Bonzini , kvm@vger.kernel.org (open list:Overall KVM CPUs) Subject: [RFC PATCH] tests/avocado: avoid a copy to support read/write rootfs Date: Thu, 14 Dec 2023 14:42:43 +0000 Message-Id: <20231214144243.36887-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While the test causes the rootfs to be updated we don't actually need to persist anything between runs. Avoid the copy by enabling "snapshot=on" for the drive instead. Signed-off-by: Alex Bennée --- tests/avocado/kvm_xen_guest.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py index d73fa888ef..f30313e6cf 100644 --- a/tests/avocado/kvm_xen_guest.py +++ b/tests/avocado/kvm_xen_guest.py @@ -57,14 +57,10 @@ def common_vm_setup(self, readwrite=False): "367962983d0d32109998a70b45dcee4672d0b045") self.rootfs = self.get_asset("rootfs.ext4", "f1478401ea4b3fa2ea196396be44315bab2bb5e4") - if readwrite: - dest = os.path.join(self.workdir, os.path.basename(self.rootfs)) - shutil.copy(self.rootfs, dest) - self.rootfs = dest def run_and_check(self, readwrite=False): if readwrite: - drive = f"file={self.rootfs},if=none,format=raw,id=drv0" + drive = f"file={self.rootfs},if=none,snapshot=on,format=raw,id=drv0" else: drive = f"file={self.rootfs},if=none,readonly=on,format=raw,id=drv0" self.vm.add_args('-kernel', self.kernel_path,