mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
hvmloader: Write address of VM generation id buffer into xenstore
Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
This commit is contained in:
1 parent
a9f743f88c
commit
a6aed45cf3
1 file changed
+6
@@ -301,10 +301,16 @@ unsigned long new_vm_gid(void)
|
||||
{
|
||||
uint64_t gid;
|
||||
unsigned char *buf;
|
||||
char addr[11];
|
||||
|
||||
buf = mem_alloc(8, 8);
|
||||
if (!buf) return 0;
|
||||
|
||||
if ( snprintf(addr, sizeof(addr), "0x%lx", virt_to_phys(buf))
|
||||
>= sizeof(addr) )
|
||||
return 0;
|
||||
xenstore_write("data/generation-id", addr);
|
||||
|
||||
gid = strtoll(xenstore_read("platform/generation-id", "0"), NULL, 0);
|
||||
*(uint64_t *)buf = gid;
|
||||
|
||||
|
||||