xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: David Vrabel <david.vrabel@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 6/6] xl: generate a new random VM generation ID if requested
Date: Tue, 3 Jun 2014 14:15:40 +0100	[thread overview]
Message-ID: <1401801340-6196-7-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1401801340-6196-1-git-send-email-david.vrabel@citrix.com>

If the "generation_id" option is set in the domain configuration,
generate and set a new random VM generation ID every time a domain is
created or restored.

xl lacks the infrastructure to fully track the lifecycle of VM images
as they are snapshotted and cloned (etc) so always using a new ID is
the safe option and ensures that a new one will be used where it matters.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 docs/man/xl.cfg.pod.5    |   14 ++++++++++++++
 tools/libxl/xl_cmdimpl.c |    4 ++++
 2 files changed, 18 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a94d037..b74064d 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -936,6 +936,20 @@ number of vendor defined SMBIOS structures (type 128 - 255). Since SMBIOS
 structures do not present their overall size, each entry in the file must be
 preceded by a 32b integer indicating the size of the next structure.
 
+=item B<generation_id=BOOLEAN>
+
+Provide a VM generation ID to the guest.
+
+The VM generation ID as a 128-bit random number that a guest may use
+to determine if the guest has been restored from an earlier snapshot,
+or cloned.
+
+This is required for Microsoft Windows Server 2012 (and later) domain
+controllers.
+
+See also "Virtual Machine Generation ID" by Microsoft
+(http://www.microsoft.com/en-us/download/details.aspx?id=30707).
+
 =back 
 
 =head3 Guest Virtual Time Controls
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5195914..a611095 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1058,6 +1058,10 @@ static void parse_config_data(const char *config_source,
                                &b_info->u.hvm.smbios_firmware, 0);
         xlu_cfg_replace_string(config, "acpi_firmware",
                                &b_info->u.hvm.acpi_firmware, 0);
+
+        /* Generate and set a new random VM Generation ID? */
+        if (!xlu_cfg_get_long(config, "generation_id", &l, 0))
+            libxl_uuid_generate(&b_info->u.hvm.generation_id);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
-- 
1.7.10.4

  parent reply	other threads:[~2014-06-03 13:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 13:15 [PATCHv3 0/6] tools: rework VM Generation ID David Vrabel
2014-06-03 13:15 ` [PATCH 1/6] docs: update docs for the ~/platform/generation-id key David Vrabel
2014-06-10 10:25   ` Ian Campbell
2014-06-03 13:15 ` [PATCH 2/6] hvm: add HVM_PARAM_VM_GENERATION_ID_ADDR David Vrabel
2014-06-03 13:19   ` Andrew Cooper
2014-06-10 10:27   ` Ian Campbell
2014-06-10 10:40     ` Jan Beulich
2014-06-10 10:44       ` Andrew Cooper
2014-06-10 10:49         ` Jan Beulich
2014-06-03 13:15 ` [PATCH 3/6] hvmloader: add helper functions to get/set HVM params David Vrabel
2014-06-03 19:43   ` Konrad Rzeszutek Wilk
2014-06-10 10:39     ` Ian Campbell
2014-06-03 13:15 ` [PATCH 4/6] libxc, libxl, hvmloader: strip out outdated VM generation ID implementation David Vrabel
2014-06-10 10:42   ` Ian Campbell
2014-06-03 13:15 ` [PATCH 5/6] libxl: allow a generation ID to be specified at domain creation David Vrabel
2014-06-03 13:28   ` Andrew Cooper
2014-06-03 14:14     ` David Vrabel
2014-06-10 11:01   ` Ian Campbell
2014-06-10 12:35     ` David Vrabel
2014-06-10 13:37       ` Ian Campbell
2014-06-10 13:41         ` David Vrabel
2014-06-10 14:18           ` Ian Campbell
2014-06-10 17:59     ` David Vrabel
2014-06-11  8:22       ` Ian Campbell
2014-06-11 10:53         ` David Vrabel
2014-06-11 11:01           ` Ian Campbell
2014-06-11 11:47             ` David Vrabel
2014-06-11 11:53               ` Ian Campbell
2014-06-03 13:15 ` David Vrabel [this message]
2014-06-10 11:02   ` [PATCH 6/6] xl: generate a new random VM generation ID if requested Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2014-05-27 17:31 [PATCHv2 0/6] tools: rework VM Generation ID David Vrabel
2014-05-27 17:31 ` [PATCH 6/6] xl: generate a new random VM generation ID if requested David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401801340-6196-7-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).