From nobody Thu Apr 25 18:49:59 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=1562700274; cv=none; d=zoho.com; s=zohoarc; b=GgNKS6CCFzcl3kiC6a/37aHjQgn41ZJ9nPbtNXZQqjSH7HKL6LeFiqp1huixHWsD5yVusnRkBJz3pRxQTvQdNjhfvQq0daplopGZTwp4AaDW7UjTpFYt1UVm4JP3BDsEdaFLOKBry3suySZSdPu2+Vjp+yRBDWJYGv0AIrAqtbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562700274; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2EjUxKgpx0UsgnBDVx3peDq2D0a+MlY1Kja3RyMBSFE=; b=mLH/9Bn4kqD5NhKaG1EzxtB3xTLGAasbmXKtnJG7pcntLhRi15WXKs/kmjqWrWONQQa03tQ5wS+8+nR7RMf1amajseiXXxV0dPWbtcWL9SvG1WF/sCn5lH1n/E7gtt6h2LU2WS3RvcFvEdr1Sas4JImIO+7NUnvd7SGTxbf2fT8= 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 1562700274511609.5017268765073; Tue, 9 Jul 2019 12:24:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E5EEE3DF6; Tue, 9 Jul 2019 19:24:32 +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 52FD97E48C; Tue, 9 Jul 2019 19:24:32 +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 4DC001833002; Tue, 9 Jul 2019 19:24:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x69JOTlm016565 for ; Tue, 9 Jul 2019 15:24:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id B17E953E1A; Tue, 9 Jul 2019 19:24:29 +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 AD31C5B806 for ; Tue, 9 Jul 2019 19:24:25 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 5BCAD30C0DFB for ; Tue, 9 Jul 2019 19:24:24 +0000 (UTC) Received: by mail-wm1-f43.google.com with SMTP id s15so4428555wmj.3 for ; Tue, 09 Jul 2019 12:24:24 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id b2sm27037295wrp.72.2019.07.09.12.24.21 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 12:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Abd8VWYVkZ4sK8pZ45QgJYaO5+rOml3nUpKDQnicNhw=; b=EGDgIREvBxgVX1WLzFUAZyoLc+hiAJEhP8WSbCBYee8qVemst+Y0zpO47y+hH0BXeD oBxPa8xAz1MDkRrR93c1SQjpO8x4oNIwTQkplMZ0/UzwKa42cLJDMV6p+Q4UdJc15EFx sWP59UaFf9ZVq7O3fgxUWzIAH5L8o9eWJxA8O8lyHqN1bhzDgwPUMhqSoU3SsMGbwaBK 24QURiQZ0u+Mnhj+t4UdqFsIms4yhsKkownesUmB1r4kK6KC8H5O0sRLLt4WZybU+vZm EO6kNnV312GKZimubB2WdoWSrsW2UkBo7tiy8FbBm+hmGo8q+YWL0cLcOwizZBQJXC0N l7pA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Abd8VWYVkZ4sK8pZ45QgJYaO5+rOml3nUpKDQnicNhw=; b=FrHAZo1Uw2OgSwpDPojFkIGs7R+MfQxZxUnUv1DCmDIMSrIFwIOhe5VhYbIVdE+FkY w2uzVFBX+Y1FZh8TcMFuO3XhB7H1onIRnfSEFM93Qf32FeD1xfDMQCD1m1/79hINeW8m WBh74UYIfq1TW9PRPfQH1NhFQgnA4/gCvzO+kPpZBmkd941X+Ex7Atc0HV3Osdt3dyPw MLGoCfsMgSY/rsJ3opr22+UQ26V7/dUnSDJOnKx/q1pQTq5H3YUp//jNOCLw/dPk8+dY cxemWvW/4WEaztANcixitJOTahgtf4GL1NrJQJE9iw2MTbooWVYRqquOAFgDNWY1Wfoh dJ7g== X-Gm-Message-State: APjAAAWUUaDU3CgvQwzxFs+VjWlBUonhFxkQyZVfYFXligT0yXBzm1bJ 2LwlbYLXeqrQGei7GJxd4dwX2Y13Zk3Onfni X-Google-Smtp-Source: APXvYqw9re5ZR4nowiHYeSZHVQy4bdCJBxiUIGxlXCAyNJEW9v7j0nCK6newikQYQEHroDjNk82b6w== X-Received: by 2002:a1c:8017:: with SMTP id b23mr1138413wmd.117.1562700262614; Tue, 09 Jul 2019 12:24:22 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 21:23:21 +0200 Message-Id: <20190709192324.12092-2-stamatis.iliass@gmail.com> In-Reply-To: <20190709192324.12092-1-stamatis.iliass@gmail.com> References: <20190709192324.12092-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]); Tue, 09 Jul 2019 19:24:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 09 Jul 2019 19:24:24 +0000 (UTC) for IP:'209.85.128.43' DOMAIN:'mail-wm1-f43.google.com' HELO:'mail-wm1-f43.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.228 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, PDS_NO_HELO_DNS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.43 mail-wm1-f43.google.com 209.85.128.43 mail-wm1-f43.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] test_driver: introduce domain-private data 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 09 Jul 2019 19:24:33 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Reviewed-by: Erik Skultety --- src/test/test_driver.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 49d7030d21..af3503c523 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -384,6 +384,35 @@ testBuildCapabilities(virConnectPtr conn) } +typedef struct _testDomainObjPrivate testDomainObjPrivate; +typedef testDomainObjPrivate *testDomainObjPrivatePtr; +struct _testDomainObjPrivate { + testDriverPtr driver; +}; + + +static void * +testDomainObjPrivateAlloc(void *opaque) +{ + testDomainObjPrivatePtr priv; + + if (VIR_ALLOC(priv) < 0) + return NULL; + + priv->driver =3D opaque; + + return priv; +} + + +static void +testDomainObjPrivateFree(void *data) +{ + testDomainObjPrivatePtr priv =3D data; + VIR_FREE(priv); +} + + static testDriverPtr testDriverNew(void) { @@ -399,6 +428,10 @@ testDriverNew(void) VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT | VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; + virDomainXMLPrivateDataCallbacks privatecb =3D { + .alloc =3D testDomainObjPrivateAlloc, + .free =3D testDomainObjPrivateFree, + }; testDriverPtr ret; if (testDriverInitialize() < 0) @@ -407,7 +440,7 @@ testDriverNew(void) if (!(ret =3D virObjectLockableNew(testDriverClass))) return NULL; - if (!(ret->xmlopt =3D virDomainXMLOptionNew(&config, NULL, &ns, NULL, = NULL)) || + if (!(ret->xmlopt =3D virDomainXMLOptionNew(&config, &privatecb, &ns, = NULL, NULL)) || !(ret->eventState =3D virObjectEventStateNew()) || !(ret->ifaces =3D virInterfaceObjListNew()) || !(ret->domains =3D virDomainObjListNew()) || -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:49:59 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=1562700298; cv=none; d=zoho.com; s=zohoarc; b=PM/7eo8L963/S82os1X+g4tagH5xOZGSY0kEOjWYFzo95cuIbZdYuYEwnXtzI2yXbertqE74Pxencj8RhY6gNIlBe9ajNwF2RgXGNWcsI4WADdO4xMnDnMM1eLOlkIHgN43SLgUkLDtXEiTP48ZfmPCJY3BBb6ijUZM+FAgutm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562700298; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=kHvgtTNaLPLA/gn0ciDs8a5z1lbSnNZsT+lmbFlfG2I=; b=gMFXpPmuZGLMnQT85XXCZnGkBY6i4e7H0oRgbNmzua/uDdeWLPesN39vXdaH4kdN9ahyxhCVA4XX9TARrd8oCv/Uy3/MVlZSQL5Ls5o/E/43E3Rt4Fv75a0AmiDq21w6uzr7six3qTFOljpIdX8N8MgluhRGPA1ZRbLUi56JXbs= 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 1562700298659465.6298375434684; Tue, 9 Jul 2019 12:24:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 142535AFF8; Tue, 9 Jul 2019 19:24:56 +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 DC9A45C6D9; Tue, 9 Jul 2019 19:24:54 +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 9AB10206D2; Tue, 9 Jul 2019 19:24:53 +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 x69JOpvs016581 for ; Tue, 9 Jul 2019 15:24:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 092775C6D9; Tue, 9 Jul 2019 19:24:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 033985F7C0 for ; Tue, 9 Jul 2019 19:24:48 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 715A03082141 for ; Tue, 9 Jul 2019 19:24:42 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id a15so4201213wmj.5 for ; Tue, 09 Jul 2019 12:24:42 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id b2sm27037295wrp.72.2019.07.09.12.24.39 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 12:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ad14H7R+pyGgvMBmLLk7UJkW+sU6wMQdVMN0ETaHWxM=; b=KyHrEAr0jArH/FWFuJN8L5khmClndzGes6B6644OiD4lxqGsrVQ5ySzWcMlXUhujN/ gLfPNMT4FsOpT+tXBWgt3b17Aqmj0XVsoTrJrIiyyGCpZLkF8lZSYGD7Q8XqtWE9aXrP aKV2hW9H/kQWWX13UhWehwS0kBWxF9uDafS0gS0aT8rpkTwNlD8zUfdpxrFFVjs2Dv1j pHuv3/3z0OJch4Oo5JKdHQbxdZiORB0BrFKAY1qD+dhMIYL1wcR2Jzx8q8vFRK6qMCzQ N70vQLiQu8hDeHLkwIWtIHbVkF8mMV7jObyVtPsYmjiAwJMQTJa06U4vx4fhy7CKSDl0 hubA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ad14H7R+pyGgvMBmLLk7UJkW+sU6wMQdVMN0ETaHWxM=; b=qvKgOSk38eiFesv/GJPP6WYqZO0SiXj5LDMEz2Zi5dK2HNQjLBbwElZKv1G+pYaMCb ta38jdA/xHyeCM6g82Vo910criQNLdngOFRefRS8xJat9MkW4gK7lYEiG4KNTZ2SQSfW wGtMjlEdR73HcipkeG1yLFO6S0jzqRaAk+bBm0wcDzkUP1/GqUFkLCZXhXT+RCMhnT1+ vzeoXl8HHyOvPlKFP1X7Fy5xT+NsordepfLdLf8jSJB4uP9CKdQjofGPB+lrlcE9ouP1 3qXPofv75Np8wmlLVf2skgyh1efjTp9crgwg2TkhlSinXwSS4mv9f49mNWrlZVgx/IWX 1Phg== X-Gm-Message-State: APjAAAVg37NCWqz70z4bVE9v4eisSRLOC8GDKqXJQ9oNFVbFzp2wpIdK TEUJcxj053uuWIuK9TPztUNk9wDqA5ZyaZ+h X-Google-Smtp-Source: APXvYqwxH0QBE0W5+EWKw2Bc62tXoTOZZlyRwX51HbJoCpE0mwHKjppQaUWvWG8zI6vk0/9c24FopA== X-Received: by 2002:a1c:9a46:: with SMTP id c67mr1124589wme.11.1562700280729; Tue, 09 Jul 2019 12:24:40 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 21:23:22 +0200 Message-Id: <20190709192324.12092-3-stamatis.iliass@gmail.com> In-Reply-To: <20190709192324.12092-1-stamatis.iliass@gmail.com> References: <20190709192324.12092-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.42]); Tue, 09 Jul 2019 19:24:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 09 Jul 2019 19:24:42 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.228 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, PDS_NO_HELO_DNS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] test_driver: implement virDomainFSFreeze 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 09 Jul 2019 19:24:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" On success update the domain-private data. Consider / and /boot to be the only mountpoints avaiable in order to be consistent with the other FS-related calls. Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index af3503c523..8c25c679a5 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -388,6 +388,8 @@ typedef struct _testDomainObjPrivate testDomainObjPriva= te; typedef testDomainObjPrivate *testDomainObjPrivatePtr; struct _testDomainObjPrivate { testDriverPtr driver; + + bool frozen[2]; /* used by file system related calls */ }; @@ -400,6 +402,7 @@ testDomainObjPrivateAlloc(void *opaque) return NULL; priv->driver =3D opaque; + priv->frozen[0] =3D priv->frozen[1] =3D false; return priv; } @@ -3439,6 +3442,60 @@ static int testDomainUndefine(virDomainPtr domain) return testDomainUndefineFlags(domain, 0); } + +static int +testDomainFSFreeze(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags) +{ + virDomainObjPtr vm; + testDomainObjPrivatePtr priv; + size_t i; + int slash =3D 0, slash_boot =3D 0; + int ret =3D -1; + + virCheckFlags(0, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + priv =3D vm->privateData; + + if (nmountpoints =3D=3D 0) { + priv->frozen[0] =3D priv->frozen[1] =3D true; + ret =3D 2; + } else { + for (i =3D 0; i < nmountpoints; i++) { + if (STREQ(mountpoints[i], "/")) { + slash =3D 1; + } else if (STREQ(mountpoints[i], "/boot")) { + slash_boot =3D 1; + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("mount point not found: %s"), + mountpoints[i]); + goto cleanup; + } + } + + if (slash) + priv->frozen[0] =3D true; + if (slash_boot) + priv->frozen[1] =3D true; + + ret =3D slash + slash_boot; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -7681,6 +7738,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainDefineXMLFlags =3D testDomainDefineXMLFlags, /* 1.2.12 */ .domainUndefine =3D testDomainUndefine, /* 0.1.11 */ .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ + .domainFSFreeze =3D testDomainFSFreeze, /* 5.6.0 */ .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:49:59 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=1562700324; cv=none; d=zoho.com; s=zohoarc; b=BU396JDWUNpJvHgXPgqevusmgP0Yj4bZ7b2cj5Vfhvb9UqFpPh244foikd5kCIDjzHVQVtB+COJvkAiDhyFIKQWZhqpLZ8Y5zXJK8PCsS2LEUNIBxXFoKjxm+5/TLBnDMb2Jm1wSEe1AlQSFcBwq/v5uRbcazmk74UYm1vHkBvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562700324; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=bBJnM4Hyu3qyK+3LEp0x6z/VU/jI/ZxX5aDd3ZhQyaI=; b=C0ngAMhzTqQafjai+n432lNC6vmIiXovHAK6GE+PF/6hb7JbLKJ2nU3jf6ILLsuJ/Z4dPPG5pekJau/W7HV8mOJqvRg2uUw3NLNPlk6Ftt7kerlTNL+VagnE10ZyOcnu4aDXLPoyW4AWuwiRD3Qqhl1oqLj6G3aMH2Ka7bXExvc= 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 1562700324936109.46742400178437; Tue, 9 Jul 2019 12:25:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5604A3086201; Tue, 9 Jul 2019 19:25:23 +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 2F69F53E1A; Tue, 9 Jul 2019 19:25:23 +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 E7D02206D2; Tue, 9 Jul 2019 19:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x69JPLfu016606 for ; Tue, 9 Jul 2019 15:25:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 144831001B19; Tue, 9 Jul 2019 19:25:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E5071001B10 for ; Tue, 9 Jul 2019 19:25:17 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 867247FDFB for ; Tue, 9 Jul 2019 19:25:03 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id v19so4404047wmj.5 for ; Tue, 09 Jul 2019 12:25:03 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id b2sm27037295wrp.72.2019.07.09.12.25.01 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 12:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mg711pCZSknp6Tw14JmqY89xSwysnN+GPR2Z6FscmIw=; b=GS6DNUp1kE14XYsNr/7zKvj5G7ZcbPanhaqnUHtO2KHJmnKdu8uYCjv8pFOXkfXZ/p p1zo8QYiVIHoqJK7SlNsl6zj6RCBzkripnKgyEvc+Eh78e9UsrWr9XsmMoz7GqPW5zN8 /pGPYiN+V3ewYiNTY7Mlea+ygOfmKiaum+6/TbW1dDh921tP56cCWr7u8iCzsT1OQ93I E3KvNrsCA/82YsFhIOfYYwKDrdli/l8tG0xsmNik/g/CC+H3cbso/m55P5A4sV0P4e3R SNIsdb9rw9mADrf3iq/3pUZM0ph91r7D1cPJaBwv8fpcTbOnGXNwRernNk2REVMtkWXv FQ4g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mg711pCZSknp6Tw14JmqY89xSwysnN+GPR2Z6FscmIw=; b=OcXRO4yxjoqdE2UZwygnGflCfOToQZS86hpH+3nJwStbM1WeVcR8i8UOSptbkB3oq7 juQV3+7Mo6X1kcCm6URbuUWNaY90pXeoKzmjfAx7GucZkys/DeUCz1Q5k90RnZUZQpXt wilJrmNwP85uEYutFMFckKj+7ewvPBre9VnT7B/S1OBzaAVwi6Gxp8iN5DikZO1/N0pD a+53kTXiZ6qpxehZJAmZZ84gGaS9nhQ/Yhy1IKPqCVDayDdG/S54UkkVki7ElEycauzW FLHdA3trt8c+Wqrau63hJdo8STynCSsfelCBCyF237JqlJTMkq+d4RiaAimY8FWQudT8 EdJA== X-Gm-Message-State: APjAAAW8Njqhf7iSaGbb57Xh+zTDtFStys121AY4p2U6t5b36j2jnf4j SkKE48Dos4BUk94mXmysr4QW6a3Ss24sJ0cF X-Google-Smtp-Source: APXvYqxRUfks0tEpyMYGeeKWlu+6A7jP3vDd5XVAeigyUzxQ4tYjrizgfc860Vcz+6waPG/urkTpfw== X-Received: by 2002:a05:600c:23cd:: with SMTP id p13mr1079978wmb.86.1562700301927; Tue, 09 Jul 2019 12:25:01 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 21:23:23 +0200 Message-Id: <20190709192324.12092-4-stamatis.iliass@gmail.com> In-Reply-To: <20190709192324.12092-1-stamatis.iliass@gmail.com> References: <20190709192324.12092-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.27]); Tue, 09 Jul 2019 19:25:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 09 Jul 2019 19:25:03 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.195 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, PDS_NO_HELO_DNS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] test_driver: implement virDomainFSThaw 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 09 Jul 2019 19:25:23 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 8c25c679a5..097720bb0a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3496,6 +3496,71 @@ testDomainFSFreeze(virDomainPtr dom, } +static int +testDomainFSThaw(virDomainPtr dom, + const char **mountpoints, + unsigned int nmountpoints, + unsigned int flags) +{ + virDomainObjPtr vm; + testDomainObjPrivatePtr priv; + size_t i; + int slash =3D 0, slash_boot =3D 0; + int ret =3D -1; + + virCheckFlags(0, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + priv =3D vm->privateData; + + if (nmountpoints =3D=3D 0) { + ret =3D priv->frozen[0] + priv->frozen[1]; + priv->frozen[0] =3D priv->frozen[1] =3D false; + } else { + for (i =3D 0; i < nmountpoints; i++) { + if (STREQ(mountpoints[i], "/")) { + if (priv->frozen[0]) { + slash =3D 1; + } else { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("mount point is not frozen: /")); + goto cleanup; + } + } else if (STREQ(mountpoints[i], "/boot")) { + if (priv->frozen[1]) { + slash_boot =3D 1; + } else { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("mount point is not frozen: /boot")); + goto cleanup; + } + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("mount point not found: %s"), + mountpoints[i]); + goto cleanup; + } + } + + if (slash) + priv->frozen[0] =3D false; + if (slash_boot) + priv->frozen[1] =3D false; + + ret =3D slash + slash_boot; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -7739,6 +7804,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainUndefine =3D testDomainUndefine, /* 0.1.11 */ .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ .domainFSFreeze =3D testDomainFSFreeze, /* 5.6.0 */ + .domainFSThaw =3D testDomainFSThaw, /* 5.6.0 */ .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:49:59 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=1562700351; cv=none; d=zoho.com; s=zohoarc; b=eW0VmWO3bU1fDFZNp9ekjI8vBAVKwTrWGki0wxEgF7byHz4iClfC7Ha+DesNp0PT8l3YmeY2CUG4uqm0CpLqbzeAEpEWw/0UDz5K4BhB7i7HjPUFIGpynRI+09q5gye/JA6ITSiLQrxbc0ih2oGSqV0HrwT5PGT+UoiJjEMVFpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562700351; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rcHuqOH1/9BBLp1Wd6AiKf54rZgK1gtYYCi7p19wYIw=; b=WV/XjyxgK8Qo9tgxkmz737bR88YKDvipg7ckFeU/DiXMCpVv7Hrb7i4PcobIimHREpfACJuwKyVpc0YATlRImVQOgaWGOfMwkbqmTeZv51t/U9+QuSr6G5Ek9d52Pe/B+aulyPV77jO2IppYQeabcM8oGe7ByDNDIuuBtHdvF1k= 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 1562700351677707.410826490885; Tue, 9 Jul 2019 12:25:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBAE390C7A; Tue, 9 Jul 2019 19:25:49 +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 8AC945F7C0; Tue, 9 Jul 2019 19:25:49 +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 4825B1833002; Tue, 9 Jul 2019 19:25:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x69JPlqK017290 for ; Tue, 9 Jul 2019 15:25:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id E1D4A871D2; Tue, 9 Jul 2019 19:25:47 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBFC2871CE for ; Tue, 9 Jul 2019 19:25:45 +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 54B9030C1E21 for ; Tue, 9 Jul 2019 19:25:29 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 207so4224012wma.1 for ; Tue, 09 Jul 2019 12:25:29 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id b2sm27037295wrp.72.2019.07.09.12.25.26 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 12:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6ROpYBwjTKxGeCnj0Ja+PZIEQVwQ0dur700Keb/NyyY=; b=Ln3L9qxprFrhpJnyX8NuE3H3oYdZBNnshTp1HQ5xW6tY5E9+imwnfLvFw94L7yDBE4 DCDGGtKBcHjbB991Lybw7cfbLct1LDYK50OJxmcyYQdo8flQp7US0BMYzVikovoL/OII rn5w5lo9p3XAbxxKFQd6HNE+vlYiK3CIdPJAb4azznd7kFZKWLt8BCwphbG2JT/ObMnq wx8wtd+P8gi7CAvnPvg3RuaREZ5007miwKLXxFSAyF8syu756hzjuZVuR4Fa4MqlBpMx x92FuuckzAnevOEyjKn3QGYAjNMz1Aasj8MedlAo/MNq4G0GqafnNpsgPiRAHVWAmUlK CXsQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6ROpYBwjTKxGeCnj0Ja+PZIEQVwQ0dur700Keb/NyyY=; b=U80sIa49owJho3m0D+xaOTV2EbgLYR14wBWTd0fQ7Lkpd/MNjJIUntrflDInKhaFYP 6X4g5Ysji3KghrInw2uxf+yHmXQfsDsmJ9bn4BL//VzNa7YGK85B/thm7XTS03+FYlgl JWigwDPA6qVhhPtO3D39SRynG9z2R3wMFJLjdq2Mf0Fyml++UYD0eBZVuIgSpvuvD5KB R+X3sYlZBYOd7CX6syihdk9VAdljBd1MY8SsRadBspT3s9Whq7QHS/O7KKC915LrgNa5 5EwogEOUwxDHNWvk3R7WrelYsp210y0XCSMgpbmUOsqHSoz7yof7zjLcHBWrCWVS7RlD h+ew== X-Gm-Message-State: APjAAAWrn6FwpHZUmeorFkZeCNKYwhKK0xJZdEQ7U2a+6BVrXzzX6Tab stbiQ1eROexFs0lDMLZjQzx+F2drhXM9cqJb X-Google-Smtp-Source: APXvYqyCucGzSBOdXECnx3Pba4X1oHYfn7sc2jMHX8pNnFFNMCVGX+EvrCWbS4yTc3xaSM3qKF4pDg== X-Received: by 2002:a1c:a8d7:: with SMTP id r206mr1183360wme.47.1562700327697; Tue, 09 Jul 2019 12:25:27 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 21:23:24 +0200 Message-Id: <20190709192324.12092-5-stamatis.iliass@gmail.com> In-Reply-To: <20190709192324.12092-1-stamatis.iliass@gmail.com> References: <20190709192324.12092-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.47]); Tue, 09 Jul 2019 19:25:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 09 Jul 2019 19:25:29 +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: 1.228 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, PDS_NO_HELO_DNS, 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.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] test_driver: implement virDomainFSTrim 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 09 Jul 2019 19:25:50 +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 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 097720bb0a..b491247e49 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3561,6 +3561,37 @@ testDomainFSThaw(virDomainPtr dom, } +static int +testDomainFSTrim(virDomainPtr dom, + const char *mountPoint, + unsigned long long minimum ATTRIBUTE_UNUSED, + unsigned int flags) +{ + virDomainObjPtr vm; + int ret =3D -1; + + virCheckFlags(0, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + if (mountPoint && STRNEQ(mountPoint, "/") && STRNEQ(mountPoint, "/boot= ")) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("mount point not found: %s"), + mountPoint); + goto cleanup; + } + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -7805,6 +7836,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ .domainFSFreeze =3D testDomainFSFreeze, /* 5.6.0 */ .domainFSThaw =3D testDomainFSThaw, /* 5.6.0 */ + .domainFSTrim =3D testDomainFSTrim, /* 5.6.0 */ .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list