On Fri, Sep 11, 2015 at 03:55:03PM +0200, Matthias Bolte wrote:
2015-09-07 22:04 GMT+02:00 Richard W.M. Jones
<rjones(a)redhat.com>:
> On Mon, Sep 07, 2015 at 02:29:22PM +0200, Matthias Bolte wrote:
>> I think the datacenter path could be exposed
>> as part of the domain XML as
>> <vmware:datacenterpath>/path/to/dc</vmware:datacenterpath> similar
to
>> the way <qemu:commandline> works. But it would be ignored on parsing.
>>
>> Would that work for you? If yes, I can propose a patch that does this.
>
> Absolutely this would be brilliant.
Okay, here's patch that does this. It's only tested using the test
suite, as I don't have an ESX setup at hand at the moment. Do you have
the possibility to test this properly?
--
Matthias Bolte
http://photron.blogspot.com
From 489e2d5dd29dd4b11716897ca52b14f6666ec141 Mon Sep 17 00:00:00
2001
From: Matthias Bolte <matthias.bolte(a)googlemail.com>
Date: Fri, 11 Sep 2015 12:00:47 +0200
Subject: [PATCH] vmx: Expose datacenter path in domain XML
Tool such as libguestfs need the datacenter path to get access to disk
images. The ESX driver knows the correct datacenter path, but this
information cannot be accessed using libvirt API yet. Also, it cannot
be deduced from the connection URI in a robust way.
Expose the datacenter path in the domain XML as <vmware:datacenterpath>
node similar to the way the <qemu:commandline> node works. The new node
is ignored while parsing the domain XML. In contrast to <qemu:commandline>
it is output only.
---
src/esx/esx_driver.c | 4 ++
src/vmware/vmware_conf.c | 3 ++
src/vmware/vmware_driver.c | 9 ++++
src/vmx/vmx.c | 68 +++++++++++++++++++++++-----
src/vmx/vmx.h | 10 ++--
tests/vmx2xmldata/vmx2xml-datacenterpath.vmx | 2 +
tests/vmx2xmldata/vmx2xml-datacenterpath.xml | 19 ++++++++
tests/vmx2xmltest.c | 5 ++
tests/xml2vmxdata/xml2vmx-datacenterpath.vmx | 10 ++++
tests/xml2vmxdata/xml2vmx-datacenterpath.xml | 9 ++++
tests/xml2vmxtest.c | 3 ++
11 files changed, 126 insertions(+), 16 deletions(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-datacenterpath.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-datacenterpath.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-datacenterpath.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-datacenterpath.xml
ACK, I think this is acceptable given the current requirements
of libguestfs
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|