From patchwork Thu Mar 7 19:35:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 159927 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7821580jad; Thu, 7 Mar 2019 11:36:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyl1YsSQldFqKv69yZ0hwkyN2Ibk+GEsQ0hnXm83dUI8GU2iNKhl5YCsf3oEww04wPSX5M/ X-Received: by 2002:a0c:ac93:: with SMTP id m19mr12031603qvc.27.1551987414794; Thu, 07 Mar 2019 11:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551987414; cv=none; d=google.com; s=arc-20160816; b=om1L3D7MQTvwaF3ER/lHCR634ZHWW1bVUSSORCYktABil9wRG8uqo619cZ83rpsbM1 JencUGMlYkH0KYnql9RyZCAU1oAG5XKRdjQSXf1+EC2i0D9/mn49rQGi21k7aoiG4WNA /PPJzLcynq9t14TEeY77BhB5/8Y2L8g9VCAwc1UfgLBw5uoiAhxwKaFWFH9DR9tkM63y kxpFI2x86pBtjFMLhv9as2mBEPJe1WwC9AQIqPO+ybeXB1EuIiCB7uG1j3NNsh9OXzoF KURUEpLDYRBeM9u3DDcgRmrY5Gu/vvOQT0j3ZjdZWcDcdca6kb1qbw8lhfewKQi2XEdn KhzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:delivered-to; bh=uWsuqUKIkfYBxbKrRrpHQD8oDpWYsQvsck8cocGPL4Q=; b=WmzURlznRez3umpIaR23qjyRRr7ARpXnutRGDSuPOAZp/tGQVQBu6PMIl6i96Ub9S3 eHBi76RkgGDX/eEObaoQ4OrClR2fM8ECII81k10PMubW/smYC1n2W7RlTdHSmuI2hYf/ h5/MFcYAa+rOhKXBEZzOjsuufPHgRGmWnaK/mJAR4qEs4nkpF2Ck9ET9tQoLlZUPIZnC O1JItBzbMPE5qHu6Qno9hpLdSy+4KSUR4iR/uAMkf+POW50MFO5N47u9hbj0GRcRgMNY 2LagkxCr6Iuwi21hjM0vuLfR7DxrnCakSgcQw4mmkzJmwiOYszYW12b73VC0knhuneE7 +2Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f76si3429539qke.63.2019.03.07.11.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 11:36:54 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65C168762B; Thu, 7 Mar 2019 19:36:52 +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 DCE1519C67; Thu, 7 Mar 2019 19:36:51 +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 895DC41F3D; Thu, 7 Mar 2019 19:36:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x27JZQVo023255 for ; Thu, 7 Mar 2019 14:35:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 163B4A4F9C; Thu, 7 Mar 2019 19:35:26 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-122-146.rdu2.redhat.com [10.10.122.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D785179E6; Thu, 7 Mar 2019 19:35:22 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 7 Mar 2019 14:35:14 -0500 Message-Id: <50b34b98d9f891447203a7bfb64954430ad8981e.1551987121.git.crobinso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] test: storage: Fill in default vol types for every pool 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 07 Mar 2019 19:36:53 +0000 (UTC) Fill in a default volume type for every pool type, as reported by the VolGetInfo API. Signed-off-by: Cole Robinson --- A more complete fix would take into account VolDef->type, so test driver users could set this value via volume XML. That would require adding a PostParse callback to the storage driver infrastructure. This is still an improvement in the interim and would be part of a complete fix anyways src/test/test_driver.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/test/test_driver.c b/src/test/test_driver.c index ce0df1f8e3..3f37b2ede7 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -5164,13 +5164,26 @@ testStorageVolDelete(virStorageVolPtr vol, static int testStorageVolumeTypeForPool(int pooltype) { - switch (pooltype) { - case VIR_STORAGE_POOL_DIR: - case VIR_STORAGE_POOL_FS: - case VIR_STORAGE_POOL_NETFS: - return VIR_STORAGE_VOL_FILE; - default: - return VIR_STORAGE_VOL_BLOCK; + switch ((virStoragePoolType) pooltype) { + case VIR_STORAGE_POOL_DIR: + case VIR_STORAGE_POOL_FS: + case VIR_STORAGE_POOL_NETFS: + case VIR_STORAGE_POOL_VSTORAGE: + return VIR_STORAGE_VOL_FILE; + case VIR_STORAGE_POOL_SHEEPDOG: + case VIR_STORAGE_POOL_ISCSI_DIRECT: + case VIR_STORAGE_POOL_GLUSTER: + case VIR_STORAGE_POOL_RBD: + return VIR_STORAGE_VOL_NETWORK; + case VIR_STORAGE_POOL_LOGICAL: + case VIR_STORAGE_POOL_DISK: + case VIR_STORAGE_POOL_MPATH: + case VIR_STORAGE_POOL_ISCSI: + case VIR_STORAGE_POOL_SCSI: + case VIR_STORAGE_POOL_ZFS: + case VIR_STORAGE_POOL_LAST: + default: + return VIR_STORAGE_VOL_BLOCK; } }