Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Libvirt uses proper XML parser so that's almost certainly a non-issue. The problem with libvirt XML files is that they are snapshots, and that they lack obvious defaults.

What I mean with "snapshots" is that you can't edit an XML file for a running VM on disk, but instead have to go through either virt-manager or virsh dump/load function. If you do edit an existing XML file on disk, it will just overwrite it for you.

And XML format is a bit more verbose simply because XML schema writers make it so. SGML could be even nicer for human writers.

As for comments in JSON, many parsers are not strict and would let you insert arbitrary elements, so you might add {"comment":"whatevah"} where you need it.

An example of terse XML would be:

<vm name="postgres">

  <ram size="8gb"/>

  <disk size="1tb"/>
</vm>

or

<vm>

  <name>postgred</name>

  <ram>8gb</ram>

  <disk>1tb</disk>
</vm>

compared to JSON:

{

  "name": "postgres",

  "ram": "8gb",

  "disk":"1tb" 
}

They are not equally descriptive, but that's because you do not need a top-level element in JSON (you could have it).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: