From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526037518561330.37996768134997; Fri, 11 May 2018 04:18:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C454930D8594; Fri, 11 May 2018 11:18:36 +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 80FAC309128B; Fri, 11 May 2018 11:18:36 +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 356D1180474F; Fri, 11 May 2018 11:18:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBHxxp017548 for ; Fri, 11 May 2018 07:17:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E99799347; Fri, 11 May 2018 11:17:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE20E99346 for ; Fri, 11 May 2018 11:17:58 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:48 -0400 Message-Id: <20180511111753.9504-2-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 1/6] conf: Add VM Generation ID parse/format support 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 11 May 2018 11:18:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The VM Generation ID is a mechanism to provide a unique 128-bit, cryptographically random, and integer value identifier known as the GUID (Globally Unique Identifier) to the guest OS. The value is used to help notify the guest operating system when the virtual machine is executed with a different configuration. This patch adds support for a new "genid" XML element similar to the "uuid" element. The "genid" element can have two forms "" or "$GUID". If the $GUID is not provided, libvirt will generate one and save it in the XML. Since adding support for a generated GUID (or UUID like) value to be displayed modifying the xml2xml test to include virrandommock.so is necessary since it will generate a "known" value. Signed-off-by: John Ferlan --- docs/formatdomain.html.in | 27 ++++++++++++ docs/schemas/domaincommon.rng | 8 ++++ src/conf/domain_conf.c | 54 ++++++++++++++++++++= ++++ src/conf/domain_conf.h | 5 +++ tests/qemuxml2argvdata/genid-auto.xml | 32 ++++++++++++++ tests/qemuxml2argvdata/genid.xml | 32 ++++++++++++++ tests/qemuxml2xmloutdata/genid-active.xml | 32 ++++++++++++++ tests/qemuxml2xmloutdata/genid-auto-active.xml | 32 ++++++++++++++ tests/qemuxml2xmloutdata/genid-auto-inactive.xml | 32 ++++++++++++++ tests/qemuxml2xmloutdata/genid-inactive.xml | 32 ++++++++++++++ tests/qemuxml2xmltest.c | 5 ++- 11 files changed, 290 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/genid-auto.xml create mode 100644 tests/qemuxml2argvdata/genid.xml create mode 100644 tests/qemuxml2xmloutdata/genid-active.xml create mode 100644 tests/qemuxml2xmloutdata/genid-auto-active.xml create mode 100644 tests/qemuxml2xmloutdata/genid-auto-inactive.xml create mode 100644 tests/qemuxml2xmloutdata/genid-inactive.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 072f9a0fdc..f881211946 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -34,6 +34,7 @@ <domain type=3D'kvm' id=3D'1'> <name>MyGuest</name> <uuid>4dea22b3-1d52-d8f3-2516-782e98ab3fa0</uuid> + <genid>43dc0cf8-809b-4adb-9bea-a9abb5f3d90e</genid> <title>A short description - title - of the domain</title> <description>Some human readable description</description> <metadata> @@ -61,6 +62,32 @@ specification. Since 0.0.1, sysinfo since 0.8.7 =20 +
genid
+
Since 4.4.0, the genid + element can be used to add a Virtual Machine Generation ID which + exposes a 128-bit, cryptographically random, integer value identif= ier, + referred to as a Globally Unique Identifier (GUID) using the same + format as the uuid. The value is used to help notify + the guest operating system when the virtual machine is re-executing + something that has already executed before, such as: + +
    +
  • VM starts executing a snapshot
  • +
  • VM is recovered from backup
  • +
  • VM is failover in a disaster recovery environment
  • +
  • VM is imported, copied, or cloned
  • +
+ + The guest operating system notices the change and is then able to + react as appropriate by marking its copies of distributed databases + as dirty, re-initializing its random number generator, etc. + +

+ The libvirt XML parser will accept both a provided GUID value + or just <genid/> in which case a GUID will be generated + and saved in the XML. For the transitions such as above, libvirt + will change the GUID before re-executing.

+
title
The optional element title provides space for a short description of the domain. The title should not contain diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8c446ca418..e7d22c6321 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -502,6 +502,14 @@ + + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5d9148c1b1..14779baaa8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18853,6 +18853,34 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(tmp); } =20 + /* Extract domain genid - a genid can either be provided or generated = */ + if ((n =3D virXPathNodeSet("./genid", ctxt, &nodes)) < 0) + goto error; + + if (n > 0) { + if (n !=3D 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("element 'genid' can only appear once")); + goto error; + } + def->genidRequested =3D true; + if (!(tmp =3D virXPathString("string(./genid[1])", ctxt))) { + if (virUUIDGenerate(def->genid) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Failed to generate genid")); + goto error; + } + def->genidGenerated =3D true; + } else { + if (virUUIDParse(tmp, def->genid) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("malformed genid element")); + goto error; + } + } + } + VIR_FREE(nodes); + /* Extract short description of domain (title) */ def->title =3D virXPathString("string(./title[1])", ctxt); if (def->title && strchr(def->title, '\n')) { @@ -21964,6 +21992,25 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr= src, goto error; } =20 + if (src->genidRequested !=3D dst->genidRequested) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target domain requested genid does not match sou= rce")); + goto error; + } + + if (src->genidRequested && + memcmp(src->genid, dst->genid, VIR_UUID_BUFLEN) !=3D 0) { + char guidsrc[VIR_UUID_STRING_BUFLEN]; + char guiddst[VIR_UUID_STRING_BUFLEN]; + + virUUIDFormat(src->genid, guidsrc); + virUUIDFormat(dst->genid, guiddst); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain genid %s does not match source %s"= ), + guiddst, guidsrc); + goto error; + } + /* Not strictly ABI related, but we want to make sure domains * don't get silently re-named through the backdoor when passing * custom XML into various APIs, since this would create havoc @@ -26604,6 +26651,13 @@ virDomainDefFormatInternal(virDomainDefPtr def, virUUIDFormat(uuid, uuidstr); virBufferAsprintf(buf, "%s\n", uuidstr); =20 + if (def->genidRequested) { + char genidstr[VIR_UUID_STRING_BUFLEN]; + + virUUIDFormat(def->genid, genidstr); + virBufferAsprintf(buf, "%s\n", genidstr); + } + virBufferEscapeString(buf, "%s\n", def->title); =20 virBufferEscapeString(buf, "%s\n", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 15d228ba9e..a83df4ed7d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2323,6 +2323,11 @@ struct _virDomainDef { virDomainVirtType virtType; int id; unsigned char uuid[VIR_UUID_BUFLEN]; + + unsigned char genid[VIR_UUID_BUFLEN]; + bool genidRequested; + bool genidGenerated; + char *name; char *title; char *description; diff --git a/tests/qemuxml2argvdata/genid-auto.xml b/tests/qemuxml2argvdata= /genid-auto.xml new file mode 100644 index 0000000000..96ad9ddda8 --- /dev/null +++ b/tests/qemuxml2argvdata/genid-auto.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2argvdata/genid.xml b/tests/qemuxml2argvdata/geni= d.xml new file mode 100644 index 0000000000..fc41f2dd28 --- /dev/null +++ b/tests/qemuxml2argvdata/genid.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + e9392370-2917-565e-692b-d057f46512d6 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmloutdata/genid-active.xml b/tests/qemuxml2xmlo= utdata/genid-active.xml new file mode 100644 index 0000000000..fc41f2dd28 --- /dev/null +++ b/tests/qemuxml2xmloutdata/genid-active.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + e9392370-2917-565e-692b-d057f46512d6 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmloutdata/genid-auto-active.xml b/tests/qemuxml= 2xmloutdata/genid-auto-active.xml new file mode 100644 index 0000000000..aeca0d7fc0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/genid-auto-active.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 00010203-0405-4607-8809-0a0b0c0d0e0f + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmloutdata/genid-auto-inactive.xml b/tests/qemux= ml2xmloutdata/genid-auto-inactive.xml new file mode 100644 index 0000000000..a7b711d469 --- /dev/null +++ b/tests/qemuxml2xmloutdata/genid-auto-inactive.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 00010203-0405-4607-8809-0a0b0c0d0e0f + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmloutdata/genid-inactive.xml b/tests/qemuxml2xm= loutdata/genid-inactive.xml new file mode 100644 index 0000000000..8bd526a7a9 --- /dev/null +++ b/tests/qemuxml2xmloutdata/genid-inactive.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + e9392370-2917-565e-692b-d057f46512d6 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 762e0e2d25..53bc83ad14 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -276,6 +276,8 @@ mymain(void) setenv("PATH", "/bin", 1); =20 DO_TEST("minimal", NONE); + DO_TEST("genid", NONE); + DO_TEST("genid-auto", NONE); DO_TEST("machine-core-on", NONE); DO_TEST("machine-core-off", NONE); DO_TEST("machine-loadparm-multiple-disks-nets-s390", NONE); @@ -1213,7 +1215,8 @@ mymain(void) } =20 VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/virpcimock.so") + abs_builddir "/.libs/virpcimock.so", + abs_builddir "/.libs/virrandommock.so") =20 #else =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15260375233341001.112663860332; Fri, 11 May 2018 04:18:43 -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 C107C300174B; Fri, 11 May 2018 11:18:41 +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 8EC615E7DE; Fri, 11 May 2018 11:18:41 +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 4AA5C1801244; Fri, 11 May 2018 11:18:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBHxGW017554 for ; Fri, 11 May 2018 07:17:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8982899347; Fri, 11 May 2018 11:17:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 482EE99346 for ; Fri, 11 May 2018 11:17:59 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:49 -0400 Message-Id: <20180511111753.9504-3-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 2/6] qemu: Add VM Generation ID device capability 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 11 May 2018 11:18:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add the query of the device objects for the vmgenid device Signed-off-by: John Ferlan --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + 5 files changed, 10 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 64f536b1b0..128e017bcf 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -476,6 +476,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "nbd-tls", "tpm-crb", "pr-manager-helper", + + /* 295 */ + "vmgenid", ); =20 =20 @@ -1103,6 +1106,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "virtio-tablet-ccw", QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW }, { "pcie-pci-bridge", QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE }, { "pr-manager-helper", QEMU_CAPS_PR_MANAGER_HELPER }, + { "vmgenid", QEMU_CAPS_DEVICE_VMGENID }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 6e3e2e0003..542b38027b 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -461,6 +461,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_DEVICE_TPM_CRB, /* -device tpm-crb */ QEMU_CAPS_PR_MANAGER_HELPER, /* -object pr-manager-helper */ =20 + /* 295 */ + QEMU_CAPS_DEVICE_VMGENID, /* -device vmgenid */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.10.0.x86_64.xml index 78d73b29df..30c915af6e 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -196,6 +196,7 @@ + 2010000 0 344938 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 0dce649e90..42fbf33ef0 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -197,6 +197,7 @@ + 2011090 0 390060 diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 27c0a8fda5..417d63a556 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -191,6 +191,7 @@ + 2009000 0 320947 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526037605925683.445538749766; Fri, 11 May 2018 04:20:05 -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 B55FF84D5; Fri, 11 May 2018 11:20:03 +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 7BFD565E81; Fri, 11 May 2018 11:20:03 +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 1F61D4CAA0; Fri, 11 May 2018 11:20:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBI0cU017561 for ; Fri, 11 May 2018 07:18:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 09C2699346; Fri, 11 May 2018 11:18:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id B21899934D for ; Fri, 11 May 2018 11:17:59 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:50 -0400 Message-Id: <20180511111753.9504-4-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 3/6] qemu: Alter VM Generation ID for specific startup/launch transitions 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 11 May 2018 11:20:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Before we generate the command line for qemu, if the domain about to be launched desires to utilize the VM Generation ID functionality, then handle both the regenerating the GUID value for backup recovery (restore operation) and the startup after snapshot as both require a new GUID to be generated to allow the guest operating system to recognize the VM is re-executing something that has already executed before. Signed-off-by: John Ferlan --- src/qemu/qemu_driver.c | 17 ++++++++++++++--- src/qemu/qemu_process.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- src/qemu/qemu_process.h | 1 + 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b03eb3042d..d9959e93db 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6592,7 +6592,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL, asyncJob, "stdio", *fd, path, NULL, VIR_NETDEV_VPORT_PROFILE_OP_RESTORE, - VIR_QEMU_PROCESS_START_PAUSED) =3D=3D 0) + VIR_QEMU_PROCESS_START_PAUSED | + VIR_QEMU_PROCESS_START_GEN_VMID) =3D=3D 0) restored =3D true; =20 if (intermediatefd !=3D -1) { @@ -15910,6 +15911,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, compatible =3D qemuDomainCheckABIStability(driver, vm,= config); } =20 + /* If using VM GenID, there is no way currently to change + * the genid for the running guest, so set an error and + * mark as incompatible. */ + if (compatible && config->genidRequested) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("domain genid update requires restart= ")); + compatible =3D false; + } + if (!compatible) { virErrorPtr err =3D virGetLastError(); =20 @@ -15990,7 +16000,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, cookie ? cookie->cpu : NULL, QEMU_ASYNC_JOB_START, NULL, -1, NULL, sn= ap, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, - VIR_QEMU_PROCESS_START_PAUSED); + VIR_QEMU_PROCESS_START_PAUSED | + VIR_QEMU_PROCESS_START_GEN_VMID); virDomainAuditStart(vm, "from-snapshot", rc >=3D 0); detail =3D VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT; event =3D virDomainEventLifecycleNewFromObj(vm, @@ -16076,7 +16087,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)) { /* Flush first event, now do transition 2 or 3 */ bool paused =3D (flags & VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED) != =3D 0; - unsigned int start_flags =3D 0; + unsigned int start_flags =3D VIR_QEMU_PROCESS_START_GEN_VMID; =20 start_flags |=3D paused ? VIR_QEMU_PROCESS_START_PAUSED : 0; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a280784764..5899c6544a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6097,6 +6097,43 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver, } =20 =20 +/** + * qemuProcessGenID: + * @vm: Pointer to domain object + * @flags: qemuProcessStartFlags + * + * If this domain is requesting to use genid + */ +static int +qemuProcessGenID(virDomainObjPtr vm, + unsigned int flags) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + + if (!vm->def->genidRequested) + return 0; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VMGENID)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU does not support the 'genid' capability= ")); + return -1; + } + + /* If we are coming from a path where we must provide a new gen id + * value regardless of whether it was previously generated or provided, + * then generate a new GUID value before we build the command line. */ + if (flags & VIR_QEMU_PROCESS_START_GEN_VMID) { + if (virUUIDGenerate(vm->def->genid)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to regenerate genid")); + return -1; + } + } + + return 0; +} + + /** * qemuProcessLaunch: * @@ -6149,7 +6186,8 @@ qemuProcessLaunch(virConnectPtr conn, virCheckFlags(VIR_QEMU_PROCESS_START_COLD | VIR_QEMU_PROCESS_START_PAUSED | VIR_QEMU_PROCESS_START_AUTODESTROY | - VIR_QEMU_PROCESS_START_NEW, -1); + VIR_QEMU_PROCESS_START_NEW | + VIR_QEMU_PROCESS_START_GEN_VMID, -1); =20 cfg =3D virQEMUDriverGetConfig(driver); =20 @@ -6173,6 +6211,9 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; logfile =3D qemuDomainLogContextGetWriteFD(logCtxt); =20 + if (qemuProcessGenID(vm, flags) < 0) + goto cleanup; + VIR_DEBUG("Building emulator command line"); if (!(cmd =3D qemuBuildCommandLine(driver, qemuDomainLogContextGetManager(logCtx= t), @@ -6537,7 +6578,8 @@ qemuProcessStart(virConnectPtr conn, =20 virCheckFlagsGoto(VIR_QEMU_PROCESS_START_COLD | VIR_QEMU_PROCESS_START_PAUSED | - VIR_QEMU_PROCESS_START_AUTODESTROY, cleanup); + VIR_QEMU_PROCESS_START_AUTODESTROY | + VIR_QEMU_PROCESS_START_GEN_VMID, cleanup); =20 if (!migrateFrom && !snapshot) flags |=3D VIR_QEMU_PROCESS_START_NEW; diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index eda6695415..dfd9ec6186 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -80,6 +80,7 @@ typedef enum { VIR_QEMU_PROCESS_START_AUTODESTROY =3D 1 << 2, VIR_QEMU_PROCESS_START_PRETEND =3D 1 << 3, VIR_QEMU_PROCESS_START_NEW =3D 1 << 4, /* internal, new VM is= starting */ + VIR_QEMU_PROCESS_START_GEN_VMID =3D 1 << 5, /* Generate a new VMID= */ } qemuProcessStartFlags; =20 int qemuProcessStart(virConnectPtr conn, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15260375339561011.276335320493; Fri, 11 May 2018 04:18:53 -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 9085D3001751; Fri, 11 May 2018 11:18:52 +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 5CA9A65F57; Fri, 11 May 2018 11:18:52 +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 149921801246; Fri, 11 May 2018 11:18:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBI0HH017567 for ; Fri, 11 May 2018 07:18:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 786C199347; Fri, 11 May 2018 11:18:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30E3999346 for ; Fri, 11 May 2018 11:18:00 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:51 -0400 Message-Id: <20180511111753.9504-5-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 4/6] qemu: Add VM Generation ID to qemu command line 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 11 May 2018 11:18:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1149445 If the domain requests usage of the genid functionality, then add the QEMU '-device vmgenid' to the command line providing either the supplied or generated GUID value. Add tests for both a generated and supplied GUID value. Signed-off-by: John Ferlan --- src/qemu/qemu_command.c | 24 +++++++++++++++++ .../qemuxml2argvdata/genid-auto.x86_64-latest.args | 30 ++++++++++++++++++= ++++ tests/qemuxml2argvdata/genid.x86_64-latest.args | 30 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 4 +++ 4 files changed, 88 insertions(+) create mode 100644 tests/qemuxml2argvdata/genid-auto.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/genid.x86_64-latest.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 81a9811d14..eea5269776 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5960,6 +5960,27 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd, } =20 =20 +static int +qemuBuildVMGenIDCommandLine(virCommandPtr cmd, + const virDomainDef *def) +{ + virBuffer opts =3D VIR_BUFFER_INITIALIZER; + char guid[VIR_UUID_STRING_BUFLEN]; + + if (!def->genidRequested) + return 0; + + virUUIDFormat(def->genid, guid); + virBufferAsprintf(&opts, "vmgenid,guid=3D%s,id=3Dvmgenid0", guid); + + virCommandAddArg(cmd, "-device"); + virCommandAddArgBuffer(cmd, &opts); + + virBufferFreeAndReset(&opts); + return 0; +} + + static int qemuBuildSgaCommandLine(virCommandPtr cmd, const virDomainDef *def, @@ -9957,6 +9978,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0) goto error; =20 + if (qemuBuildVMGenIDCommandLine(cmd, def) < 0) + goto error; + /* * NB, -nographic *MUST* come before any serial, or monitor * or parallel port flags due to QEMU craziness, where it diff --git a/tests/qemuxml2argvdata/genid-auto.x86_64-latest.args b/tests/q= emuxml2argvdata/genid-auto.x86_64-latest.args new file mode 100644 index 0000000000..ce163020b9 --- /dev/null +++ b/tests/qemuxml2argvdata/genid-auto.x86_64-latest.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-device vmgenid,guid=3D00010203-0405-4607-8809-0a0b0c0d0e0f,id=3Dvmgenid0 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/genid.x86_64-latest.args b/tests/qemuxm= l2argvdata/genid.x86_64-latest.args new file mode 100644 index 0000000000..54e00f4bdb --- /dev/null +++ b/tests/qemuxml2argvdata/genid.x86_64-latest.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-device vmgenid,guid=3De9392370-2917-565e-692b-d057f46512d6,id=3Dvmgenid0 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 756ca7a77f..0e7b24711f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -787,6 +787,10 @@ mymain(void) QEMU_CAPS_SECCOMP_BLACKLIST); DO_TEST_PARSE_ERROR("minimal-no-memory", NONE); DO_TEST("minimal-msg-timestamp", QEMU_CAPS_MSG_TIMESTAMP); + + DO_TEST_CAPS_LATEST("genid"); + DO_TEST_CAPS_LATEST("genid-auto"); + DO_TEST("machine-aliases1", NONE); DO_TEST("machine-aliases2", QEMU_CAPS_KVM); DO_TEST("machine-core-on", NONE); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152603752695887.959777620821; Fri, 11 May 2018 04:18:46 -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 70EEB30D8567; Fri, 11 May 2018 11:18:45 +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 3AD086314A; Fri, 11 May 2018 11:18:45 +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 E6FEC4BB79; Fri, 11 May 2018 11:18:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBI1X6017575 for ; Fri, 11 May 2018 07:18:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0173A9934A; Fri, 11 May 2018 11:18:01 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D91799347 for ; Fri, 11 May 2018 11:18:00 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:52 -0400 Message-Id: <20180511111753.9504-6-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 5/6] domcaps: Add 'genid' to domain capabilities 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 11 May 2018 11:18:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Report domaincaps if the guest config accepts or $GUID. Signed-off-by: John Ferlan --- docs/formatdomaincaps.html.in | 7 ++++++- docs/schemas/domaincaps.rng | 7 +++++++ src/conf/domain_capabilities.c | 3 +++ src/conf/domain_capabilities.h | 1 + src/qemu/qemu_capabilities.c | 2 ++ tests/domaincapsschemadata/basic.xml | 1 + tests/domaincapsschemadata/bhyve_basic.x86_64.xml | 1 + tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml | 1 + tests/domaincapsschemadata/bhyve_uefi.x86_64.xml | 1 + tests/domaincapsschemadata/full.xml | 1 + tests/domaincapsschemadata/libxl-xenfv-usb.xml | 1 + tests/domaincapsschemadata/libxl-xenfv.xml | 1 + tests/domaincapsschemadata/libxl-xenpv-usb.xml | 1 + tests/domaincapsschemadata/libxl-xenpv.xml | 1 + tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 + 30 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 86c9ce8c5c..f54581c702 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -434,6 +434,7 @@ </enum> </gic> <vmcoreinfo supported=3D'yes'/> + <genid supported=3D'yes'/> </features> </domainCapabilities> @@ -460,7 +461,11 @@ =20

vmcoreinfo

=20 -

Reports whether the vmcoreinfo feature can be enabled

+

Reports whether the vmcoreinfo feature can be enabled.

+ +

genid

+ +

Reports whether the genid feature can be used by the domain.

=20 diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 5913d711a3..5ceabb0a80 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -184,6 +184,7 @@ + @@ -201,6 +202,12 @@ =20 + + + + + + diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 6e2ab0a287..c20358e916 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -586,6 +586,9 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virBufferAsprintf(&buf, "\n", caps->vmcoreinfo ? "yes" : "no"); =20 + virBufferAsprintf(&buf, "\n", + caps->genid ? "yes" : "no"); + virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "
\n"); =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 9b852e8649..b0eb4aa7e3 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -159,6 +159,7 @@ struct _virDomainCaps { =20 virDomainCapsFeatureGIC gic; bool vmcoreinfo; + bool genid; /* add new domain features here */ }; =20 diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 128e017bcf..69a2068355 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4888,6 +4888,8 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, domCaps->vmcoreinfo =3D virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO); =20 + domCaps->genid =3D virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID); + if (virQEMUCapsFillDomainOSCaps(os, firmwares, nfirmwares) < 0 || virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps) < 0 || virQEMUCapsFillDomainIOThreadCaps(qemuCaps, domCaps) < 0 || diff --git a/tests/domaincapsschemadata/basic.xml b/tests/domaincapsschemad= ata/basic.xml index 09e9376585..acc4a4d7d7 100644 --- a/tests/domaincapsschemadata/basic.xml +++ b/tests/domaincapsschemadata/basic.xml @@ -19,5 +19,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml b/tests/doma= incapsschemadata/bhyve_basic.x86_64.xml index 055d05b568..c4e8477055 100644 --- a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_basic.x86_64.xml @@ -29,5 +29,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml b/tests/domai= ncapsschemadata/bhyve_fbuf.x86_64.xml index b22ca43ba0..0ba46b2c5e 100644 --- a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml @@ -46,5 +46,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml b/tests/domai= ncapsschemadata/bhyve_uefi.x86_64.xml index 625a55e70c..80318c78d8 100644 --- a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml @@ -38,5 +38,6 @@ + diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemada= ta/full.xml index 47017c6fd1..9866886303 100644 --- a/tests/domaincapsschemadata/full.xml +++ b/tests/domaincapsschemadata/full.xml @@ -109,5 +109,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenfv-usb.xml b/tests/domainc= apsschemadata/libxl-xenfv-usb.xml index 3f245e8961..6b56419ee1 100644 --- a/tests/domaincapsschemadata/libxl-xenfv-usb.xml +++ b/tests/domaincapsschemadata/libxl-xenfv-usb.xml @@ -72,5 +72,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenfv.xml b/tests/domaincapss= chemadata/libxl-xenfv.xml index a81ce3310c..65dbc5aaf4 100644 --- a/tests/domaincapsschemadata/libxl-xenfv.xml +++ b/tests/domaincapsschemadata/libxl-xenfv.xml @@ -71,5 +71,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenpv-usb.xml b/tests/domainc= apsschemadata/libxl-xenpv-usb.xml index 2bcd588c0f..92e54bae07 100644 --- a/tests/domaincapsschemadata/libxl-xenpv-usb.xml +++ b/tests/domaincapsschemadata/libxl-xenpv-usb.xml @@ -62,5 +62,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenpv.xml b/tests/domaincapss= chemadata/libxl-xenpv.xml index e856ed00c6..741fd2d9d6 100644 --- a/tests/domaincapsschemadata/libxl-xenpv.xml +++ b/tests/domaincapsschemadata/libxl-xenpv.xml @@ -61,5 +61,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domai= ncapsschemadata/qemu_1.7.0.x86_64.xml index 88c087549d..236d0de8f1 100644 --- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml @@ -110,5 +110,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/test= s/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml index 69d9968064..4d7056162e 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml @@ -117,5 +117,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domai= ncapsschemadata/qemu_2.12.0.ppc64.xml index 5fac2ed772..8d7fd64f65 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml @@ -79,5 +79,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domai= ncapsschemadata/qemu_2.12.0.s390x.xml index 4bacb879fe..7dca0b132d 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml @@ -76,5 +76,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/doma= incapsschemadata/qemu_2.12.0.x86_64.xml index d0e2866c49..a8e3174dd6 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml @@ -141,5 +141,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests= /domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml index a4290ddc22..709a14d7fe 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml @@ -114,5 +114,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/doma= incapsschemadata/qemu_2.6.0.aarch64.xml index 943d978682..a4789a532c 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -110,5 +110,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domain= capsschemadata/qemu_2.6.0.ppc64.xml index 86985a5856..79f4a06769 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml @@ -83,5 +83,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domai= ncapsschemadata/qemu_2.6.0.x86_64.xml index 04be214659..55edf1b221 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml @@ -115,5 +115,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domain= capsschemadata/qemu_2.7.0.s390x.xml index 6b2d81520e..d18e05e53c 100644 --- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml @@ -76,5 +76,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/d= omaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml index eadcc3c8e4..825f1f97f8 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml @@ -116,5 +116,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domain= capsschemadata/qemu_2.8.0.s390x.xml index 0a71be4244..d524bb8970 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -157,5 +157,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domai= ncapsschemadata/qemu_2.8.0.x86_64.xml index 243d84fd0d..a0d9e11522 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml @@ -116,5 +116,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/d= omaincapsschemadata/qemu_2.9.0-q35.x86_64.xml index d7cb1dc5ee..254ee01049 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml @@ -124,5 +124,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/d= omaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml index 09457e4be6..478133693f 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml @@ -148,5 +148,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domai= ncapsschemadata/qemu_2.9.0.x86_64.xml index f8337d8dd4..058e624ed3 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -125,5 +125,6 @@ + --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 18:11:56 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526037531264102.94845137822415; Fri, 11 May 2018 04:18: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 E5E9630001DA; Fri, 11 May 2018 11:18:49 +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 B8AB56017E; Fri, 11 May 2018 11:18: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 79FF44CAA7; Fri, 11 May 2018 11:18:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4BBI213017589 for ; Fri, 11 May 2018 07:18:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6AE0899346; Fri, 11 May 2018 11:18:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29A5899347 for ; Fri, 11 May 2018 11:18:01 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 11 May 2018 07:17:53 -0400 Message-Id: <20180511111753.9504-7-jferlan@redhat.com> In-Reply-To: <20180511111753.9504-1-jferlan@redhat.com> References: <20180511111753.9504-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [REPOST PATCHv3 6/6] docs: Add news article for VM Generation ID 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.46]); Fri, 11 May 2018 11:18:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- docs/news.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 80181415c6..c8495e6035 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,19 @@
+ + + Add support for VM Generation ID + + + The VM Generatation ID exposes a 128-bit, cryptographically + random, integer value identifier, referred to as a Globally + Unique Identifier (GUID) to the guest in order to notify the + guest operating system when the virtual machine is executed + with a different configuration. Add a new domain XML processing + and a domain capabilities feature. + +
--=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list