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: 1876219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=a4CQJGMC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SrZq65tp8z20LT for ; Fri, 15 Dec 2023 01:43:45 +1100 (AEDT) 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-Google-Smtp-Source: AGHT+IEtM4YWr1SY7BR4AadjmbL/DehKmBeFshSqCwIBI4qLY+SQ5PNZW7qIchr7zPwTRbVn9BMnuA== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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,