From nobody Wed May 14 01:15:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526921231711657.2082004759653; Mon, 21 May 2018 09:47:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BC30124A00; Mon, 21 May 2018 16:47:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5288D5D756; Mon, 21 May 2018 16:47:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E3F854BB78; Mon, 21 May 2018 16:47:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LGkmdd002756 for ; Mon, 21 May 2018 12:46:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC6BD2024506; Mon, 21 May 2018 16:46:47 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13B292024505; Mon, 21 May 2018 16:46:46 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:46:31 +0100 Message-Id: <20180521164631.7288-14-berrange@redhat.com> In-Reply-To: <20180521164631.7288-1-berrange@redhat.com> References: <20180521164631.7288-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [tck PATCH v2 13/13] lib: allow marking the scratch disk as shareable X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 21 May 2018 16:47:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 One of the tests checks the ability to boot multiple guests at once, and it is using the same (empty) disk image for all. Modern QEMU rejects this sharing, but it is harmless in context of this test case, so we mark the disk as shareable to allow it. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump --- lib/Sys/Virt/TCK.pm | 6 +++++- lib/Sys/Virt/TCK/DomainBuilder.pm | 3 +++ scripts/domain/081-unique-id-create.t | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm index e7ff71b..ac9c125 100644 --- a/lib/Sys/Virt/TCK.pm +++ b/lib/Sys/Virt/TCK.pm @@ -782,6 +782,7 @@ sub generic_machine_domain { my $caps =3D exists $params{caps} ? $params{caps} : die "caps paramete= r is required"; my $ostype =3D exists $params{ostype} ? $params{ostype} : "hvm"; my $fullos =3D exists $params{fullos} ? $params{fullos} : 0; + my $shareddisk =3D exists $params{shareddisk} ? $params{shareddisk} : = 0; my $filterref =3D exists $params{filterref} ? $params{filterref} : und= ef; my %filterparams =3D exists $params{filterparams} ? %{$params{filterpa= rams}} : (); =20 @@ -857,7 +858,8 @@ sub generic_machine_domain { =20 $b->disk(src =3D> $config{root}, dst =3D> $config{dev}, - type =3D> "file"); + type =3D> "file", + shareable =3D> $shareddisk); return $b; } } @@ -915,6 +917,7 @@ sub generic_domain { my $ostype =3D exists $params{ostype} ? $params{ostype} : "hvm"; my $fullos =3D exists $params{fullos} ? $params{fullos} : 0; my $netmode =3D exists $params{netmode} ? $params{netmode} : undef; + my $shareddisk =3D exists $params{shareddisk} ? $params{shareddisk} : = 0; my $filterref =3D exists $params{filterref} ? $params{filterref} : und= ef; my %filterparams =3D exists $params{filterparams} ? %{$params{filterpa= rams}} : (); =20 @@ -936,6 +939,7 @@ sub generic_domain { $b =3D $self->generic_machine_domain(name =3D> $name, caps =3D> $caps, ostype =3D> $ostype, + shareddisk =3D> $shareddisk, fullos =3D> $fullos, filterref =3D> $filterref, filterparams =3D> \%filterparam= s); diff --git a/lib/Sys/Virt/TCK/DomainBuilder.pm b/lib/Sys/Virt/TCK/DomainBui= lder.pm index b6adbd3..5ca2a07 100644 --- a/lib/Sys/Virt/TCK/DomainBuilder.pm +++ b/lib/Sys/Virt/TCK/DomainBuilder.pm @@ -409,6 +409,9 @@ sub as_xml { $w->emptyTag("source", file =3D> $disk->{src}); } + if ($disk->{shareable}) { + $w->emptyTag("shareable"); + } $w->emptyTag("target", dev =3D> $disk->{dst}, $disk->{bus} ? (bus =3D> $disk->{bus}) : ()); diff --git a/scripts/domain/081-unique-id-create.t b/scripts/domain/081-uni= que-id-create.t index 07143a5..0d53599 100644 --- a/scripts/domain/081-unique-id-create.t +++ b/scripts/domain/081-unique-id-create.t @@ -54,13 +54,13 @@ my $uuid1 =3D "11111111-1111-1111-1111-111111111111"; my $uuid2 =3D "22222222-1111-1111-1111-111111111111"; =20 # The initial config -my $xml =3D $tck->generic_domain(name =3D> $name1)->uuid($uuid1)->as_xml; +my $xml =3D $tck->generic_domain(name =3D> $name1, shareddisk =3D> 1)->uui= d($uuid1)->as_xml; # One with a different UUID, matching name my $xml_diffuuid =3D $tck->generic_domain(name =3D> $name1)->uuid($uuid2)-= >as_xml; # One with a matching UUID, different name my $xml_diffname =3D $tck->generic_domain(name =3D> $name2)->uuid($uuid1)-= >as_xml; # One with a different UUID, different name -my $xml_diffboth =3D $tck->generic_domain(name =3D> $name2)->uuid($uuid2)-= >as_xml; +my $xml_diffboth =3D $tck->generic_domain(name =3D> $name2, shareddisk =3D= > 1)->uuid($uuid2)->as_xml; =20 diag "Defining persistent domain config"; my ($dom, $dom1); --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list