From nobody Fri Apr 19 00:06:33 2024 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1565260267; cv=none; d=zoho.com; s=zohoarc; b=ZifhUf38ub6Yk8QELQGOzbcVFcJT1g7VeBupe5SbTVKo4g3DTHZNHwDu1uTJ4yvbFzNxAMbi1lnECglnh7IxZ0Lg7rQurRUFZhwq+8Wh0bJybZf9y7/YV6dugRAOgyUVqAZctuK0fO2x/r6cxryDpBnHKrMv6jAMDKDj/SmgRnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565260267; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=m68bIEEFn2woNkM6DF5GYgWU+qr6hX31dpceIfOG/D0=; b=Uu05YDWPWGp3hm2pP2rVuWF++HICMzv/RGlTCOEvx+YSWjipZl9N+YJ534bY49T+xO0Km4821C4V7VWVg8TlyfBv/rVON5lRVWNftHZ0u/gMcC/eJmLtA7SyHm4k9i74ekKKkxHTQoDOv417w6lvXDWJHUOY7vGIoeBxHJ20AUs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565260267503791.5393910790172; Thu, 8 Aug 2019 03:31:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A46D7EBAE; Thu, 8 Aug 2019 10:31:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A28D10016F3; Thu, 8 Aug 2019 10:31:03 +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 A13801806B00; Thu, 8 Aug 2019 10:31:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78AUx0V005963 for ; Thu, 8 Aug 2019 06:30:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EE11608A5; Thu, 8 Aug 2019 10:30:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 192BA60A35 for ; Thu, 8 Aug 2019 10:30:56 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA794309BF17 for ; Thu, 8 Aug 2019 10:30:55 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id v15so1887280wml.0 for ; Thu, 08 Aug 2019 03:30:55 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id o7sm60063719wru.58.2019.08.08.03.30.51 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 03:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pYMl3DDbxd9I26HUH/Id98mghFrcRhVRMgLlw54kdnA=; b=LcVJ5TuC4iJN6p3eI86eZNcqQD/BfVFflqIzG4vX6gEWl9umfcOHnmIooYvLUaMEYP 0AvML/Y4Orj1SEHg+gY/IznPiaQC+B/Q7/ZFTERJwSW7P/uhSHvPDo+2MuAyGxfecQ/0 KeGUbmRs+l81nEyw+bdxk8boPEEtouhdXe63PVPj9U0PN6RSv2wK5D2tOKPdNOkJQxK3 RS/BANALGthwsqSkBN8f5JrhU+xsEdhD7jW8zU3vGLQ92y5RFKpRHeujyIe/DwmTBSkw Zz7uhz2R+I/eyU0rbjh2tcYzzJimp2wRGHhHTFVEEsa5IyKMXM5qqUhMSgIowySP/2si C6xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pYMl3DDbxd9I26HUH/Id98mghFrcRhVRMgLlw54kdnA=; b=nYN9LVTBG31MWZkf9tcj/++LhK2t+rOCBfcdyZavjwQR9C9bPLtYvU8rOuPWpYpYXm v5LYSO51KKTZXnfpIyRpedZYZGF81SkpaPKeB7Fa+TfdqIdkVx8AamqaGorpIOTD+LNN HPoVSgHH35xJz57JgP2tQbyESBTC5YVebcnU7l2MzEo9rOngvy78QH7nxbubOLm9zTpH R+17tlhphRDEO59SlmB5DvxJPKRAIph78GZp1zIbtE88ReU1llXnWd46NWR4LVzn0rBP 1KWOWEhd8fgo+A/oBPvgYy/RVROI9Qpht96Mnc300GjbJggkQJKA602PGK2mKe/V5vz2 L5OQ== X-Gm-Message-State: APjAAAXvnwzGsZnhZrKbBLSDHg/YR1YxpCs4sb9eih6Nz15quC/Ha1Om Y8MfN4BtTS+EP8lM2Gvo244P8kVe40o5Ow== X-Google-Smtp-Source: APXvYqxAmyWUtGY88/waZf80WIPiG88SP144O4bPIjASVsEhi/mGw4GQsj4D6jVqQI504v4hRzbwDQ== X-Received: by 2002:a7b:ce18:: with SMTP id m24mr3496756wmc.126.1565260253907; Thu, 08 Aug 2019 03:30:53 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 12:30:24 +0200 Message-Id: <20190808103023.24797-1-stamatis.iliass@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 08 Aug 2019 10:30:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 08 Aug 2019 10:30:55 +0000 (UTC) for IP:'209.85.128.66' DOMAIN:'mail-wm1-f66.google.com' HELO:'mail-wm1-f66.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.099 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.66 mail-wm1-f66.google.com 209.85.128.66 mail-wm1-f66.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] test_driver: implement virDomainGetBlockInfo 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 08 Aug 2019 10:31:06 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6f18baa265..106e8f027e 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -7729,6 +7729,45 @@ testDomainMemoryPeek(virDomainPtr dom, } +static int +testDomainGetBlockInfo(virDomainPtr dom, + const char *path, + virDomainBlockInfoPtr info, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDiskDefPtr disk; + int ret =3D -1; + + virCheckFlags(0, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(disk =3D virDomainDiskByName(vm->def, path, false))) { + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path %s not assigned to domain"), path); + goto cleanup; + } + + if (virStorageSourceIsEmpty(disk->src)) { + virReportError(VIR_ERR_INVALID_ARG, + _("disk '%s' does not currently have a source assig= ned"), + path); + goto cleanup; + } + + info->capacity =3D 1099506450432; + info->allocation =3D 1099511627776; + info->physical =3D 1099511627776; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + /* * Snapshot APIs */ @@ -9031,6 +9070,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainManagedSaveRemove =3D testDomainManagedSaveRemove, /* 1.1.4 */ .domainMemoryStats =3D testDomainMemoryStats, /* 5.7.0 */ .domainMemoryPeek =3D testDomainMemoryPeek, /* 5.4.0 */ + .domainGetBlockInfo =3D testDomainGetBlockInfo, /* 5.7.0 */ .domainSnapshotNum =3D testDomainSnapshotNum, /* 1.1.4 */ .domainSnapshotListNames =3D testDomainSnapshotListNames, /* 1.1.4 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list