From nobody Sun Feb 8 16:30:59 2026 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=1560157908; cv=none; d=zoho.com; s=zohoarc; b=WhQMP2poW8zDuQTZj9hgg1nzVknqid0xj+OTf8hyrL6FhOA5/r+/6btwzZyUR8kjDo3lNpIL6i1z9smx7aBSF48tzFxzS5Hr7lmZ4Wuoi7R5hBwmk5ek7wKsMVpF9xjCB5QKTAA7LaWzLAIlmUOmI2hG/2jwC7bOD6clUKbMqqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560157908; 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=2r/PLJh0rKrFkpR1kO4PBOUOvgRopmN5s6NqYDdBCq4=; b=Mk/BffspzCeQWG0H16C1iJ0VS+7lj4KCC3MNTEwOb6OiHA0qKfa5MiRGY0MmQ3HqwK6EpNV8+dUjBeRj08ZuOxcWMh4V+o17HATzOq8asVYb0oJhnlUPKMR1pjicyhr7XyjYOPXPOeWYtTWDS/x1lxy6ApYi3CiEjn5zO6d0bwA= 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 1560157908011394.4199322916128; Mon, 10 Jun 2019 02:11:48 -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 6552187622; Mon, 10 Jun 2019 09:11:19 +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 82F2F5D705; Mon, 10 Jun 2019 09:11:07 +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 13FB81806B12; Mon, 10 Jun 2019 09:10:50 +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 x5A96WS5003329 for ; Mon, 10 Jun 2019 05:06:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B06D611BF; Mon, 10 Jun 2019 09:06:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64D0F60856 for ; Mon, 10 Jun 2019 09:06:28 +0000 (UTC) Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.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 5CA283058838 for ; Mon, 10 Jun 2019 09:06:17 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id h10so13427590edi.13 for ; Mon, 10 Jun 2019 02:06:17 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id b10sm1724334eje.29.2019.06.10.02.06.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 02:06:15 -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=eFBNISUslQJbQvdh9bOkpuXU0D78PZCBmXB4cxfLGKs=; b=cB+u0xXtm+RDVUWO2qCAFLPALBKnG49+GFhvKQuhrRyTa4bcyBudtkDVdEBZWKW38Z OrTYgj7ljveuYRAg4M0aptzB6dT3+nRPH2nA6UKyJ7uWRwLhFOqxwzLTyvBBpwXnd2ZI paJ/uwTReM6J2LyW2eqjGfxt9g7Hg9g0e1p74tJ89H7DNCELvpjmFhEnwVedlOjpFFY+ 0egoeEF99VputFU7xLYvOmXk7oDLX9Zyj+jaI9feOo67PXijgEZiwGTGzvTD4OP5tuB8 H883PP43m3m2H9NUlPeL5t5laGY2HDWbROP0+FQCVO+tuTzfBEmF3a9sHJdtkayj5H3A aOJA== 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=eFBNISUslQJbQvdh9bOkpuXU0D78PZCBmXB4cxfLGKs=; b=X5NHYBEj12MI9wPbs/Sgu6xnfMS/Bqt7qIXH95VfXiSgFD9ruMMB605EaCV+TVyafq DwuV9S3GDGJPMIEaGS2aPSDi1Rtx03Ns8Mwm1OXm+nRYthfy0UBDn9OHHJE8PpH7bsNn zyxyWvKDJYdXMHpVegD6QMI4owf+ai+n/2/mkssBflM3LHzx+rK30iZcZJpJJHiMMftH zil+gksjKxjUEBjUBPiewpuZ/lToeRHxbhanq68C+UOYZcNvb7E5m9NAM8hW1OsRzvdw roGkWb9Rd6AfN4xZIEIdmBJg4KGgaP6eNAhbhfJNfC1isM9m6+WRt9GLEfwSuH2w4OvI Jd3w== X-Gm-Message-State: APjAAAWyrJTowX1A6IiKxgP14RQhHXfyvH7fccChitlUO5lv4otVFIvU BrABEVYiL9S2u4QS7sJUxZH8Rfch X-Google-Smtp-Source: APXvYqxt1ixVQ7/td+CKYoyR5OEQacZcwUJt7J2akXpfy4QHhS93PgTqXd/sgW9Uc/CXD5izJYXpqQ== X-Received: by 2002:a50:ad7d:: with SMTP id z58mr49967754edc.277.1560157575730; Mon, 10 Jun 2019 02:06:15 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 10 Jun 2019 11:05:00 +0200 Message-Id: <20190610090501.2274-4-stamatis.iliass@gmail.com> In-Reply-To: <20190610090501.2274-1-stamatis.iliass@gmail.com> References: <20190610090501.2274-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.41]); Mon, 10 Jun 2019 09:06:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 10 Jun 2019 09:06:17 +0000 (UTC) for IP:'209.85.208.65' DOMAIN:'mail-ed1-f65.google.com' HELO:'mail-ed1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.109 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.208.65 mail-ed1-f65.google.com 209.85.208.65 mail-ed1-f65.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/4] test_driver: implement virDomainSaveImageDefineXML 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 10 Jun 2019 09:11:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Updates the existing image stored in @path, in case @dxml contains valid XML supported by the fake host. Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 1b92cb43dd..906c9d5365 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2255,6 +2255,42 @@ testDomainRestore(virConnectPtr conn, return testDomainRestoreFlags(conn, path, NULL, 0); } + +static int +testDomainSaveImageDefineXML(virConnectPtr conn, + const char *path, + const char *dxml, + unsigned int flags) +{ + int ret =3D -1; + int fd =3D -1; + virDomainDefPtr def =3D NULL; + virDomainDefPtr newdef =3D NULL; + testDriverPtr privconn =3D conn->privateData; + + virCheckFlags(VIR_DOMAIN_SAVE_RUNNING | + VIR_DOMAIN_SAVE_PAUSED, -1); + + if ((fd =3D testDomainSaveImageOpen(privconn, path, &def)) < 0) + goto cleanup; + + if ((newdef =3D virDomainDefParseString(dxml, privconn->caps, privconn= ->xmlopt, NULL, + VIR_DOMAIN_DEF_PARSE_INACTIVE)) = =3D=3D NULL) + goto cleanup; + + if (!testDomainSaveImageWrite(privconn, path, newdef)) + goto cleanup; + + ret =3D 0; + + cleanup: + VIR_FORCE_CLOSE(fd); + virDomainDefFree(def); + virDomainDefFree(newdef); + return ret; +} + + static int testDomainCoreDumpWithFormat(virDomainPtr domain, const char *to, unsigned int dumpformat, @@ -7077,6 +7113,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSaveFlags =3D testDomainSaveFlags, /* 0.9.4 */ .domainRestore =3D testDomainRestore, /* 0.3.2 */ .domainRestoreFlags =3D testDomainRestoreFlags, /* 0.9.4 */ + .domainSaveImageDefineXML =3D testDomainSaveImageDefineXML, /* 5.5.0 */ .domainCoreDump =3D testDomainCoreDump, /* 0.3.2 */ .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list