[libvirt] [PATCH v2 02/10] conf: consolidate disk def allocation

Peter Krempa pkrempa at redhat.com
Fri Jun 6 07:43:15 UTC 2014


On 06/06/14 00:52, Eric Blake wrote:
> A future patch wants to create disk definitions with non-zero
> default contents; to avoid crashes, all callers that allocate
> a disk definition should go through a common point.
> 
> I found allocation points by looking for any code that increments
> ndisks, as well as any matches for ALLOC.*disk.  Most places that
> modified ndisks were covered by the parse from XML to domain/device
> definition by initial domain creation or device hotplug; I also
> hand-checked all drivers that generate a device struct on the
> fly during getXMLDesc.
> 
> * src/conf/domain_conf.h (virDomainDiskDefNew): New prototype.
> * src/conf/domain_conf.c (virDomainDiskDefNew): New function.
> (virDomainDiskDefParseXML): Use it.
> * src/parallels/parallels_driver.c (parallelsAddHddInfo):
> Likewise.
> * src/qemu/qemu_command.c (qemuParseCommandLine): Likewise.
> * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc): Likewise.
> * src/vmx/vmx.c (virVMXParseDisk): Likewise.
> * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr):
> Likewise.
> * src/xenxs/xen_xm.c (xenParseXM): Likewise.
> * src/libvirt_private.syms (domain_conf.h): Export it.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  src/conf/domain_conf.c           | 12 +++++++++++-
>  src/conf/domain_conf.h           |  1 +
>  src/libvirt_private.syms         |  1 +
>  src/parallels/parallels_driver.c |  2 +-
>  src/qemu/qemu_command.c          |  4 ++--
>  src/vbox/vbox_tmpl.c             |  6 +++---
>  src/vmx/vmx.c                    |  2 +-
>  src/xenxs/xen_sxpr.c             |  8 ++++----
>  src/xenxs/xen_xm.c               |  4 ++--
>  9 files changed, 26 insertions(+), 14 deletions(-)
> 

ACK,

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140606/27c51138/attachment-0001.sig>


More information about the libvir-list mailing list