From nobody Sun Feb 8 01:33:23 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; 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=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1565794071; cv=none; d=zoho.com; s=zohoarc; b=k9YDCZRge0CH+P3UVUzminvZWhSt7iWVBjD4xhKIZB/SkvO8jEsamquQeb43cN2fNH43mCU3uu+VZUU+mZs35OLizG7BwwJKa7f9Bs2qOwT8isPb1bOTGck91r7ngmLogDL2jUmqsAFosNGEuaa9TaiStAF1FfrtUlKH9rNVmvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565794071; 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=10QBuY9brwJidCg3omuolO2ZWg3YiusrA0xzHPihEP8=; b=iuoWNX3ROnR4Efo1TUGMp/q6uBH56bm2ZdQaajTjsyWy5z64DUhI1SrBdWnlK0VnsaBKfdVvDtdxGAb7U+nxLgcXVz6I4bPHGpqgtqcuiSYqoVeUYsk9pzfuZ/QmSb50HfGPaf3tqmb3DJeAiSiemed+a8ins9k4V4Tk8uyT+A0= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1565794071389189.02046428052904; Wed, 14 Aug 2019 07:47:51 -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 1F2EF8E915; Wed, 14 Aug 2019 14:47:50 +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 EC1F81001B12; Wed, 14 Aug 2019 14:47: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 F21A424F35; Wed, 14 Aug 2019 14:47:44 +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 x7EElgK0023152 for ; Wed, 14 Aug 2019 10:47:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB59283285; Wed, 14 Aug 2019 14:47:42 +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 D4D038329C for ; Wed, 14 Aug 2019 14:47:40 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 CB86B3064FCF for ; Wed, 14 Aug 2019 14:47:39 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7EEberi139635 for ; Wed, 14 Aug 2019 10:47:39 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ucjeedqxn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 14 Aug 2019 10:47:39 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Aug 2019 15:47:38 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 14 Aug 2019 15:47:36 +0100 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7EElYuP56492366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2019 14:47:34 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B7297806A; Wed, 14 Aug 2019 14:47:34 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DDD67805F; Wed, 14 Aug 2019 14:47:33 +0000 (GMT) Received: from maxibm.ibmuc.com (unknown [9.85.197.163]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 14 Aug 2019 14:47:32 +0000 (GMT) From: "Maxiwell S. Garcia" To: libvir-list@redhat.com Date: Wed, 14 Aug 2019 11:47:21 -0300 In-Reply-To: <20190814144722.806-1-maxiwell@linux.ibm.com> References: <20190814144722.806-1-maxiwell@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081414-0012-0000-0000-0000175B2051 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011590; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01246731; UDB=6.00657936; IPR=6.01028239; MB=3.00028173; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-14 14:47:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081414-0013-0000-0000-00005879960B Message-Id: <20190814144722.806-2-maxiwell@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-14_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908140150 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 14 Aug 2019 14:47:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 14 Aug 2019 14:47:40 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'maxiwell@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.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 Cc: danielhb413@gmail.com, "Maxiwell S. Garcia" Subject: [libvirt] [PATCH v3 1/2] qemu: formatting XML from domain def choosing the root name 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.26]); Wed, 14 Aug 2019 14:47:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The function virDomainDefFormatInternal() has the predefined root name "domain" to format the XML. But to save both active and inactive domain in the snapshot XML, the new root name "inactiveDomain" was created. So, this function was modified to be driven by the new flag VIR_DOMAIN_DEF_FORMAT_INACTIVE_NODE to choose the correct root name. Signed-off-by: Maxiwell S. Garcia Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 13 ++++++++++--- src/conf/domain_conf.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 03312afaaf..7d6393b9ac 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28230,6 +28230,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, unsigned char *uuid; char uuidstr[VIR_UUID_STRING_BUFLEN]; const char *type =3D NULL; + const char *rootname =3D NULL; int n; size_t i; char *netprefix =3D NULL; @@ -28238,7 +28239,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, VIR_DOMAIN_DEF_FORMAT_STATUS | VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET | VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES | - VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST, + VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST | + VIR_DOMAIN_DEF_FORMAT_INACTIVE_NODE, -1); =20 if (!(type =3D virDomainVirtTypeToString(def->virtType))) { @@ -28250,7 +28252,12 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (def->id =3D=3D -1) flags |=3D VIR_DOMAIN_DEF_FORMAT_INACTIVE; =20 - virBufferAsprintf(buf, "id); if (def->namespaceData && def->ns.href) @@ -28732,7 +28739,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, virDomainSEVDefFormat(buf, def->sev); =20 virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + virBufferAsprintf(buf, "\n", rootname); =20 if (virBufferCheckError(buf) < 0) goto error; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index bce47443c8..63791a8002 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2984,6 +2984,7 @@ typedef enum { VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM =3D 1 << 6, VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT =3D 1 << 7, VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST =3D 1 << 8, + VIR_DOMAIN_DEF_FORMAT_INACTIVE_NODE =3D 1 << 9, } virDomainDefFormatFlags; =20 /* Use these flags to skip specific domain ABI consistency checks done --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list