[Libguestfs] [PATCH 5/6] v2v: -o libvirt: Add virtio-rng, balloon and pvpanic to output XML (RHBZ#1438794).

Daniel P. Berrange berrange at redhat.com
Wed Apr 5 13:46:17 UTC 2017


On Wed, Apr 05, 2017 at 02:43:11PM +0100, Richard W.M. Jones wrote:
> When outputting libvirt XML, create virtio-rng, a memory balloon
> device, and a pvpanic device, if the guest supports it.
> ---
>  v2v/create_libvirt_xml.ml | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml
> index fc7196595..58f720ac3 100644
> --- a/v2v/create_libvirt_xml.ml
> +++ b/v2v/create_libvirt_xml.ml
> @@ -338,6 +338,25 @@ let create_libvirt_xml ?pool source target_buses guestcaps
>           [] in
>    append devices sound;
>  
> +  (* Miscellaneous KVM devices. *)
> +  if guestcaps.gcaps_virtio_rng then
> +    push_back devices (
> +      e "rng" ["model", "virtio"] [
> +        (* XXX Using /dev/urandom requires libvirt >= 1.3.4.  Libvirt
> +         * was broken before that.
> +         *)
> +        e "backend" ["model", "random"] [PCData "/dev/urandom"]
> +      ]
> +    );
> +  if guestcaps.gcaps_virtio_balloon then
> +    push_back devices (e "memballoon" ["model", "virtio"] []);

For (unpleasant) historical reasons you'll always get a virtio balloon
device added by libvirt. If you don't want balloon enabled you have to
explicitly give model=none

> +  if guestcaps.gcaps_isa_pvpanic then
> +    push_back devices (
> +      e "panic" ["model", "isa"] [
> +        e "address" ["type", "isa"; "iobase", "0x505"] []
> +      ]
> +    );
> +
>    (* Standard devices added to every guest. *)
>    append devices [
>      e "input" ["type", "tablet"; "bus", "usb"] [];

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the Libguestfs mailing list