[libvirt] [PATCH RFC v2 3/5] conf: add caps to virDomainDefFormat*
Joao Martins
joao.m.martins at oracle.com
Thu Feb 4 12:57:30 UTC 2016
On 02/04/2016 11:14 AM, Daniel P. Berrange wrote:
> On Wed, Feb 03, 2016 at 09:40:35PM +0000, Joao Martins wrote:
>> And use the newly added caps->host.netprefix (if it exists) for
>> interface names that match the autogenerated target names.
>>
>> Signed-off-by: Joao Martins <joao.m.martins at oracle.com>
>> ---
>> src/bhyve/bhyve_driver.c | 9 ++++++++-
>> src/conf/domain_conf.c | 28 ++++++++++++++++++----------
>> src/conf/domain_conf.h | 3 +++
>> src/conf/snapshot_conf.c | 2 +-
>> src/esx/esx_driver.c | 5 +++--
>> src/libxl/libxl_domain.c | 2 +-
>> src/libxl/libxl_driver.c | 9 ++++++---
>> src/libxl/libxl_migration.c | 2 +-
>> src/lxc/lxc_driver.c | 4 +++-
>> src/lxc/lxc_process.c | 12 ++++++------
>> src/network/bridge_driver.c | 4 ++--
>> src/openvz/openvz_driver.c | 5 +++--
>> src/phyp/phyp_driver.c | 2 +-
>> src/qemu/qemu_domain.c | 2 +-
>> src/test/test_driver.c | 6 ++++--
>> src/uml/uml_driver.c | 2 +-
>> src/vbox/vbox_common.c | 3 ++-
>> src/vmware/vmware_driver.c | 5 +++--
>> src/vz/vz_driver.c | 3 ++-
>> src/xen/xen_driver.c | 4 ++--
>> src/xenapi/xenapi_driver.c | 5 +++--
>> tests/lxcconf2xmltest.c | 2 +-
>> tests/openvzutilstest.c | 2 +-
>> tests/qemuargv2xmltest.c | 2 +-
>> tests/qemuhotplugtest.c | 3 ++-
>> tests/sexpr2xmltest.c | 2 +-
>> tests/testutils.c | 2 +-
>> tests/vmx2xmltest.c | 3 ++-
>> tests/xlconfigtest.c | 2 +-
>> tests/xmconfigtest.c | 2 +-
>> 30 files changed, 85 insertions(+), 52 deletions(-)
>
> ACK
>
>
>> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
>> index 0141009..6ae2e1b 100644
>> --- a/src/conf/domain_conf.h
>> +++ b/src/conf/domain_conf.h
>> @@ -2733,11 +2733,13 @@ void virDomainIOThreadSchedDelId(virDomainDefPtr def, unsigned int iothread_id);
>> unsigned int virDomainDefFormatConvertXMLFlags(unsigned int flags);
>>
>> char *virDomainDefFormat(virDomainDefPtr def,
>> + virCapsPtr caps,
>> unsigned int flags);
>> char *virDomainObjFormat(virDomainXMLOptionPtr xmlopt,
>> virDomainObjPtr obj,
>> unsigned int flags);
>
> Surprised we don't have caps added to this one too, since it
> will call virDomainDefFormat.
Ah sorry, this one slipped. It would need changing virDomainSaveStatus to
include caps (and propagating that change to qemu, lxc, libxl and bhyve too) so
perhaps in a separate patch?
>
>> int virDomainDefFormatInternal(virDomainDefPtr def,
>> + virCapsPtr caps,
>> unsigned int flags,
>> virBufferPtr buf);
>>
>> @@ -2748,6 +2750,7 @@ int virDomainDiskSourceFormat(virBufferPtr buf,
>>
>> int virDomainNetDefFormat(virBufferPtr buf,
>> virDomainNetDefPtr def,
>> + char *prefix,
>> unsigned int flags);
>>
>> typedef enum {
>> diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
>> index ea511ec..ffa1bf2 100644
>> --- a/src/conf/snapshot_conf.c
>> +++ b/src/conf/snapshot_conf.c
>> @@ -702,7 +702,7 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid,
>> virBufferAddLit(&buf, "</disks>\n");
>> }
>> if (def->dom) {
>> - if (virDomainDefFormatInternal(def->dom, flags, &buf) < 0) {
>> + if (virDomainDefFormatInternal(def->dom, NULL, flags, &buf) < 0) {
>> virBufferFreeAndReset(&buf);
>> return NULL;
>> }
>
> Yeah, we'll need to pass caps in here too eventually.
I could also add it on this series for v3.
>
> ACK regardless
Thanks!
>
> Regards,
> Daniel
>
More information about the libvir-list
mailing list