From nobody Sun May 5 06:22:17 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=1564925279; cv=none; d=zoho.com; s=zohoarc; b=lDPwA5kxnzet7pBCqUgjM3L7NjAByzXffVpeLj2XHCq2k2wV9ES7YhA90khwWZ+g+zWmlbt1oW3OIvO/iWkDnG0vL9SeUVTsveD0otUYJeclLgGknMmIJtE8bReu+kppJKhcsAqj44iatfgbhoaQh6xPzvwsnYBsOFKIRB+eiQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564925279; h=Content-Type:Content-Transfer-Encoding:Cc: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=OCt7jIVSKhkZdHh4jUmdC6gEVnXMxplfz6H9HeRdYs8=; b=h5Erct+6ryQjN0jH7fgFqLyrMaPgL4Qfwe2Pz3IaiAMRQJ3jbI82qk7vEFa4ClYWOwlpt+sCuxMEouUnIbOF1MFJIEl+YrnXMtoG5x8oCMHIlWv3+O9IAJf95MOv7uy4Ici7DakHbDkR2EJ7+iZWh0T5fcs1VKX1Vr1kwsXIm/Q= 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 1564925279205994.9709902612717; Sun, 4 Aug 2019 06:27:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74EB83082128; Sun, 4 Aug 2019 13:27:57 +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 4B7C360C4C; Sun, 4 Aug 2019 13:27:57 +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 0CECA180B536; Sun, 4 Aug 2019 13:27:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x74DRo22014470 for ; Sun, 4 Aug 2019 09:27:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7852719C6A; Sun, 4 Aug 2019 13:27:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4602C19C58; Sun, 4 Aug 2019 13:27:48 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.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 C6D7785541; Sun, 4 Aug 2019 13:27:46 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y4so81763087wrm.2; Sun, 04 Aug 2019 06:27:46 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id 4sm187176532wro.78.2019.08.04.06.27.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 06:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ds0nTODmf5BtCW+SpuWsIXSzjKq52LvSurWdo1hpmh4=; b=aYFFImkCmZAgWzH04jNLMtqwqqeu7vf8p2ZtPg18IubkMTLbzi39MU3U2THCNksHrm X6g/T7ZbdLSH3pD9VPaUcQqyzu+cA09ipoPMXac4j2WspOTkn0mMWZVGt5ldSxkLSFBG RF764wKYMoxqENO/I498z65ke2i6W8raFnWSPa+l4I+tI3TLU92EW/I8A02g+61fzH3W P65tRxjK8cDy5DAhX5bDyTJdZdI50VD/R/RV7iE2hjF5r5sZNs0LvF9epVmWxfnhYHKd 5AAaX8jc+TlpIgouoevc0akAUAdHMphlktxt5TBc8/V8qVhPpqUdNvnJwCEoRq+rbvHl sWrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ds0nTODmf5BtCW+SpuWsIXSzjKq52LvSurWdo1hpmh4=; b=f+WKnEREFkuT/wCRzhSKvlKNdKL5gUBgWr9R/c8mfnhvf8AD0l5iiaJ1j1k7zMk9i5 7no+TcSthzyNUdUpdMcG5THdm7CPm8G9sh1bnp8uintTD3vbGNHZlf4voNqLcSf8Jiqm uS1YdEXhN+/U8y60+dFE3VGxZOy1y9euOftCKUQkZeTwdf95SqO3XPmzlpYZBZCHrJgw neUdy+rK+B7yZ7u+DGkGs0Wu+qyE6x+Mi465n0LPsLNUMwHsXc4sG9afnTyBy0OAf1ny vagpMqfaiHXoayFOkODRkXh+CAxYXVQCyTYjcAnIkMO39Z1n9xB3GIuhYXW1Nd0OCM3H TXbg== X-Gm-Message-State: APjAAAUDEZ6TNlBBV6yUrnf/Pwv4Y3NcXgUrYcxQhm4xOHXwHvw/rswU 9eEi/pWq69V/8xqWVjwxDBn2fXB3p/UvOA== X-Google-Smtp-Source: APXvYqz0S8ILDWKejZclu29SsGS99EqgiquuPo2LyMf9yIrOYoVnOKxygp4Msq+eJFOJ6OkM0Rb1Bg== X-Received: by 2002:adf:eb49:: with SMTP id u9mr38600489wrn.215.1564925265170; Sun, 04 Aug 2019 06:27:45 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Sun, 4 Aug 2019 15:27:15 +0200 Message-Id: <20190804132718.25166-2-stamatis.iliass@gmail.com> In-Reply-To: <20190804132718.25166-1-stamatis.iliass@gmail.com> References: <20190804132718.25166-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.28]); Sun, 04 Aug 2019 13:27:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 04 Aug 2019 13:27:47 +0000 (UTC) for IP:'209.85.221.66' DOMAIN:'mail-wr1-f66.google.com' HELO:'mail-wr1-f66.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.221.66 mail-wr1-f66.google.com 209.85.221.66 mail-wr1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH v2 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sun, 04 Aug 2019 13:27:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" vm-specific data can be used by APIs that need to preserve some state between calls Some of them are: - FS-related APIs for remembering which mountpoints are frozen - virDomainSetTime / virDomainGetTime for maintaining time information - virDomainSetIOThreadParams for storing the I/O thread parameters - virDomainManagedSaveDefineXML for internally storing the VM definition Signed-off-by: Ilias Stamatis 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 aae9875194..88a1d330c1 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -386,6 +386,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) { @@ -401,6 +430,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) @@ -409,7 +442,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 Sun May 5 06:22:17 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=1564925284; cv=none; d=zoho.com; s=zohoarc; b=gl6lDabbCiS5N+NFKiKhl5QzJhQwNGLop1OK2LE8HRqcd/XRU8ZCmBaKE291dsT5c2AgdoejiPnIuh8jaxQmPUwQkRXsrELtGVGRVzQFlh17Mkf6hvIQnCp3lyZsxzHy6/TwfqwldtFF+fJz7pWBF9C6DDS1eA0bcCn3wOemaTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564925284; 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=8pAjwuB8PWXIyAfnScJOKyHblrN57HpFolG/WWp7yVw=; b=UPjrqzwO5HTZwWMH2Iw+EZEJDbKwJ2ZRgqrURM25wmYb02msvN0ICAJLRMzIz/3xO3jSfuyIwoh1jW0jSZsLukaU7n57beW/GUAJybjOKCjeOqkCz8WjqRAiiKXCvd7aPcpWizP2JO7aZxNpP/PXx60sFNHpZnC/dWl7niLpH6s= 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 1564925284131195.68878033948909; Sun, 4 Aug 2019 06:28:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 842F43008958; Sun, 4 Aug 2019 13:28:02 +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 574475C22D; Sun, 4 Aug 2019 13:28:02 +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 17A2E41F53; Sun, 4 Aug 2019 13:28:02 +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 x74DS09e014486 for ; Sun, 4 Aug 2019 09:28:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 358696012E; Sun, 4 Aug 2019 13:28:00 +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 30170601A6 for ; Sun, 4 Aug 2019 13:27:57 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (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 94C473082A49 for ; Sun, 4 Aug 2019 13:27:56 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id p13so7189122wru.10 for ; Sun, 04 Aug 2019 06:27:56 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id 4sm187176532wro.78.2019.08.04.06.27.53 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 06:27:54 -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=R6/Btpzfvdp3NS4ujP1PysmpKxBklVnXBVfuvYsaaJI=; b=HHSoF4cCfvvEj+T2tZSe3/9fO8ZjRqTjPw0D/cM2vEoOs//DMpiRcX2loICj8PMiXQ CopHX7op7YMf3Bladi/Y4Kyg6IHrTf5aSMOtx5LfvcSGZdR/SMPNHXyHNUOaD+ZLGK4o y3cy6V2Pa7PoHNtTdoWZGZH85AiOu5cc1bzXZa7E30x9mo9J14FTuxr6R5jQwVQ9/fUh NcQ1FBf2SOw7NfP+ymZgVYykTskHBb2I1RjyG13UaoAV+vs73x4dWdqX/gu8dx3mAXwN APXCxWm4sja92Ob//JFBdG2l5RWUpdgO9VMaJ3q74sRdWBn/Rei7TAaXak/VhGqY9wKr wkBQ== 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=R6/Btpzfvdp3NS4ujP1PysmpKxBklVnXBVfuvYsaaJI=; b=VuMQ0qTW60H949CrAXs7EEBsfVcdJe308+Faq97sw5JB6tNPAETL4g93qwVnNSRNkV 0Ffzc86Hr+9ZjL/PqdavlXON0uAq4Tlrp6VS4yFfwQ2W44iMI5ADetd286PxfsGPsRvx H28ThTxbb6sNHRveTlS/RyOunt/PVMHQRuJmaguBLeG5xoraRCMDSRqAVP9Lzfxm4kZE rNYYR4rueW2Q/wr9BJRBTq1Ors/omY3x6YM7iU9CnqzQ5/7xgK5fLjiMc0TRJNpZr3Yj Bgt/D2YhoSLERVq4IqpKIwoD+7PV/uBHA6sDhq7lO5FscsxZR8QkKWHIRYerAWo8/vNc rjpg== X-Gm-Message-State: APjAAAWQPtDlp8v62VF9mDt7FnFQLFMvUZ+KfzG7xXjHNEOdGgJcqB1E 4VFEWhAHUDNK8Hoxac/chtaIl5YxT425EA== X-Google-Smtp-Source: APXvYqyzQE6nKYFZ3nFy+WfejC8F6eumZyyepgkb8yaWFHDRqZ+Ph5TAgqSqxS5hDjB24DiD8MiBiw== X-Received: by 2002:a5d:408c:: with SMTP id o12mr58938001wrp.176.1564925274948; Sun, 04 Aug 2019 06:27:54 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Sun, 4 Aug 2019 15:27:16 +0200 Message-Id: <20190804132718.25166-3-stamatis.iliass@gmail.com> In-Reply-To: <20190804132718.25166-1-stamatis.iliass@gmail.com> References: <20190804132718.25166-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]); Sun, 04 Aug 2019 13:27:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sun, 04 Aug 2019 13:27:56 +0000 (UTC) for IP:'209.85.221.67' DOMAIN:'mail-wr1-f67.google.com' HELO:'mail-wr1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.221.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.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 v2 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sun, 04 Aug 2019 13:28:03 +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 Reviewed-by: Erik Skultety --- src/test/test_driver.c | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 88a1d330c1..a8b75b175a 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -390,6 +390,8 @@ typedef struct _testDomainObjPrivate testDomainObjPriva= te; typedef testDomainObjPrivate *testDomainObjPrivatePtr; struct _testDomainObjPrivate { testDriverPtr driver; + + bool frozen[2]; /* used by file system related calls */ }; @@ -402,6 +404,7 @@ testDomainObjPrivateAlloc(void *opaque) return NULL; priv->driver =3D opaque; + priv->frozen[0] =3D priv->frozen[1] =3D false; return priv; } @@ -4046,6 +4049,74 @@ 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 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 0; + if (priv->frozen[0] =3D=3D false) { + priv->frozen[0] =3D true; + ret++; + } + if (priv->frozen[1] =3D=3D false) { + priv->frozen[1] =3D true; + ret++; + } + } else { + int nfreeze =3D 0; + bool freeze[2]; + + memcpy(&freeze, priv->frozen, 2); + + for (i =3D 0; i < nmountpoints; i++) { + if (STREQ(mountpoints[i], "/")) { + if (!freeze[0]) { + freeze[0] =3D true; + nfreeze++; + } + } else if (STREQ(mountpoints[i], "/boot")) { + if (!freeze[1]) { + freeze[1] =3D true; + nfreeze++; + } + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("mount point not found: %s"), + mountpoints[i]); + goto cleanup; + } + } + + /* steal the helper copy */ + memcpy(priv->frozen, &freeze, 2); + ret =3D nfreeze; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -8692,6 +8763,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.7.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 Sun May 5 06:22:17 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=1564925307; cv=none; d=zoho.com; s=zohoarc; b=cAyWlm+Bcv1eoZpMBoNu99J3C0GkzLhqWirYyNnZ1orSnfAyFou2cZ0tHQUwolMJzJgQoq0B0tDPrNxntPkytGmliLyv6GE5ApiISyYevDatXzNcfCfFs2cye/uJXjPZmhtx5I9T+bXCn6NG3gEJEziYPCisMOaBHLV8+dv/e10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564925307; 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=CYm2jHGQYYsE/p5oHt87wNbVcBc5Z+v/fFwzDoUQqqQ=; b=Qui0H/wXeGn8QJmLtAu7LEhp7fX2yHBSs5xTO1a3UhQ36kzC1z7RiRjzMLbzjkXxhKuqLb9kwziCIhFW0pFSBMPVa3cMvDiBISQFtgVOOk9ue/aXDdpnlbhTxkdSwbGZlCEvRaphhLt1Lqa6PKWz3KSanEvARyFVa963QzW4W+0= 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 1564925307019197.9395776857042; Sun, 4 Aug 2019 06:28:27 -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 C184481DEC; Sun, 4 Aug 2019 13:28:25 +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 9BA266012D; Sun, 4 Aug 2019 13:28:25 +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 66EEF41F66; Sun, 4 Aug 2019 13:28:25 +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 x74DSOH7014533 for ; Sun, 4 Aug 2019 09:28:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id A2BBE5D713; Sun, 4 Aug 2019 13:28:24 +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 9DE185D712 for ; Sun, 4 Aug 2019 13:28:22 +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 7F0B6309DF11 for ; Sun, 4 Aug 2019 13:28:21 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id h19so4801538wme.0 for ; Sun, 04 Aug 2019 06:28:21 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id 4sm187176532wro.78.2019.08.04.06.28.19 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 06:28:19 -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=OUs8lTl9zYn7qStdgqLWhSa/e0F3//ADMhcBlS3gphA=; b=Bxro2afuil8WouzT0oLJwa0ZlpsWO1xMW6VFKdxdTGABzSb0VfzC0az8jQkCSBpWKz qFrAaeHuhXMdVhZzutNMkkpcfbVIWihH5VkUGbZv0mDTAyQKMxmXrELBvBoiaqgmGtSF S/MnpE7qHZh9kyJjfAqYPPE0LDaMpsO/EgNxwGO3cNYmAzT8oq4Rzwa39FKHa3hb3Mb9 hiYilwKnjMgtExK/L4u+L9QBzl2cR7nZ2OeLWqJfPsNOpZw730EM68BNq5Q/2HSe2LUi rgExVgBoKbkjxpyqp2ONauraQEeG390f3BUb3zaxThncJP263cunH3hoTHBH6uTpYXZd naFA== 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=OUs8lTl9zYn7qStdgqLWhSa/e0F3//ADMhcBlS3gphA=; b=jDr9RQjYtN6Uy/gsbrYPvvzj+D5nEViMQHiw11JuD3tt6RBEQKmDGLb169lmefVJ5Y Cjwqvz8dZG9S360Th0+tsen0viC7VLdI4BoAdluk1ra80mccx4+Jjd0FdlWZMjhNu2mf uKXy4OZKiu8CbHZlizLETGlU8ha/1CTpYhP7NYKbPISccttbQU/V7YAdMXxlFGZ1Hz/M QDw7aUnt27Dlfy7jc/yKQcJUJcq+lob4oRo7tAma07evJZNTuXuu6PRsg4Q75RbtJeBh XVa1GH7t0VwfBsb1rB37QzZ838yCgpkmc3RbEkKrNZVyy4rU1Wf/jIxsdx4fK7FwQDOY PzIg== X-Gm-Message-State: APjAAAWuvyCvY2aJhkmxp1d6O4mcLqgqP0GeoGzoX/zdGcA8w4voajDm 20BRE//1oEm+kI9sNPaJmomOoVqgxO8Y/g== X-Google-Smtp-Source: APXvYqx2ExC4XGkX9D6OyARBmJ42ZUbOSqRIwxznhDWVFMQQcqaxZUTxfIukmfmgTDS8xMficzjdMA== X-Received: by 2002:a05:600c:2245:: with SMTP id a5mr13962513wmm.121.1564925299849; Sun, 04 Aug 2019 06:28:19 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Sun, 4 Aug 2019 15:27:17 +0200 Message-Id: <20190804132718.25166-4-stamatis.iliass@gmail.com> In-Reply-To: <20190804132718.25166-1-stamatis.iliass@gmail.com> References: <20190804132718.25166-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]); Sun, 04 Aug 2019 13:28:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sun, 04 Aug 2019 13:28:21 +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: -0.099 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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.25]); Sun, 04 Aug 2019 13:28:26 +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 | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a8b75b175a..2a9041d777 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4117,6 +4117,66 @@ 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 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 { + int nthaw =3D 0; + bool freeze[2]; + + memcpy(&freeze, priv->frozen, 2); + + for (i =3D 0; i < nmountpoints; i++) { + if (STREQ(mountpoints[i], "/")) { + if (freeze[0]) { + freeze[0] =3D false; + nthaw++; + } + } else if (STREQ(mountpoints[i], "/boot")) { + if (freeze[1]) { + freeze[1] =3D false; + nthaw++; + } + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("mount point not found: %s"), + mountpoints[i]); + goto cleanup; + } + } + + /* steal the helper copy */ + memcpy(priv->frozen, &freeze, 2); + ret =3D nthaw; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { @@ -8764,6 +8824,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainUndefine =3D testDomainUndefine, /* 0.1.11 */ .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ .domainFSFreeze =3D testDomainFSFreeze, /* 5.7.0 */ + .domainFSThaw =3D testDomainFSThaw, /* 5.7.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 Sun May 5 06:22:17 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=1564925319; cv=none; d=zoho.com; s=zohoarc; b=h0x0H9i/Qyndo47Yw9C00mbm9wI71622bDRN6QO+1FAfOy4g2LXxrpnlWcVFEY1JUO3njvnqGe/60e9EIgV/SAVDCZSktKEfqdlclLiaseywci7TLaCVF//V7rucY3zFGuExLpWkT+iw1fTK5v5QQNkbAE4yS5vLJG5k77o/nLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564925319; 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=m94Q7e1/MfZJhuJhPpmmeNp2scFz0/iXO/sOYEDpfkg=; b=OtE7uog9XlCc0yNrz6uiUcEg7yvcroYhz/pUEQG8fGUce7o4fmvdIE+pqpiWzEGOrgNlMu6M+zepZKc0Fg3//dIwpnvIb+AvcTXtQVPgJ2ZDw4V5MCDqFJGD5ueVY0/Hg144jUYo84XtQiD71uVhZ93favNzaLOredziHpAz+ks= 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 15649253190681023.8699063656704; Sun, 4 Aug 2019 06:28:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A9C0A3EA7; Sun, 4 Aug 2019 13:28:37 +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 73E1B60BFB; Sun, 4 Aug 2019 13:28:37 +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 40F503FA9A; Sun, 4 Aug 2019 13:28:37 +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 x74DSZdi014573 for ; Sun, 4 Aug 2019 09:28:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id E293960610; Sun, 4 Aug 2019 13:28:35 +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 DC18060A9F for ; Sun, 4 Aug 2019 13:28:33 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 7165381F2F for ; Sun, 4 Aug 2019 13:28:32 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id x4so28575864wrt.6 for ; Sun, 04 Aug 2019 06:28:32 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id 4sm187176532wro.78.2019.08.04.06.28.30 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 06:28:30 -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=f4kjaR3GBoLH2W7wZ6/WvAfdetXtzfdwcM7Y6ghj7Mw=; b=oB7IYqAs3CUAxVgCo2OV5S07jjoGsLM3gu6B42ttJ0vmBmiah1pP4ggf1Jn/2sG8xR wdMB+YPktWm4WO+He6A21BIFbVQbHEr/cd8XYQHlTFkbGp6vXQMq+vzhgAqAOnTGaKYg aqrT9e+lMtGERjNcfhEFJX8bu+q2BWe2+F/VdWeSDXwXTPRVWzSrepiqRE7dRJWp+kAc hAVKQ4JL2BUK3mQoRgjaHrvpjBO2mglyn/OHPYaRdW79llc/X2z8iqz7irSIaVsRorQS wISgXcBQQTIdjHO9pVgyqSJnVl+pHBCCuUA7spGrRrRF3Q1/bhlpoRhhQeJoLlPal3Y0 V/Yw== 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=f4kjaR3GBoLH2W7wZ6/WvAfdetXtzfdwcM7Y6ghj7Mw=; b=MRSIewN6eIDz/1/cRebAL+nCbwRlGegD16xcDgKZ3R6ypQI5ihNZQ7gM0kql0U3S+a ULm/4JD3VwwW2jyJvsIWOoIzCdvXslCbgQ9wAl4Zxj7wcaBfXz3iLnqNkAEePqZbKSqh kUyXj2MVwH4Idg+DVLUh74AeGM+BGPCyF3ggz5oBW3jyq2X1Dd7Ln5cwNtDXld+2HSqa wN2NyALG8Z8mI85japus1sDdzyxD1J62VMT5t74HF0G0F15qLC3H9ZMI9shOM3M+VQgR p3g8d0fL2iLRsnOnYauyovNLyXoBGg/0PtxXNycTR8DWyIUtEKfzzMc5Su4TqE68cV+g 6bzQ== X-Gm-Message-State: APjAAAUdX75fvq2jFgZD0z2z1Nv3K6oYV5IQh9CMFMcXXjGAATblwwCa w3w8DRYca/1956lxap2J+GXQcOciVUYK4A== X-Google-Smtp-Source: APXvYqxXaPx2uvPPvb9vKipM5DohTcIK8RWKNYdy8pxbP4W3d3TBS8Zw/knkg7Zrkozpgn5bEKQuJQ== X-Received: by 2002:a5d:4fc8:: with SMTP id h8mr41768667wrw.177.1564925310890; Sun, 04 Aug 2019 06:28:30 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Sun, 4 Aug 2019 15:27:18 +0200 Message-Id: <20190804132718.25166-5-stamatis.iliass@gmail.com> In-Reply-To: <20190804132718.25166-1-stamatis.iliass@gmail.com> References: <20190804132718.25166-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]); Sun, 04 Aug 2019 13:28:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 04 Aug 2019 13:28:32 +0000 (UTC) for IP:'209.85.221.68' DOMAIN:'mail-wr1-f68.google.com' HELO:'mail-wr1-f68.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.221.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 04 Aug 2019 13:28:38 +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 2a9041d777..cb373f61d3 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4177,6 +4177,37 @@ testDomainFSThaw(virDomainPtr dom, } =20 =20 +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) { @@ -8825,6 +8856,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ .domainFSFreeze =3D testDomainFSFreeze, /* 5.7.0 */ .domainFSThaw =3D testDomainFSThaw, /* 5.7.0 */ + .domainFSTrim =3D testDomainFSTrim, /* 5.7.0 */ .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list