While I respect the job that libvirt does (it works — high praise for software), it’s unfortunate that it is also the answer to the question “how can I represent all these virtualized things using XML?”, which was in fashion when libvirt was created. It’s also a bit misleading to characterize cloud providers as building on libvirt. Libvirt is useful as an mostly hypervisor-agnostic wrapper, which is super useful for…
Libvirt – The Unsung Hero of Cloud Computing (2013)
61–70 of 113 posts
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#62Earlier quoted context omitted.
JSON is a bad configuration format simply for the fact that it doesn't support comments. Some parsers do but most don't. XML for all its verbosity and complexity at least has comments where I can quickly try out configuration changes without needing to save the old configuration somewhere else. Hell, even INI files had support for comments and were just as expressional as JSON. I wonder why we regressed in that regar…
This is exactly why TOML [0] is gaining traction as a simple configuration file format. Rust's cargo has been TOML from day one (`Cargo.toml`) and Python is moving this way with (`pyproject.toml`). For more general data structures, remember that JSON is a true subset of YAML [1]: Switch to a YAML parser and you can start optionally adding comments to your files while still being compatible with legacy input. [0] http…
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#63I really doubt that AWS is using libvirt. They almost certainly have their own abstraction. But still, I agree that libvirt is great; I wrote about it here: http://catern.com/posts/libvirt.html
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#64* Shameless plug: https://github.com/OnitiFR/mulch
We're using libvirt-go binding (Daniel Berrangé and his team is doing a excellent job maintaining it!), and KVM/QEMU hypervisior. For a small team like us, it's incredibly valuable to have access to such powerful tools in a such easy way.
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#65Earlier quoted context omitted.
For those working in dynamic languages (JavaScript, Python, Perl, Ruby, etc.) JSON maps directly onto built-in language data types and structures making it trivial to work with. With XML you usually end up needing custom code to convert to and from the parsed XML representation and the language's built-in data types and structures. This is less of a concern for statically typed languages where you usually have to mar…
It's trivial until you run into a date-field. I've connected some JSON based exchanges to each other and just created an XML intermediary format to have a single canonical model and do the various translations to/from the other systems from there.
ISO 8601, as used by XML Schema:
2020-09-04T00:00:00Z
or
Unix date output format (not sure this has an actual name)
Fri 04 Sep 2020 00:00:00 GMT
or
some sort of destructured date
2020 09 04
or
some sort of destructured date with 0 based months because Java
2020 08 04
Your app still needs to know what is coming in, and convert that to its internal format.
Even if you want to get everyone to agree on XML Schema's datetime format, it's not always sufficient because sometimes you need the actual time zone (e.g. America/New_York ) rather than the UTC offset especially when dealing with recurring/far off events.
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#66While I respect the job that libvirt does (it works — high praise for software), it’s unfortunate that it is also the answer to the question “how can I represent all these virtualized things using XML?”, which was in fashion when libvirt was created. It’s also a bit misleading to characterize cloud providers as building on libvirt. Libvirt is useful as an mostly hypervisor-agnostic wrapper, which is super useful for…
Haha yeah JSON is a terrible config format. As another poster mentioned, no comments. But the other big problem is inconsistent serialization. Null vs missing props, conversion of "true" to true. I've lost track of the number of times I've had to workaround differences in the serializer vs deserializer on other end. It's really quite bad format for how ubiquitous it's become.
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#67Earlier quoted context omitted.
Haha yeah JSON is a terrible config format. As another poster mentioned, no comments. But the other big problem is inconsistent serialization. Null vs missing props, conversion of "true" to true. I've lost track of the number of times I've had to workaround differences in the serializer vs deserializer on other end. It's really quite bad format for how ubiquitous it's become.
Ugh, please name and shame the [de]serializer that was silently converting a string to a boolean.
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#68Earlier quoted context omitted.
What's wrong with XML?
Im sure there are better answers here but my main issue is that attributes and child elements offer duplicate functionality. You could have 4 5 or you could have . There is often no consistency within a single spec over how this should be done let alone between different specs. JSON feels much more logical to me as well as being a whole lot simpler. If only it supported comments.
Of course if someone else is producing the data then they can make a mess of things but I don't think that is specific to XML.
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#69While I respect the job that libvirt does (it works — high praise for software), it’s unfortunate that it is also the answer to the question “how can I represent all these virtualized things using XML?”, which was in fashion when libvirt was created. It’s also a bit misleading to characterize cloud providers as building on libvirt. Libvirt is useful as an mostly hypervisor-agnostic wrapper, which is super useful for…
What's wrong with XML?
Re: Libvirt – The Unsung Hero of Cloud Computing (2013)
#70So the domain itself is a virtual machine? What makes it different from other guest virtual machinse?