[libvirt] [PATCH 4/5] conf: Refactor virDomainDiskDefParseXML to pass vmdef

Ján Tomko jtomko at redhat.com
Tue Jul 21 14:44:24 UTC 2015

On Thu, Jul 16, 2015 at 11:24:33AM -0400, John Ferlan wrote:
> On 07/16/2015 08:03 AM, Ján Tomko wrote:
> > On Mon, Jun 22, 2015 at 05:05:06PM -0400, John Ferlan wrote:
> >> Rather than passing the def->seclabels and def->nseclabels, refactor
> >> the API to pass the entire domain definition.  This will be used in a
> >> future patch as well.
> > 
> > I think it would be nicer to separate XML parsing (which would just
> > record what was in the XML) and auto-generating missing configuration
> > (like generating drive addresses or checking for conflicts).
> > 
> > Jan
> > 
> Are you advocating removing virDomainDiskDefAssignAddress() from
> virDomainDiskDefParseXML() and relying on qemuParseCommandLineDisk() and
> qemuParseCommandLine()?

Nobody should rely on qemuParseCommandLine, it is known to be
unreliable. :)

> Following around all the existing "assumptions" especially as they
> relate to hotplug and even perhaps blockcopy could be an adventure. Not
> to say that I don't disagree with the concept separating parse from
> autofill; however, that seems outside the scope of this particular issue

I meant moving the autofill logic to virDomainDefPostParseInternal
and virDomainDeviceDefPostParseInternal.

The latter is also called by the hotplug code. So the only assumptions
possibly broken would be during parsing of other devices - between disks/hostdev
parsing and calling the PostParse functions.

It seems the only affected function is virDomainDefMaybeAddHostdevSCSIcontroller
which can be moved to virDomainDefAddImplicitControllers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150721/fae6b0e9/attachment-0001.sig>

More information about the libvir-list mailing list