News for hackers. Stuff that matters.
Re:QEMU v4.0.0 released by antocv on Wednesday April 24, 2019 @07:21AM (#19737277)
> like running the QEMU process as an unprivileged user,

Anyone can run your example "qemu-system-x86_64 -display none -no-user-config -nodefaults -m 2048 -device virtio-scsi-pci,id=scsi -device virtio-serial-pci -serial stdio -drive file=/export/cirros.qcow2,format=qcow2,if=virtio" from the command line/bash, as non-root user, yet libvirt which requires root to install, and is expecting root to configure it, is better? How?

Libvirt is one of those softwares which ads a layer of complexity for the sake of complexity, yet offers nothing of value in return.

Re:QEMU v4.0.0 released by throwaway2048 on Wednesday April 24, 2019 @08:44AM (#19737761)
its not true that libvirt adds nothing of value, it adds easy networking support, easy snapshots, a nice gui interface, a very nice remote protocol and clients (that seamlessly support both graphical and serial output, aswell as on the fly reconfiguration of VMs without restarting them), template VMs (including one time initial provision setup), easy support for storage pools including remote ones, an easy way to manipulate RAM usage on live VMs, easy PCI and USB passthrough, live migration to other hosts, etc etc.

Sure its possible to do all this without libvirt, but it comes as one integrated, easy to manage package instead of hundreds of disparate parts.

You might not need (all) these features, but to claim libvirt is useless is extremely parochial.

Its also untrue that it needs root, you can virt-manager for instance without a root libvirtd instance at all, and it will run VMs without any permissions needed.

Re:QEMU v4.0.0 released by antocv on Wednesday April 24, 2019 @09:08AM (#19737927)
> its not true that libvirt adds nothing of value, it adds easy networking support, easy snapshots, a nice gui interface, a very nice remote protocol and clients (that seamlessly support both graphical and serial output, aswell as on the fly reconfiguration of VMs without restarting them), template VMs (including one time initial provision setup), easy support for storage pools including remote ones, an easy way to manipulate RAM usage on live VMs, easy PCI and USB passthrough, live migration to other hosts, etc etc.

everything libvirt does can be done without it by talking to qemu directly. and yes, Ive done many of the above "by hand", it was easier to read man qemu and other qemu docs than to swallow libvirt.

Re:QEMU v4.0.0 released by throwaway2048 on Wednesday April 24, 2019 @09:16AM (#19737975)
No, not everything it does can be done by qemu directly, plenty of it lies outside of the scope of QEMU entirely, like managing networks (not just network devices), or storage pools, setting up permissions for device redirection, or doing the legwork for VM provisioning and configuration (including net booting and automatically running appropriate scripts), or managing access to VMs both locally and remotely.

Its fine if your use cases are covered by plain QEMU, but libvirt does a hell of a lot more than plain QEMU alone is capable of.

Again all of that is possible via other means, but when other means involve recreating half of libvirt in shell scripts or other code, id rather let somebody else do the work for me.

QEMU is designed to run virtual machines, libvirtd is designed to manage VM server infrastructure.

Re:QEMU v4.0.0 released by fulafel on Wednesday April 24, 2019 @09:36AM (#19738152)
The alternative is not that many commands: https://blog.elastocloud.org/2015/07/qemukvm-bridged-network...
Re:QEMU v4.0.0 released by throwaway2048 on Wednesday April 24, 2019 @09:45AM (#19738222)
For one static network, what about complicated inter VM networking schemes (including firewalling) that need to be dynamically adjusted as VMs go on and offline?

Libvirtd is much better suited to managing that sort of complexity.

Re:QEMU v4.0.0 released by fulafel on Wednesday April 24, 2019 @09:52AM (#19738297)
I have the luxury of opining that such complicated networking schemes should be reined in, and not served with baroque management software. Complexity is the arch enemy of security, because systems must be kept easy to reason about.
Re:QEMU v4.0.0 released by ori_b on Wednesday April 24, 2019 @07:56AM (#19737483)
Indeed. Instead of contributing a patch to qemu with better defaults, or even support for config files, someone wrote tens of thousands of lines of complex code.

People forget that software is malleable. Bend it to your needs, instead of adding fragile wrapper layers.

Re:QEMU v4.0.0 released by LukeShu on Wednesday April 24, 2019 @09:34AM (#19738134)
libvirt-the-software is tens of thousands of lines of complex code that doesn't really add much. libvirt-the-project does contribute patches in to qemu, and a lot of the reason that libvirt-the-software doesn't add much of value is because libvirt-the-project worked to get capabilities in to upstream qemu.

The libvirt team definitely does view qemu as malleable, and bends it to their needs.

The problem is that the libvirt authors contributing to qemu look at qemu as a machine-interface (to be consumed by libvirt), not as a human-interface. Many of the more poorly documented or otherwise difficult-for-humans flags were contributed by the libvirt team. And they're useful! They make it so qemu can do things it couldn't do before. But they're also kinda the reason qemu is difficult to use without libvirt.

Re:QEMU v4.0.0 released by JoshuaRLi on Wednesday April 24, 2019 @09:52AM (#19738299)
Good observations! I can't say I like it when a wrapper (loosely said here) starts to exert too much influence over what it wraps.
Re:QEMU v4.0.0 released by kbenson on Wednesday April 24, 2019 @10:53AM (#19738920)
> Libvirt is one of those softwares which ads a layer of complexity for the sake of complexity, yet offers nothing of value in return.

Isn't that sort of like saying the system startup scripts/subsystem adds complexity for the sake of complexity, and you should just use ifconfig and route manually in some script after startup?

In both cases, that you can fall back to the underlying commands is great. That you should use them instead of the normalized interface provided is debatable.

Re:QEMU v4.0.0 released by jolmg on Wednesday April 24, 2019 @11:16AM (#19739216)
Unless the default changed one of these last few years, I'm pretty sure if you don't use `-enable-kvm` then qemu emulates the selected architecture. That's probably why it doesn't need root.

EDIT: Nevermind, `-enable-kvm` also doesn't need root. I'm not sure what libvirt uses root for.

Re:QEMU v4.0.0 released by uname_a on Wednesday April 24, 2019 @05:11PM (#19742626)
Hear, hear. QEMU is excellent software, and I don't find that libvirt adds any value to its use.

Instead, one of the more annoying things I have ever done was foolishly installing libvirt and having it do all kinds of whackiness to a previously excellent QEMU set-up. I still cannot figure out where it managed to change all QEMU invocations to be VNC-based.