From nobody Fri May 16 03:05:49 2025 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149924531134025.499707679516405; Wed, 5 Jul 2017 02:01:51 -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 407927D4E0; Wed, 5 Jul 2017 09:01:48 +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 EA9056F42D; Wed, 5 Jul 2017 09:01:47 +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 3F1551833033; Wed, 5 Jul 2017 09:01:47 +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 v6591k16021097 for ; Wed, 5 Jul 2017 05:01:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2325D77670; Wed, 5 Jul 2017 09:01:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 192096FE5E for ; Wed, 5 Jul 2017 09:01:43 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE8EF61E4C for ; Wed, 5 Jul 2017 09:01:42 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v6591JZs143481 for ; Wed, 5 Jul 2017 05:01:42 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bg9h78uyx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 05 Jul 2017 05:01:35 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Jul 2017 18:59:59 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 5 Jul 2017 18:59:57 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v658xmrZ9699628; Wed, 5 Jul 2017 18:59:56 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v658xOSQ022279; Wed, 5 Jul 2017 18:59:24 +1000 Received: from powerkvmpok002.pok.stglabs.ibm.com (powerkvmpok002.pok.stglabs.ibm.com [9.114.13.10]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v658x9mh021292; Wed, 5 Jul 2017 18:59:23 +1000 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 407927D4E0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 407927D4E0 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE8EF61E4C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=kmp@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AE8EF61E4C From: Kothapally Madhu Pavan To: libvir-list@redhat.com Date: Wed, 5 Jul 2017 14:28:33 +0530 In-Reply-To: <1499245116-133305-1-git-send-email-kmp@linux.vnet.ibm.com> References: <1499245116-133305-1-git-send-email-kmp@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17070508-0048-0000-0000-000002506677 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17070508-0049-0000-0000-00004801976D Message-Id: <1499245116-133305-5-git-send-email-kmp@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-05_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707050149 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 05 Jul 2017 09:01:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 05 Jul 2017 09:01:42 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'kmp@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -2.7 (BAYES_50, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: kmp@linux.vnet.ibm.com, pkrempa@redhat.com Subject: [libvirt] [PATCH v3 4/7] qemu: Implement qemuDomainManagedSaveDefineXML 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: , MIME-Version: 1.0 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.28]); Wed, 05 Jul 2017 09:01:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This commit adds qemu driver implementation to edit xml configuration of managed save state file of a domain. Signed-off-by: Kothapally Madhu Pavan --- src/qemu/qemu_driver.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 63bdf77..3ecd334 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6843,6 +6843,46 @@ qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, un= signed int flags) return ret; } =20 +static int +qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml, + unsigned int flags) +{ + virQEMUDriverPtr driver =3D dom->conn->privateData; + virConnectPtr conn =3D dom->conn; + virDomainObjPtr vm; + char *path =3D NULL; + int ret; + + if (!(vm =3D qemuDomObjFromDomain(dom))) + return -1; + + path =3D qemuDomainManagedSavePath(driver, vm); + virDomainObjEndAPI(&vm); + + if (!path) + goto error; + + if (!virFileExists(path)) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s",_("domain doesnot have managed save image")); + goto error; + } + + ret =3D qemuDomainSaveImageDefineXML(conn, path, dxml, flags); + + VIR_FREE(path); + + if (ret < 0) + goto error; + + return ret; + + error: + VIR_FREE(path); + virDispatchError(conn); + return -1; +} + /* Return 0 on success, 1 if incomplete saved image was silently unlinked, * and -1 on failure with error raised. */ static int @@ -20856,6 +20896,7 @@ static virHypervisorDriver qemuHypervisorDriver =3D= { .domainHasManagedSaveImage =3D qemuDomainHasManagedSaveImage, /* 0.8.0= */ .domainManagedSaveRemove =3D qemuDomainManagedSaveRemove, /* 0.8.0 */ .domainManagedSaveGetXMLDesc =3D qemuDomainManagedSaveGetXMLDesc, /* 3= .6.0 */ + .domainManagedSaveDefineXML =3D qemuDomainManagedSaveDefineXML, /* 3.6= .0 */ .domainSnapshotCreateXML =3D qemuDomainSnapshotCreateXML, /* 0.8.0 */ .domainSnapshotGetXMLDesc =3D qemuDomainSnapshotGetXMLDesc, /* 0.8.0 */ .domainSnapshotNum =3D qemuDomainSnapshotNum, /* 0.8.0 */ --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list