On Fri, Apr 17, 2009 at 11:37:57AM +0100, Daniel P. Berrange wrote: > On Thu, Apr 16, 2009 at 05:29:52PM +0200, Daniel Veillard wrote: > > On Thu, Apr 16, 2009 at 01:57:06PM +0100, Daniel P. Berrange wrote: > > > On Thu, Apr 16, 2009 at 02:42:08PM +0200, Daniel Veillard wrote: > > > > > > Well its not part of any libvirt API, and I don't want to require a > > > libvirt connection in order to use it. We've got alot of other virt-XXX > > > commands so I think its nicer to keep it separate. > > > > Right, I tend to think of virsh a bit too much as the generic toolbox > > maybe it should not end up like xmllint ;-) > > > > > > Hum, that doesn't really work in the general case, you can have > > > > plenty of stuff on the two first lines like the xml declaration > > > > or comments, or stylesheet PI ... > > > > > > I figured no one ever uses that stuff ;-P > > > > It's true that we don't preserve and save back comments so ... > > > > > > Instead I would use the streaming debug output to get the > > > > information whithout guess from the parser itself: > > > > > > > > xmllint --stream --debug $XMLFILE 2>/dev/null | grep "^0 1 " | awk > > > > '{ print $3 }' > > > > > > > > the root top level element will show up as 0 1 foo ... and there should > > > > be only one per document :-) > > > > > > Will change it to do that instead. > > > > It's just a tad bit nicer IMHO, > > Ok, here's the updated patch I'll apply shortly. Committed along with a fix to the Makefile.am for EXTRA_DIST and adding it to the RPM specfile. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list