From nobody Sun Feb 8 21:06:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770302971; cv=none; d=zohomail.com; s=zohoarc; b=g4aV7q0JK6xWiUG3V7Itc4ghC8OVmo6CMoZFTdlWz9OdGh35xTsgEHsc5WyJKV9yFGIiNoqL82xWKT46S/t5cqGMUaz0wcu2KnVJAoPK+JBIkQeXKCtleJtXjr5ogmAGRG2n99YynTy7o9bRnHY7krZg8krgbeY2gcoOJeYVNj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770302971; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fEIrvKrLd0swLY9/WjimKLsX0Z/fiphyqnNgm5gCblc=; b=QG2DC7Tda0j5YaOpKzBoZWNn7CCkL7BgMG7DYSlOFWIqnLvDihrINX9sKHYalGRJ8s3B7t9CCK8TJ/CSorLcDQgxJiydIxtdPcQRkbjTmU5YuXKtwlblVbt7S1bX+GtU2TQUSALsx4jKF/cH7MVo2vIsrT++hru0zueE19/8bCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770302971143786.17594616133; Thu, 5 Feb 2026 06:49:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vo0eM-0007ko-Ap; Thu, 05 Feb 2026 09:48:06 -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 1vo0eI-0007jb-62 for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vo0eG-0004Bv-Q4 for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:01 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-31h1vaoFN_ullotA8CN4Jg-1; Thu, 05 Feb 2026 09:47:57 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-480686b3b4cso15419705e9.0 for ; Thu, 05 Feb 2026 06:47:57 -0800 (PST) Received: from localhost (p200300cfd737d06375fda007e5d3c5c8.dip0.t-ipconnect.de. [2003:cf:d737:d063:75fd:a007:e5d3:c5c8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43617cc9515sm13083854f8f.0.2026.02.05.06.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 06:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770302879; h=from:from: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; bh=fEIrvKrLd0swLY9/WjimKLsX0Z/fiphyqnNgm5gCblc=; b=Vy1LUkP1X6ZEcrzoQklCOqYfzHCmZEBUvXyfXHDDGD8VNElQ1BIpsPLorecIwiiq776omH Xv8VQx/XTElmQrhsJmW+MrfNTcyDgY1SJV+CC876Ns869e4K2M0DNRg0ZkhD3DcYI15kMX O4qz8/88aLhBKRg/gFqvkGhmsUcQCg8= X-MC-Unique: 31h1vaoFN_ullotA8CN4Jg-1 X-Mimecast-MFC-AGG-ID: 31h1vaoFN_ullotA8CN4Jg_1770302876 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770302876; x=1770907676; darn=nongnu.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=fEIrvKrLd0swLY9/WjimKLsX0Z/fiphyqnNgm5gCblc=; b=etZ50a1YP8tO2hZmbrvS6vnVVPbHWkIosIFcJcW0BUoVI3ZqNskSNDYq2/b31rgAkx p+WSN5UmJTjGMFuA1zT50PvolSLmOx3Nkwezcky4TE2QCBMfvyStUEma9lL9VAqL+V+P 6j8jdkIsllNJh2IJv1z5uFEwPeY3drcZ2k0Pt5uXfJAI8cJ3/U82Dq4RHIX8BfnCVvSe r8uq1FdzGwuyF9zl7QlA23iC6CIboKMW1bx68JIzijonTLoYAROrjGnDnYRMkSioLzZ+ 6JfyS9r7mS2uK2Z/AomgcTzuoZuL7U14rqkz2b0K3z1QGhHSZ7tcKEXsOFHxCGKyjQ7I apsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770302876; x=1770907676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fEIrvKrLd0swLY9/WjimKLsX0Z/fiphyqnNgm5gCblc=; b=IAWFGqYKkO7ipDrpbA00vlR/3QE/T3LgkigGDUJiuU3B7WsjBAwHeY7R22Lmam5dT7 vUXHmT9QJPXcaHj7XYGgIrSnK47FmBthQZTvLPVGap1rijCI4zSMiUxTUH0JbWDe3SZx F7GntTBZQqGcAdPKyefpUhDCY53eqi39zXLPeFm/0ZYeUo9ZFWavxOQ7QH+kdp8euXFV HAqfdI8MCiN0IaTwCdzRXQN4X1zkJzFxOebKEycaaFriWGuij1RXqrI1L8Sg0xk9satx vwBt0D+ttghKZ9UZRo9nwYAsQhINyPr74A148ZaAp8ru8svf8F39gywxtK6wWvGZ1bWe hTZw== X-Gm-Message-State: AOJu0YxityxkdKqF+kPp2C4p6o94YV9ESMaLJ1Z1C9M02Lfbhr3GBt1W ThPZtIcIsw/U6xXVCAWyPB3BL9Q3q6E/4CmlmyRYTna7Q3GLaColF9pYRMoDS1MLH3h1bjPoGZp vKcNCl80y4qE11e4uC0L96KO5LNF7N/IpgeaXFe9qtWIEsV8FEa8hxO/h X-Gm-Gg: AZuq6aJ8hhjoHWWk0oIz3HPkJMyZDacORXvqiTMjW+sU7XrnNnhpNwgsYr+rb1NODzb zVPY5dgakxOY/D29yPLXQz9PGRQJVeCQwHXieL6axNQJU3i8+W/L0a2uIdjxgPvpgwqokDPJhMt 8S+RUZgzUhWpd7U7BWBE5xiQXLgkxvE5gR8igsznP0FFtceLf294wgPHrYp5rr7Y4hWNzYVcw06 cLX2yCAqzzYj/i33IwGKZcydE23uxr/0Xoyhn4EhE5uDpHMySF76WCBLzhQJxmb6Ev9RzYBIgXi WkENHEbDDKLQswtGoW3O+jt3yVXo3A+3cM4O13V8TTBlso3NMyTK2EvK6/6PrpXYVJeLf95yRmo RQn1JZMAsp85JUGNNeJeOBEIm0o02zpka++OId2s0r/vFXLBYhy0OrvKQ5aTZJts1IgqB X-Received: by 2002:a05:600c:848a:b0:47d:403e:9cd5 with SMTP id 5b1f17b1804b1-4830e9303a6mr98427225e9.11.1770302876183; Thu, 05 Feb 2026 06:47:56 -0800 (PST) X-Received: by 2002:a05:600c:848a:b0:47d:403e:9cd5 with SMTP id 5b1f17b1804b1-4830e9303a6mr98426815e9.11.1770302875705; Thu, 05 Feb 2026 06:47:55 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf Subject: [PATCH 1/5] qcow2: Skip data-file resize if possible Date: Thu, 5 Feb 2026 15:47:31 +0100 Message-ID: <20260205144737.31131-2-hreitz@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205144737.31131-1-hreitz@redhat.com> References: <20260205144737.31131-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770302973726154100 Content-Type: text/plain; charset="utf-8" With PREALLOC_MODE_OFF, we currently always resize the data file to the right length. This is definitely not necessary if it already has the correct length, and if @exact is false, we also don't need to shrink it. This is what other preallocation modes already do: preallocate_co() only increases the data file size if it is too small, but never shrinks it. (And note that for raw data files, PREALLOC_MODE_OFF is silently turned into PREALLOC_MODE_METADATA, so this commit only changes behavior for non-raw external data files.) For the next commits, having all preallocation modes behave the same will make it easier to decide when we can skip taking the RESIZE permission on the data-file child. Signed-off-by: Hanna Czenczek --- block/qcow2.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index e29810d86a..69d621e9bf 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -4515,15 +4515,22 @@ qcow2_co_truncate(BlockDriverState *bs, int64_t off= set, bool exact, switch (prealloc) { case PREALLOC_MODE_OFF: if (has_data_file(bs)) { + int64_t data_file_length =3D bdrv_co_getlength(s->data_file->b= s); + /* * If the caller wants an exact resize, the external data * file should be resized to the exact target size, too, * so we pass @exact here. + * Without @exact, we leave it as-is if it is already big enou= gh. + * Implicitly handle bdrv_co_getlength() errors by resizing. */ - ret =3D bdrv_co_truncate(s->data_file, offset, exact, prealloc= , 0, - errp); - if (ret < 0) { - goto fail; + if (data_file_length < offset || + (exact && data_file_length !=3D offset)) { + ret =3D bdrv_co_truncate(s->data_file, offset, exact, prea= lloc, 0, + errp); + if (ret < 0) { + goto fail; + } } } break; --=20 2.52.0 From nobody Sun Feb 8 21:06:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770302937; cv=none; d=zohomail.com; s=zohoarc; b=cZF+9W4cXdZIp/yChAj5kww2bq8JWX2x8yftPjVxDBHDAH0iGzh6a8nRGDkbWfNoS9eA3xqZK/535+jlcNA3yldkLKfVTXc3fRIPl17f/hbkSgW/2Ny9eOI6t9v1K9eZr0Yse7cxeW4cX6wmAG5syS9C4SslEvXPrkbz+TUJrlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770302937; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OBLrgUT4SfRJL0oHz2LpcYh6U/+GwUwU1+4XoRPSUmo=; b=bZT8EJA/1w0nyUqLmd5FSGnuZnvWyxSf8vGlO1IYbTKtHteWh8XauJT7ljN3mt2j85dhBq4tV5fLauWmJ40wYFAUYarYItro7JKvv+FvIwjZ+jkWL10N4F0mxeqy7VymiEyt6BsqM+jBQtGyp/DDwML9eGsmhkmPb2ypVXhCe7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177030293714948.4640136937204; Thu, 5 Feb 2026 06:48:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vo0eN-0007kw-6G; Thu, 05 Feb 2026 09:48:07 -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 1vo0eK-0007kB-0I for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vo0eI-0004CI-JF for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:03 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-ajfyp4JiMQKkYNXgWi2YcQ-1; Thu, 05 Feb 2026 09:48:00 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-435991d4a3aso734138f8f.1 for ; Thu, 05 Feb 2026 06:48:00 -0800 (PST) Received: from localhost (p200300cfd737d06375fda007e5d3c5c8.dip0.t-ipconnect.de. [2003:cf:d737:d063:75fd:a007:e5d3:c5c8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4361805815esm13324642f8f.20.2026.02.05.06.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 06:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770302881; h=from:from: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; bh=OBLrgUT4SfRJL0oHz2LpcYh6U/+GwUwU1+4XoRPSUmo=; b=akRCU+mD5J4krEMn7yOIPrDqKDcSlmQKEcZZyyOme23XQ93jfsRdQjgzR9RTIyWNTNlqsC aHcmkgXvXmw2d1rJZ2Tloxyzv1lDUNFCa6xE8W2ka2LI+9aIaBMMmFW5cg44cxpTf8SsgG t9syPzT5ebkf24AzKueERRcfye5JWrQ= X-MC-Unique: ajfyp4JiMQKkYNXgWi2YcQ-1 X-Mimecast-MFC-AGG-ID: ajfyp4JiMQKkYNXgWi2YcQ_1770302879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770302879; x=1770907679; darn=nongnu.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=OBLrgUT4SfRJL0oHz2LpcYh6U/+GwUwU1+4XoRPSUmo=; b=bN7MNtrtJkCP9utYXzHmwCVgq1gg4v+oLB4l0OkJU6VM9reqPF/wwZ05cieS4omvNI X3ekuNpTO40GJY/ctXecTMnMo1n8fyzKRWptJ6nFQKSxAopBDanxX7fiM5VejRUaBhxw 9fLLKdkaQ1iLaNByh3cnjtMoYUyrXMuxxkYWmWSA8KBjdk1pPMm4CKeQAmWlvBD8x9pp K8hMPeIXBXP26NlqDUgOIfAkwUH0FVzaKV+jNJbhgZ9CQU7r5qcFtMp0/T5IO5tP/bQZ T5Lk3ER53dK3AvylqG5jxuBx4hEgDuzjNM0YsGrvn3R6V5AVZlttNc6rafdAh9DNpW9F hV9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770302879; x=1770907679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OBLrgUT4SfRJL0oHz2LpcYh6U/+GwUwU1+4XoRPSUmo=; b=iUxweQuC+6sjaW/MagUGsyHbeMcEpw0ZMLBfSC6r4onaVBqD8b5p0eA/5RNo7an+2N mZZKIem+UqHu+xbYMXXG0XtNAlJcdQPjU27770TMURTgBW45RmLWbzsstxwoAEYYQqoq tr/PgM2J68zj8Hi/mjYOpsCQao3s9iHn2sIK/F2kSgFysyBsRyeCesrac1RXW1+FLxp2 4ebHkV3PShjOmxpJgwH8RTCXvXJpkQ2pBfREJaXGe+oXmG0SDDzZwSyD1scTh8ehomgF rxEYaax2DBeOvmnAIyQR71BvkpX494RrfDRKDlwH+BGIs9igoQHS8zPVHorx4/pe5tPP m2bw== X-Gm-Message-State: AOJu0Yz88GwCkaqZRxGpe9i/oZ2GJTv1WUn0DEQXFoJQZp+1aqGMEm+U 4LYhTG4e2s3cZ/n0OeRcg3lDyeQpQX3IXV/tC6iEKLz1WXnToY1DdBsq8lRqtj6jyLcvWSoUVar g8YN3orquBnk6e5UJRkeR6ONwSG+Go5ixJq/kw3zTvRuftgnW0SY7qbPo X-Gm-Gg: AZuq6aKpETIh9cSBs28uilM4Rk7q6I4tnkh8iWSSQg9cy4kiv3wUCD6QuW+Of1PS20U Sl/qGofGRMGC+2Ud8Vij9F/BuumR2sm3H7eV+1vSr0I2hfPSp/4IFXCGNMc7MdfYXk1LXoDGq8P K8roGX70K4bNid3cPQ7D/GEJ06LmZBxvVxA323Tx4Xlrbx/shUkKyebhuAzD4gYqeqmNMLINaWY BzCLY2qrau8wqotqV3EmdCOEeNpJqtxq3+G6rmF5SjjqUIYEcAK5Nx9PR+PaT6lrq+IealpgCqL s62qYeN4D/obEqUpXzEf2JKbBrb4lEqMdOJQGzJYoiDg4UO7xwVnVW2vlJktiw1YJs87vPxFgNk gyl09mwrJAURBYgC5Hml6m+yV1PUEwDgkB/fcQrse6givPI4WOReoSgcyFFjAwf84ZHMU X-Received: by 2002:a05:6000:26c9:b0:435:a83e:88f with SMTP id ffacd0b85a97d-43617ccd136mr9324854f8f.0.1770302878956; Thu, 05 Feb 2026 06:47:58 -0800 (PST) X-Received: by 2002:a05:6000:26c9:b0:435:a83e:88f with SMTP id ffacd0b85a97d-43617ccd136mr9324802f8f.0.1770302878404; Thu, 05 Feb 2026 06:47:58 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf Subject: [PATCH 2/5] block: Introduce BDRV_O_NO_DATA_{WRITE,RESIZE} Date: Thu, 5 Feb 2026 15:47:32 +0100 Message-ID: <20260205144737.31131-3-hreitz@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205144737.31131-1-hreitz@redhat.com> References: <20260205144737.31131-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770302939245158500 Content-Type: text/plain; charset="utf-8" Add BDS flags that prevent taking WRITE and/or RESIZE permissions on pure data (no metadata) children. These are going to be used by qcow2 during formatting, when we need write access to format the metadata file, but no write access to an external data file. This will allow creating a qcow2 image for a raw image while the latter is currently in use by the VM. Signed-off-by: Hanna Czenczek --- include/block/block-common.h | 11 +++++++++++ block.c | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h index c8c626daea..504f6aa113 100644 --- a/include/block/block-common.h +++ b/include/block/block-common.h @@ -245,6 +245,17 @@ typedef enum { =20 #define BDRV_O_CBW_DISCARD_SOURCE 0x80000 /* for copy-before-write filter = */ =20 +/* + * Promise not to write any data to pure (non-metadata-bearing) data stora= ge + * children, so we don't need the WRITE permission for them. + * For image creation, formatting requires write access to the image, but = not + * necessarily to its pure storage children. This allows creating an imag= e on + * top of an existing raw storage image that is already attached to the VM. + */ +#define BDRV_O_NO_DATA_WRITE 0x100000 +/* Same as O_NO_DATA_WRITE, but for resizing */ +#define BDRV_O_NO_DATA_RESIZE 0x200000 + #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_NO_FLUSH) =20 =20 diff --git a/block.c b/block.c index 48a17f393c..cdfed7a4d8 100644 --- a/block.c +++ b/block.c @@ -2887,6 +2887,21 @@ static void bdrv_default_perms_for_storage(BlockDriv= erState *bs, BdrvChild *c, if (perm & BLK_PERM_WRITE) { perm |=3D BLK_PERM_RESIZE; } + + if (!(role & BDRV_CHILD_METADATA)) { + /* + * For a pure data storage child (no metadata), these flags + * respectively promise that + * - nothing will be written, and/or + * - it will not be resized. + */ + if (flags & BDRV_O_NO_DATA_WRITE) { + perm &=3D ~BLK_PERM_WRITE; + } + if (flags & BDRV_O_NO_DATA_RESIZE) { + perm &=3D ~BLK_PERM_RESIZE; + } + } } =20 if (bs->open_flags & BDRV_O_INACTIVE) { --=20 2.52.0 From nobody Sun Feb 8 21:06:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770302962; cv=none; d=zohomail.com; s=zohoarc; b=MdR2ep+0Z4ATWCbUck7l+ZHdD1/G0dpBAzQgwZmgurDVKB9NKve4ej1b41bSy78qQtSRuHDBnuJcBCeR6JKAAoqNf3yNY9X/T8BuAHECzRuyFq8NqzTLmePh/+A+FMyTPhqztuVtw1PZWu3clhZzg225hgzH2J8tAyhp9AzkbCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770302962; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7rmSCRaAh/QmZON38XBXZLIptMu9K4kVvhHupa/JoYQ=; b=Mls21FQC/sjj4WXu/QjMSl4MWvBPAbWhKENbzxRC3eM1JUXvDYCRUn9NyuB7x5LFrvJtkgWYt8YRvbvMpnQNBu4PsZ9fbzy18zUPYTtgFYzwEhyA8O/vQgBfY7iwwbHh0/ru4Vh5Jg7q5YUlClySrJ/uTFRhV3pnhNybh6WC1ow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770302962292916.5566058253779; Thu, 5 Feb 2026 06:49:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vo0ei-0007nu-1s; Thu, 05 Feb 2026 09:48:28 -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 1vo0eQ-0007lr-Mh for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vo0eL-0004Co-91 for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:10 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-436-VgSjyxkDOLazjAnnHW_q5Q-1; Thu, 05 Feb 2026 09:48:03 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-430fe16b481so730620f8f.3 for ; Thu, 05 Feb 2026 06:48:03 -0800 (PST) Received: from localhost (p200300cfd737d06375fda007e5d3c5c8.dip0.t-ipconnect.de. [2003:cf:d737:d063:75fd:a007:e5d3:c5c8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4361805f8b4sm14265607f8f.36.2026.02.05.06.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 06:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770302884; h=from:from: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; bh=7rmSCRaAh/QmZON38XBXZLIptMu9K4kVvhHupa/JoYQ=; b=UKtUk5iq07rMcthD7ypaokyYhQ2ns2pqr5LSdgZeSIjB+DGCCG14bGfJqEtkHmcC9RJAXT v/FvDoFdVqLn6HHWHn8y1mhvk8105qVyMjmgK23OhjAFLawKTyGP9EFxju6beSdyH0Xa5O IL1Pg3rV65c3q+TlCyr+GVtsskT4+9E= X-MC-Unique: VgSjyxkDOLazjAnnHW_q5Q-1 X-Mimecast-MFC-AGG-ID: VgSjyxkDOLazjAnnHW_q5Q_1770302882 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770302882; x=1770907682; darn=nongnu.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=7rmSCRaAh/QmZON38XBXZLIptMu9K4kVvhHupa/JoYQ=; b=i9w/ifeff/yQ0TLjfonO183TgocjGlaFdap1aCiEbxwN5hlX8mbn/oN+Z9QwhtW4ND 9g5vKyI6zamycQWUIN4TjbvSA1tVkZPTHhn094Df49BEvsR5uURg4eTkQW2H2Rp87wAL okcjzymx8xtJQBnCN2NsddOTHlIPKOHdAoGjcq9DTGr5IpFoYePH7jbr6d7LzGxpDGoD jjX9crJum204C5/M2lKK/RdCDQ7O/qwzztUTzAb446xWTaxBu8fXQ7c0l/Kh9qFAi8U/ gzHHLh6hHVFquzZ6QtB/zkT48bvvdPWutT+BNbd+VJUStRRSHn024EpfZzsqduTsHc4v 9ozA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770302882; x=1770907682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7rmSCRaAh/QmZON38XBXZLIptMu9K4kVvhHupa/JoYQ=; b=U/P37hK0aNkjlaiCHuukoFr1MVm/7xyl7HetKCWEEheEo7KVyAfWASfB46eRvqc13a 7+LZEPReCb4FB5weEAGsHRsMp8DhU6/zVPleb/ZbS1Gm2WAHQ2Bj2+/dUUOoD/Hfnm8f b7XKNTQ8KMBOF8Y+Nt4lT6yBhR59LodqsgKIyXM0apsszOOwAA0wB2CaK0Lf2qBB2xHd HvwY+iyxAc7MUmEN3GPKbDCpRXqri77ADEZhrdiZ7EPyzPtmtmOvqfbvU1+WELmCrdUs BxB7iWbmKpXmFWphq0Cmnlgv2tlxDA+fsq4oZ4WmEbzNUpY+4NeTGFeCd0CkbL547nQ5 A3zQ== X-Gm-Message-State: AOJu0Yw349eY7ZazpKyY5p8rjQpiU7O1GZc2E7pmA0pzsxbohX/esIR4 i25AOaS6YrVqtbcSuLQattaX2gJnEiIMgMh+6jEuxO6KF4Yb0Dq51aO0TjI+s97Dn2qN0MnYWL7 mZHMQtTTfOc1aNJ1qZJ8gAIXy962bt3dtw6561Z4AxAMN4YBUANdLN6q5 X-Gm-Gg: AZuq6aKd2plqB5hRFiOjfFv+fTN2l6jMuDklEtkzmRIrj884koTpovy3CyQK7ZmsbiA 8ODiPF8O9IRAqEvmo0JCsm8qJkNmVFCFWS7SJPN0Tx18q2NLLYJedzQJUFcQq1BvRGM/F9wv9pC 54+O+rI9VY0/IZgOX4ALPNEgHi+SwRrXhSku4PmdEOPAazMIgeUoihIvUDRD48g6bft58M7oipE c7+AfMja+Jx7ig9rPNU5j33onRV6KGQL0NzXbq+U+WjZWf9vdvUQs1h7tpeX16rH0z2fnbXk+vP 4Ze9sOuNQk++f3FdQM/NchKuJzh2x1oUbNMhdcyD3S9w6Jqr9mIKU23vdRmnNFJ74g+bRs5M4vO grbJ7Fh2G0+aApllKZ7Jntd1QZANnslfwORk25HNVjkuwHs4GfFQGboV04ptglXXUkPCP X-Received: by 2002:a05:6000:2011:b0:431:808:2d32 with SMTP id ffacd0b85a97d-43617e39901mr9649320f8f.7.1770302882113; Thu, 05 Feb 2026 06:48:02 -0800 (PST) X-Received: by 2002:a05:6000:2011:b0:431:808:2d32 with SMTP id ffacd0b85a97d-43617e39901mr9649287f8f.7.1770302881645; Thu, 05 Feb 2026 06:48:01 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf Subject: [PATCH 3/5] qcow2: Preallocation: Do not COW after disk end Date: Thu, 5 Feb 2026 15:47:33 +0100 Message-ID: <20260205144737.31131-4-hreitz@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205144737.31131-1-hreitz@redhat.com> References: <20260205144737.31131-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770302963212158500 Content-Type: text/plain; charset="utf-8" When creating/resizing an image with/to a non-cluster-aligned length, we currently implicitly COW the cluster tail after the guest disk end. That is unnecessary, but more importantly, when creating a qcow2 image for a pre-existing external raw data file, we should not write to it unless data preallocation was requested. So far, writing to the data file past the guest disk end during qcow2 image creation may just be a peculiarity. But the next commit in this series will make qcow2 use the BDRV_O_NO_DATA_WRITE flag to suppress taking the WRITE flag on the data file during image creation, to allow users to create a qcow2 image with an existing raw image as its data file that is currently in use by the VM (i.e. the WRITE flag is unshared). To make this work, we really must not write to the data file at all during creation, unless data preallocation (falloc/full) has been requested. (The comment added in this commit therefore primarily reasons with the use of that flag, and how we must not break it. Admittedly, that only makes sense after the next patch in this series.) Note that this means that creating/resizing images with/to a guest disk size that is not aligned to clusters will create a partial data cluster at the image end when preallocating (except for falloc/full preallocation without a data file). I think that is fine, similarly to how creating a non-preallocated image will generally leave a partial cluster at the end, too (the L1 table). It does mean iotest 125 needs to be adjusted, though. Signed-off-by: Hanna Czenczek --- block/qcow2.c | 18 ++++++++++++++++++ tests/qemu-iotests/125 | 17 +++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 69d621e9bf..b601bd540d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3368,7 +3368,25 @@ preallocate_co(BlockDriverState *bs, uint64_t offset= , uint64_t new_length, } =20 for (m =3D meta; m !=3D NULL; m =3D m->next) { + int64_t disk_end_ofs; + m->prealloc =3D true; + + /* + * Do not COW beyond the supposed image end: There is no point= , and + * it could break BDRV_O_NO_DATA_WRITE from qcow2_co_create(): + * qcow2_alloc_host_offset() does not COW anything for the ran= ge we + * pass, but everything outside. If growing to a non-cluster + * aligned size, it will thus request COW beyond the image end, + * breaking the BDRV_O_NO_DATA_WRITE promise. + * (As long as the @offset passed to this function was aligned= to + * full clusters, that is the only possible instance of COW. = With + * qcow2_co_create(), it's always 0, so always aligned.) + */ + disk_end_ofs =3D new_length - (int64_t)m->offset; + if (m->cow_end.offset + m->cow_end.nb_bytes > disk_end_ofs) { + m->cow_end.nb_bytes =3D MAX(disk_end_ofs - m->cow_end.offs= et, 0); + } } =20 ret =3D qcow2_handle_l2meta(bs, &meta, true); diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index 708e7c5ba2..8213de012e 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -172,10 +172,10 @@ done # Test image resizing using preallocation and unaligned offsets $QEMU_IMG create -f raw "$TEST_IMG.base" 128k | _filter_img_create $QEMU_IO -c 'write -q -P 1 0 128k' -f raw "$TEST_IMG.base" -for orig_size in 31k 33k; do - for dst_size in 96k 128k; do +for orig_size in $((31 * 1024)) $((33 * 1024)); do + for dst_size in $((96 * 1024)) $((128 * 1024)); do for prealloc in metadata full; do - echo "--- Resizing image from $orig_size to $dst_size (preallo= cation=3D$prealloc) ---" + echo "--- Resizing image from $((orig_size / 1024))k to $((dst= _size / 1024))k (preallocation=3D$prealloc) ---" _make_test_img -F raw -b "$TEST_IMG.base" -o cluster_size=3D64= k "$orig_size" $QEMU_IMG resize -f "$IMGFMT" --preallocation=3D"$prealloc" "$= TEST_IMG" "$dst_size" # The first part of the image should contain data from the bac= king file @@ -183,10 +183,15 @@ for orig_size in 31k 33k; do # The resized part of the image should contain zeroes $QEMU_IO -c "read -q -P 0 ${orig_size} 63k" "$TEST_IMG" # If the image does not have an external data file we can also= verify its - # actual size. The resized image should have 7 clusters: - # header, L1 table, L2 table, refcount table, refcount block, = 2 data clusters + # actual size. The resized image should have 5 metadata cluste= rs + # (header, L1 table, L2 table, refcount table, refcount block) + # plus the data. We round up that data to full clusters for f= ull + # preallocation, but not for metadata preallocation. if ! _get_data_file "$TEST_IMG" > /dev/null; then - expected_file_length=3D$((65536 * 7)) + expected_file_length=3D$((65536 * 5 + dst_size)) + if [ "$prealloc" =3D full ]; then + expected_file_length=3D$(((expected_file_length + 6553= 5) / 65536 * 65536)) + fi file_length=3D$(stat -c '%s' "$TEST_IMG_FILE") if [ "$file_length" !=3D "$expected_file_length" ]; then echo "ERROR: file length $file_length (expected $expec= ted_file_length)" --=20 2.52.0 From nobody Sun Feb 8 21:06:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770302969; cv=none; d=zohomail.com; s=zohoarc; b=KOsTX0XDeYV2iCWaH78+ntbGCZsUJ79cUQyL6Dp78srpQBramXXHKngMJMvCP4PUtHujHvdD8CBUF0qbCHq7pqRdljirTJyXy7/1XDTEmayaC98bcZ+JlO05tNdX20CKhcEwzEKTK+AE0re/oiI06uXBJ4enuR9ARwog9g6Y8jI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770302969; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N3seRjL0k8dNcaI66dd3c3Rct/8NtSmjoxT2fcuE65g=; b=G3KCB+PjT5t6Wc64P5KFfY9IhtJRlgNfhBk/7V6M64SeJR0RpzpbpIZsaSQSQeaDeJoTMeCX/d3jeKzDMM0TueHWgqN1rqDbu5laDMbl54bvKKplyB0vAy7r2RMfUXRUBEmZRkM6+tR+G09cHmU4jbWtf9xHDjs/o1Nk634knGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770302969720507.0330376294754; Thu, 5 Feb 2026 06:49:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vo0ek-0007p3-3G; Thu, 05 Feb 2026 09:48:30 -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 1vo0eW-0007mx-Kz for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vo0eP-0004DB-1I for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:15 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-3BBno-KOPleD8x1zZyHWiw-1; Thu, 05 Feb 2026 09:48:07 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4831192e66aso9720735e9.2 for ; Thu, 05 Feb 2026 06:48:06 -0800 (PST) Received: from localhost (p200300cfd737d06375fda007e5d3c5c8.dip0.t-ipconnect.de. [2003:cf:d737:d063:75fd:a007:e5d3:c5c8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48317d345c2sm81379965e9.6.2026.02.05.06.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 06:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770302888; h=from:from: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; bh=N3seRjL0k8dNcaI66dd3c3Rct/8NtSmjoxT2fcuE65g=; b=N1WoWSxxlgNJTkg4mPebXV8nmniZi0OMIsp70dFxQ4GuCBXqDce+5m6queK7978//kzV0z ic10Bb68hrt9iT4M1oFHu2+gAhkgP9c9W/GgnjIygauz/diC5QOyPzeCtrcbYMjxBxrVWQ 9v/s+b+X1BimOJJ1gbnpNuDQOShhjjA= X-MC-Unique: 3BBno-KOPleD8x1zZyHWiw-1 X-Mimecast-MFC-AGG-ID: 3BBno-KOPleD8x1zZyHWiw_1770302886 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770302885; x=1770907685; darn=nongnu.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=N3seRjL0k8dNcaI66dd3c3Rct/8NtSmjoxT2fcuE65g=; b=t+xqkW51zyNyXBD75QnI9f16nF+L8XXLZSoKlSKCfEumPRCDbz+i/Pq1O7jH5Lu/+9 QsiZrZ2CNsCL2uvPK0QENIxnFuiQYCQkyMFSkkwcKDk9SfQ8ZmimvmX6ehgyIZBJ+9jP bl4+/b2yzMPVWahnvZSrYTnpFdB608YMq+1PPdGogwNJr34fWl7WA6jisn9YvsLUOcjr b96ehD6fujrFUK2hgHz/hmk/r3QDjj0hYkUUI+XmYJ73NTAM9x/SvLf0YTd7wlRUH2GQ xAplFu36Jy78Iaangzmy5gWwxtjxq1FiC93yG1l6Ka+RtL3qSEJl0ICbaYVVeWHePSYJ csKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770302885; x=1770907685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N3seRjL0k8dNcaI66dd3c3Rct/8NtSmjoxT2fcuE65g=; b=Fv7rzOvtGexX9u8EGBYSX3iVeyR2D8B0xvpT2WmdgRZ3sKyWh/ZxtJ+HazYTEfI6Cz 18rAJTmr/kd5ABa8vM3k6EmEs+fEc1CaFSVh5DAYo/8pvMNvIpll2S8aywKqOCSQBf3m aMCxA/faS8aPhB5vTH69EC1jvIU4Z5RUARrUJpkLC9DQiBoHhVlGMEKlTfMzDhXwQV04 NaDLoxmUD/vO9wQjLjahwZqgM/kvHDvEkI+f7ARQs0dwIoZAqBP6Uhvz9UYoZFP/sXcw Ljb+UykokhItTE0TnhiAIwtBOX6yFv5YVkyWkwij4LhiJUEq9KDP2elvcy1E1U/aRUDR zG1g== X-Gm-Message-State: AOJu0YyBhLPVAx/vR7FGDUWr0cyh2TI25DUXzHsBOx+eMYpzw2Kygl7x mXsI+LKIZ0nUIRgBHXN5PwxsliegvyEl6fcwuPlylitdS6xAFYsqVYIBLdDUhrpLx/6yqXwC4TE WrwAwbGobcim99BWQ9XRavZmBqMU02T78uNivNkRbSPjcER3KtIdPturABghpJThu X-Gm-Gg: AZuq6aJWILujgPBdWqahRvrDUXZTsp9PoF1tJULev1iYFPe5OFr/uFQNO6uko3W1cL1 8zkvM3RJwTqxp96AjhLy+c6h3sIRfjXpzDzfsEf+Fe2Qp1o0U2hXH1fP6wkss6MJxUrvZVGz6tR 5PRCmACpf4YnqayEibl7pwVDCMQx3RDTbLl9Z5zffb96ZRnreAN8pq9ntwnjhKTMM7z8RLbZeAG p3A7JT/3JArpBrJbOZleEG9ECjKJJb5zswdeDsUL3CerNgU/aNRx4iL6SnRlyQKrlli7OngPqSE zPVY8Uom8094xOxt5zqjepwpYBg1ohUnK3GQnw1klre0C1IdImGPEGMBjtQzod/MpidP8kdliJS z+6nVioXTtpFwvElpm0BbW50ecMirA6xff/lJ4lm8KRAEGSxkM6jetSqtOGLe4rboLlNX X-Received: by 2002:a05:600c:468b:b0:47e:e2ec:9947 with SMTP id 5b1f17b1804b1-4830e99d4cfmr93238575e9.33.1770302885069; Thu, 05 Feb 2026 06:48:05 -0800 (PST) X-Received: by 2002:a05:600c:468b:b0:47e:e2ec:9947 with SMTP id 5b1f17b1804b1-4830e99d4cfmr93238205e9.33.1770302884631; Thu, 05 Feb 2026 06:48:04 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf Subject: [PATCH 4/5] qcow2: Suppress data-file WRITE/RESIZE if possible Date: Thu, 5 Feb 2026 15:47:34 +0100 Message-ID: <20260205144737.31131-5-hreitz@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205144737.31131-1-hreitz@redhat.com> References: <20260205144737.31131-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770302971220158500 Content-Type: text/plain; charset="utf-8" When formatting a qcow2 image, we only need the WRITE permission on the data-file child to preallocate data, so for metadata-only preallocation (or none at all), we can suppress that permission via the BDRV_O_NO_DATA_WRITE flag. Similarly, we will only resize the data-file if it is currently smaller than the supposed virtual disk size; so it is already big enough, we can suppress the RESIZE permission via the BDRV_O_NO_DATA_RESIZE flag. This commit allows creating a qcow2 image with an existing raw image as its external data file while that raw image is in use by the VM. Signed-off-by: Hanna Czenczek --- block/qcow2.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b601bd540d..3adc06a9ee 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3627,6 +3627,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options= , Error **errp) size_t cluster_size; int version; int refcount_order; + int blk_flags; uint64_t *refcount_table; int ret; uint8_t compression_type =3D QCOW2_COMPRESSION_TYPE_ZLIB; @@ -3887,20 +3888,42 @@ qcow2_co_create(BlockdevCreateOptions *create_optio= ns, Error **errp) * table) */ options =3D qdict_new(); + blk_flags =3D BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH; qdict_put_str(options, "driver", "qcow2"); qdict_put_str(options, "file", bs->node_name); if (data_bs) { qdict_put_str(options, "data-file", data_bs->node_name); + + /* + * If possible, suppress the WRITE permission for the data-file ch= ild. + * We can only do so as long as none of the operations on `blk` wi= ll + * write to the data file. Such writes can only happen during res= ize + * (which grows the image from length 0 to qcow2_opts->size) with = data + * preallocation. As long as no data preallocation has been reque= sted, + * we can suppress taking the WRITE permission on data-file. + */ + if (qcow2_opts->preallocation =3D=3D PREALLOC_MODE_METADATA || + qcow2_opts->preallocation =3D=3D PREALLOC_MODE_OFF) { + blk_flags |=3D BDRV_O_NO_DATA_WRITE; + } + + /* + * The data-file child is only grown if too small, never shrunk. = So if + * it already is big enough, we can suppress taking the RESIZE + * permission on it. + */ + if (bdrv_co_getlength(data_bs) >=3D qcow2_opts->size) { + blk_flags |=3D BDRV_O_NO_DATA_RESIZE; + } } - blk =3D blk_co_new_open(NULL, NULL, options, - BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH, - errp); + blk =3D blk_co_new_open(NULL, NULL, options, blk_flags, errp); if (blk =3D=3D NULL) { ret =3D -EIO; goto out; } =20 bdrv_graph_co_rdlock(); + /* O_NO_DATA_WRITE note: This will not write to data-file */ ret =3D qcow2_alloc_clusters(blk_bs(blk), 3 * cluster_size); if (ret < 0) { bdrv_graph_co_rdunlock(); @@ -3919,7 +3942,10 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) s->image_data_file =3D g_strdup(data_bs->filename); } =20 - /* Create a full header (including things like feature table) */ + /* + * Create a full header (including things like feature table). + * O_NO_DATA_WRITE note: This will not write to data-file. + */ ret =3D qcow2_update_header(blk_bs(blk)); bdrv_graph_co_rdunlock(); =20 @@ -3928,7 +3954,13 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) goto out; } =20 - /* Okay, now that we have a valid image, let's give it the right size = */ + /* + * Okay, now that we have a valid image, let's give it the right size. + * O_NO_DATA_WRITE note: This will only write to data-file if data + * preallocation has been requested. + * O_NO_DATA_RESIZE note: We pass @exact =3D false, so the data-file i= s only + * resized if it is smaller than qcow2_opts->size. + */ ret =3D blk_co_truncate(blk, qcow2_opts->size, false, qcow2_opts->preallocation, 0, errp); if (ret < 0) { @@ -3945,6 +3977,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options= , Error **errp) } =20 bdrv_graph_co_rdlock(); + /* O_NO_DATA_WRITE note: This will not write to data-file */ ret =3D bdrv_co_change_backing_file(blk_bs(blk), qcow2_opts->backi= ng_file, backing_format, false); bdrv_graph_co_rdunlock(); @@ -3960,6 +3993,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options= , Error **errp) /* Want encryption? There you go. */ if (qcow2_opts->encrypt) { bdrv_graph_co_rdlock(); + /* O_NO_DATA_WRITE note: This will not write to data-file */ ret =3D qcow2_set_up_encryption(blk_bs(blk), qcow2_opts->encrypt, = errp); bdrv_graph_co_rdunlock(); =20 @@ -4401,6 +4435,15 @@ fail: return ret; } =20 +/** + * Resize the qcow2 image. + * To support BDRV_O_NO_DATA_WRITE and BDRV_O_NO_DATA_RESIZE from + * qcow2_co_create(), this function must: + * - If @exact is false, resize an external data file only if its size is = less + * than @offset + * - Only write to an external data file if @prealloc prescribes data + * preallocation (FALLOC/FULL). + */ static int coroutine_fn GRAPH_RDLOCK qcow2_co_truncate(BlockDriverState *bs, int64_t offset, bool exact, PreallocMode prealloc, BdrvRequestFlags flags, Error **e= rrp) @@ -4554,6 +4597,11 @@ qcow2_co_truncate(BlockDriverState *bs, int64_t offs= et, bool exact, break; =20 case PREALLOC_MODE_METADATA: + /* + * Note for BDRV_O_NO_DATA_RESIZE and BDRV_O_NO_DATA_WRITE: This w= ill + * not write data to an external data file, and will only resize i= t if + * its current length is less than `offset`. + */ ret =3D preallocate_co(bs, old_length, offset, prealloc, errp); if (ret < 0) { goto fail; @@ -4572,6 +4620,11 @@ qcow2_co_truncate(BlockDriverState *bs, int64_t offs= et, bool exact, /* With a data file, preallocation means just allocating the metad= ata * and forwarding the truncate request to the data file */ if (has_data_file(bs)) { + /* + * Note for BDRV_O_NO_DATA_RESIZE and BDRV_O_NO_DATA_WRITE: Th= is + * *will* write data to an external data file, but only resize= it + * if its current length is less than `offset`. + */ ret =3D preallocate_co(bs, old_length, offset, prealloc, errp); if (ret < 0) { goto fail; --=20 2.52.0 From nobody Sun Feb 8 21:06:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770302968; cv=none; d=zohomail.com; s=zohoarc; b=knzAV8NNe6FN2CHgsp8z+uYnXN2CqoXcgYYrANT4JTOViV1W0Atz1oy8rciU+NkNQSYQJ336HnEZ/OK8+CsWxKtaz2pQ9nqNCT4USf0G/hZtWJXZjZY+qXXdXuVTwdlg9gq4rCwgOuHTpI77WL9mJI9TIu2PFqiTJRvIsqUMvY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770302968; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wZXs+WoWrXoKyYAfe0wHw7NnWaGpDsHsTViHDgmOuWA=; b=XJWrT3zSXylV/DDQ6wlNW13UZ9RwiKPqBhuIL/jYVo5R719t0alcNa3WXebnMrRw1LJQyITDRS/DEuH42TdD3naUMjzM3kL7pFhrmjQ1uov0fPR5C3mVdORLAUMB0M4BIt4Ktt6tFR7dVL2aweXfJXQS2nuWwrqUMybz0Ng8arE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770302968645943.440475566541; Thu, 5 Feb 2026 06:49:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vo0ek-0007p6-Rb; Thu, 05 Feb 2026 09:48:30 -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 1vo0ed-0007nI-9i for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vo0eU-0004Dp-AA for qemu-devel@nongnu.org; Thu, 05 Feb 2026 09:48:22 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-141-p6WdA3FTNJeivgtKJbKNfQ-1; Thu, 05 Feb 2026 09:48:11 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-42fdbba545fso1922983f8f.0 for ; Thu, 05 Feb 2026 06:48:11 -0800 (PST) Received: from localhost (p200300cfd737d06375fda007e5d3c5c8.dip0.t-ipconnect.de. [2003:cf:d737:d063:75fd:a007:e5d3:c5c8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436180647aasm13181356f8f.41.2026.02.05.06.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 06:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770302893; h=from:from: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; bh=wZXs+WoWrXoKyYAfe0wHw7NnWaGpDsHsTViHDgmOuWA=; b=dNzfxIkJQv3pKuJmK9jW9E8DTvy8rsTIxshGpHb2EeF9BCfoQutH3Bo86EWb7Ussy63o7o aSKPl78J1kLqWtQJw01nHPucUOjKMdxuFHPVuZmkjwIVrgsHrce6m0NInuqF87/j78Ef+c K25Qnvlpx9070Naqg+XwaWExE3S/keU= X-MC-Unique: p6WdA3FTNJeivgtKJbKNfQ-1 X-Mimecast-MFC-AGG-ID: p6WdA3FTNJeivgtKJbKNfQ_1770302891 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770302890; x=1770907690; darn=nongnu.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=wZXs+WoWrXoKyYAfe0wHw7NnWaGpDsHsTViHDgmOuWA=; b=s/5z0ut/ueDjtX5U3ee4lHrakIY9tKYvvKKQT5xViyTz4CBgxFUVQESLZ9BuSeM9PN qm1Mvht7Dm3zNVqyH1+kQo2cgJRQB6N/7MjgbI/e2m017eqvpgfa1r7CYoigqqflUv2Q 9AWKhwbdT0Vv2W0RpIvVORoSyb5BVAf++pYdP5JwXkJ+YVfyRRCf2Nb6GWaOHn2nTVP7 24Undzm0eVY2apbz5O/g770WUoxFmXtbO+KcFz6UOns1abeslspTP79gdjZ3n3ELXDRD Uw9SU3YUScjwEMUAfBtOHdu+DWNj+jqlfTy0jVA4Ycj6wEyTug0TJfWdk/FbshnVkYBj oVrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770302890; x=1770907690; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wZXs+WoWrXoKyYAfe0wHw7NnWaGpDsHsTViHDgmOuWA=; b=SsL/etRk6CO/DzRP9CyHyz4G6eGORLqSuaGhVorn+zde12u7pfQw058O9nqWkQMTHH fbEAdQF+eCYFcxjx8e8Q27znvGPC9c1meGbxG15w03SkRTNZAUv2pKh9+PR8rqcVbPhM 2KNGOigEGT3VaWG8VdYXGiuxgwTtAdJjJjlCHdKIjoeBOR2wYpzQN5wsrZJl/zgI0Icp Bv/AfRU/4Q66BrbNPi07Lx6bG5A0wCPd0/ZIOgBEK5c85U61QpeEHihyqwRN2dBD4eUQ sMmLjddXUMO2h4737T3Ii+wHJEsYZfuWxPpDUY3ENNnjMV7LYizoG+r1JRlV3KbTcfSp eJLA== X-Gm-Message-State: AOJu0YzIX6QfVmQAa8BUjxYNIZ2AriAQC+aj8fYVJ219vrXsnTrKAqt+ qbzuVs+PkwrwelUp+kOhW4tzbT3+ttsxnpfbIGLU1sQ5QQPc+oNDVrih/JOoum5aGVQD1BJdKPY 7uqXhMYcRmY+Fk+5fmFFf5a0COEqjHYr+karQopkp+4XQZRNCWqcNgmL2JLJrK/VZ X-Gm-Gg: AZuq6aKjgnLvhsa3WTzF5VUlXLpaqaXDk0j3CiYB4pgFSJd6xlGhcbgOnH1WKJJjezY n48jcVHOjz/NXb7rwwVEskNoDqMKtj++1wblirB2cAb7SmWdutuQZzS7G9cyluexaren005KhAd BYMReAMbSKQb7DDbbXNum2dnS52DHS6z7PYLMcxbhFpX4s1xU19nD8U8Q87gmeoHGJjP7Z6xucX V4U3dr941IdbpnhU5Q7gN3UhX1V+eOp15G7FdjVv8UXdA1cufj5C0SVfdrXE509uvC7pCsqHE+k 8w8UKZzZ+gfen3InMPaD5uO9FWzM5xO2fzU9FkId1MPS67o8vwgmRsQiWtMxd0eJ/awAmh1ZSLZ jRc1yqDrHkgo3Ay7E7Kd9f2+S0eMtLDsMupxBBvW/Hhyn41WutA+q3SXyAXk/lBRKuW5R X-Received: by 2002:a05:6000:2c05:b0:435:9635:2943 with SMTP id ffacd0b85a97d-436213e0249mr5524834f8f.17.1770302888540; Thu, 05 Feb 2026 06:48:08 -0800 (PST) X-Received: by 2002:a05:6000:2c05:b0:435:9635:2943 with SMTP id ffacd0b85a97d-436213e0249mr5524718f8f.17.1770302887501; Thu, 05 Feb 2026 06:48:07 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf Subject: [PATCH 5/5] iotests: Add qcow2-live-data-file test Date: Thu, 5 Feb 2026 15:47:35 +0100 Message-ID: <20260205144737.31131-6-hreitz@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205144737.31131-1-hreitz@redhat.com> References: <20260205144737.31131-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770302969295158500 Content-Type: text/plain; charset="utf-8" While a raw image is attached to a VM, create a pure-metadata qcow2 image with that raw image as its data file, and then replace the raw image by the qcow2 image. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/tests/qcow2-live-data-file | 274 ++ .../tests/qcow2-live-data-file.out | 2904 +++++++++++++++++ 2 files changed, 3178 insertions(+) create mode 100755 tests/qemu-iotests/tests/qcow2-live-data-file create mode 100644 tests/qemu-iotests/tests/qcow2-live-data-file.out diff --git a/tests/qemu-iotests/tests/qcow2-live-data-file b/tests/qemu-iot= ests/tests/qcow2-live-data-file new file mode 100755 index 0000000000..cdff1ada3d --- /dev/null +++ b/tests/qemu-iotests/tests/qcow2-live-data-file @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 +# group: rw +# +# Given a raw image file already attached to a VM, create a qcow2 file with +# that image as its external (raw) data file, and replace the raw image by +# the qcow2 image. +# +# Copyright (C) 2026 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Creator/Owner: Hanna Czenczek + +from enum import Enum, auto +import re +import iotests +from iotests import log, qemu_img, qemu_img_log, qemu_io_log + +iotests.script_initialize( + supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat'], +) + +DISK_SIZE =3D 64 * 1024 * 1024 + +class CreateException(Exception): + pass + +class GuestDiskType(Enum): + VIRTIO_BLK =3D auto() + SCSI_HD =3D auto() + SCSI_CD =3D auto() + +def do_test( + vm: iotests.VM, + with_raw_node: bool, + guest_disk_type: GuestDiskType, + preallocation: str, + qcow2_size: int, + raw_img_path: str, + qcow2_img_path: str, +) -> None: + log('=3D=3D=3D do_test() =3D=3D=3D') + log(f' - with_raw_node=3D{with_raw_node}') + log(f' - guest_disk_type=3D{guest_disk_type}') + log(f' - preallocation=3D{preallocation}') + log(f' - qcow2_size=3D{qcow2_size}') + + log('') + log('--- Setting up raw image ---') + qemu_img('create', '-f', 'raw', raw_img_path, str(DISK_SIZE)) + + log('') + log('--- Launching VM ---') + + vm.add_blockdev(vm.qmp_to_opts({ + 'driver': 'file', + 'node-name': 'protocol', + 'filename': raw_img_path, + })) + + if with_raw_node: + vm.add_blockdev(vm.qmp_to_opts({ + 'driver': 'raw', + 'node-name': 'raw', + 'file': 'protocol', + })) + raw_node =3D 'raw' + else: + raw_node =3D 'protocol' + + dev_id =3D 'sda' + qom_path =3D f'/machine/peripheral/{dev_id}' + if guest_disk_type =3D=3D GuestDiskType.VIRTIO_BLK: + vm.add_device(f'virtio-blk,id=3D{dev_id},drive=3D{raw_node}') + dev_id =3D f'{qom_path}/virtio-backend' + elif guest_disk_type =3D=3D GuestDiskType.SCSI_HD: + vm.add_device('virtio-scsi') + vm.add_device(f'scsi-hd,id=3D{dev_id},drive=3D{raw_node}') + elif guest_disk_type =3D=3D GuestDiskType.SCSI_CD: + vm.add_device('virtio-scsi') + vm.add_device(f'scsi-cd,id=3D{dev_id},drive=3D{raw_node}') + + vm.launch() + + log('') + log('--- Creating qcow2 image ---') + + create_and_open(vm, { + 'driver': 'file', + 'filename': qcow2_img_path, + }, { + 'size': 0, + }, { + 'node-name': 'qcow2-protocol', + }) + + create_and_open(vm, { + 'driver': 'qcow2', + 'file': 'qcow2-protocol', + 'data-file': 'protocol', + }, { + 'data-file-raw': True, + 'size': qcow2_size, + 'preallocation': preallocation, + }, { + 'node-name': 'qcow2', + }) + + cmd =3D 'aio_write -P 42 0 4M' + log(f'[HMP qemu-io: {cmd}]') + log(vm.qmp( + 'human-monitor-command', + command_line=3Df'qemu-io -d {dev_id} "{cmd}"', + )) + + if with_raw_node: + log('[blockdev-reopen]') + log(vm.qmp('blockdev-reopen', { + 'options': [{ + 'driver': 'raw', + 'node-name': 'raw', + 'file': 'qcow2', + }], + })) + else: + log('[qom-set]') + log(vm.qmp('qom-set', { + 'path': qom_path, + 'property': 'drive', + 'value': 'qcow2', + })) + + cmd =3D 'aio_flush' + log(f'[HMP qemu-io: {cmd}]') + log(vm.qmp( + 'human-monitor-command', + command_line=3Df'qemu-io -d {dev_id} {cmd}', + )) + + vm.shutdown() + + qlog =3D vm.get_log() + if qlog is not None: + log('[qemu log]') + qlog =3D iotests.filter_qemu_io(iotests.filter_qtest(qlog)) + log(qlog) + + log('[qemu-img check]') + qemu_img_log('check', '-f', 'qcow2', qcow2_img_path) + + cmd =3D 'read -P 42 0 4M' + log(f'[qemu-io: {cmd}]') + qemu_io_log(qcow2_img_path, '-c', cmd) + +def create_and_open( + vm: iotests.VM, + base_options: dict[str, object], + create_options: dict[str, object], + open_options: dict[str, object], +) -> None: + log(f'[blockdev-create: {base_options['driver']}]') + log(vm.qmp('blockdev-create', { + 'job-id': 'create', + 'options': base_options | create_options, + })) + + while True: + event =3D vm.event_wait( + name=3D'JOB_STATUS_CHANGE', + match=3D{'data': {'id': 'create'}}, + ) + assert event is not None + status =3D event['data']['status'] + log(f' -> {status}') + if status =3D=3D 'aborting': + jobs =3D vm.qmp('query-jobs')['return'] + job_info =3D next(job for job in jobs if job['id'] =3D=3D 'cre= ate') + error =3D re.sub(r'#block\d+', '#blockXXX', job_info['error']) + log(f'blockdev-create failed: {error}') + raise CreateException(error) + if status =3D=3D 'concluded': + break + + log('[job-dismiss]') + log(vm.qmp('job-dismiss', id=3D'create')) + log('[blockdev-add]') + log(vm.qmp('blockdev-add', base_options | open_options)) + +def verify_exception( + exception: CreateException, + conflicting_permissions: list[str], + with_raw_node: bool, + guest_disk_type: GuestDiskType, +) -> None: + if with_raw_node: + user =3D "node 'raw'" + user_child =3D 'file' + elif guest_disk_type =3D=3D GuestDiskType.VIRTIO_BLK: + user =3D "block device '/machine/peripheral/sda/virtio-backend'" + user_child =3D 'root' + else: + user =3D "block device 'sda'" + user_child =3D 'root' + + refstr =3D ( + "Permission conflict on node 'protocol': permissions " + f"'{', '.join(conflicting_permissions)}' are both required by node= " + "'#blockXXX' (uses node 'protocol' as 'data-file' child) and unsha= red " + f"by {user} (uses node 'protocol' as '{user_child}' child)." + ) + + if str(exception) !=3D refstr: + log("Exception differs from reference:") + log(f'Is: {exception}') + log(f'Expected: {refstr}') + assert str(exception) =3D=3D refstr + +def run_test( + with_raw_node: bool, + guest_disk_type: GuestDiskType, + preallocation: str, + qcow2_size: int, +) -> None: + with iotests.FilePath('raw.img') as raw_img_path, \ + iotests.FilePath('metadata.qcow2') as qcow2_img_path, \ + iotests.VM() as vm: + try: + do_test( + vm, + with_raw_node, + guest_disk_type, + preallocation, + qcow2_size, + raw_img_path, + qcow2_img_path, + ) + except CreateException as e: + expected_conflicting_perms =3D [] + + if preallocation in ('falloc', 'full'): + # Data preallocation must fail because it must write to the + # data file, requiring the WRITE permission. + expected_conflicting_perms +=3D ['write'] + + if guest_disk_type =3D=3D GuestDiskType.SCSI_CD and \ + qcow2_size > DISK_SIZE: + # CD does not allow resizing, but creating a bigger qcow2 = image + # would require growing the raw image, necessitating the R= ESIZE + # permission. (Creating a smaller qcow2 however will not + # shrink it.) + expected_conflicting_perms +=3D ['resize'] + + if not expected_conflicting_perms: + raise e + + verify_exception(e, expected_conflicting_perms, + with_raw_node, guest_disk_type) + log('(Handled expected exception)') + log('') + + +def run_all_test_combinations(): + for with_raw_node in (False, True): + for guest_disk_type in GuestDiskType: + for preallocation in ('off', 'metadata', 'falloc', 'full'): + # Sprinkle in -512 and +512 to verify that non-cluster-ali= gned + # sizes work, too + for qcow2_size in (DISK_SIZE, DISK_SIZE // 2 - 512, + DISK_SIZE * 2 + 512): + run_test(with_raw_node, guest_disk_type, preallocation, + qcow2_size) + +run_all_test_combinations() diff --git a/tests/qemu-iotests/tests/qcow2-live-data-file.out b/tests/qemu= -iotests/tests/qcow2-live-data-file.out new file mode 100644 index 0000000000..0adb307756 --- /dev/null +++ b/tests/qemu-iotests/tests/qcow2-live-data-file.out @@ -0,0 +1,2904 @@ +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device '/machine/peripheral/sda/virt= io-backend' (uses node 'protocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'resize' are both required by node '#blockXXX' (uses node 'protocol' as '= data-file' child) and unshared by block device 'sda' (uses node 'protocol' = as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[qom-set] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'resize' are both required by node '#blockXXX' (uses node 'protocol' as '= data-file' child) and unshared by block device 'sda' (uses node 'protocol' = as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write, resize' are both required by node '#blockXXX' (uses node 'protoco= l' as 'data-file' child) and unshared by block device 'sda' (uses node 'pro= tocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by block device 'sda' (uses node 'protocol' a= s 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DFalse + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write, resize' are both required by node '#blockXXX' (uses node 'protoco= l' as 'data-file' child) and unshared by block device 'sda' (uses node 'pro= tocol' as 'root' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.VIRTIO_BLK + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +2049/2049 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_HD + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Doff + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'resize' are both required by node '#blockXXX' (uses node 'protocol' as '= data-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file= ' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +1024/1024 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed cluste= rs +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[HMP qemu-io: aio_write -P 42 0 4M] +{"return": ""} +[blockdev-reopen] +{"return": {}} +[HMP qemu-io: aio_flush] +{"return": ""} +[qemu log] +wrote 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +[qemu-img check] +No errors were found on the image. +512/512 =3D 100.00% allocated, 0.00% fragmented, 0.00% compressed clusters +Image end offset: 327680 + +[qemu-io: read -P 42 0 4M] +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dmetadata + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'resize' are both required by node '#blockXXX' (uses node 'protocol' as '= data-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file= ' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfalloc + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write, resize' are both required by node '#blockXXX' (uses node 'protoco= l' as 'data-file' child) and unshared by node 'raw' (uses node 'protocol' a= s 'file' child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D67108864 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D33553920 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write' are both required by node '#blockXXX' (uses node 'protocol' as 'd= ata-file' child) and unshared by node 'raw' (uses node 'protocol' as 'file'= child). +(Handled expected exception) + +=3D=3D=3D do_test() =3D=3D=3D + - with_raw_node=3DTrue + - guest_disk_type=3DGuestDiskType.SCSI_CD + - preallocation=3Dfull + - qcow2_size=3D134218240 + +--- Setting up raw image --- + +--- Launching VM --- + +--- Creating qcow2 image --- +[blockdev-create: file] +{"return": {}} + -> created + -> running + -> waiting + -> pending + -> concluded +[job-dismiss] +{"return": {}} +[blockdev-add] +{"return": {}} +[blockdev-create: qcow2] +{"return": {}} + -> null + -> created + -> running + -> aborting +blockdev-create failed: Permission conflict on node 'protocol': permission= s 'write, resize' are both required by node '#blockXXX' (uses node 'protoco= l' as 'data-file' child) and unshared by node 'raw' (uses node 'protocol' a= s 'file' child). +(Handled expected exception) + --=20 2.52.0