Re: [libvirt-designer 2/3] Accept 'iso' format in gvir_designer_domain_add_disk_full()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 02, 2013 at 11:45:10AM +0200, Christophe Fergeau wrote:
> We need this to be able to mark the device we are creating as a
> CDROM.
> ---
>  examples/virtxml.c                         | 2 +-
>  libvirt-designer/libvirt-designer-domain.c | 8 ++++++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/virtxml.c b/examples/virtxml.c
> index d4a5fe2..9a36142 100644
> --- a/examples/virtxml.c
> +++ b/examples/virtxml.c
> @@ -712,7 +712,7 @@ Domain with Fedora 17 from locally stored ISO and one NIC with mac
>  
>  To add multiple devices just use appropriate argument multiple times:
>  
> -  # virtxml -d /tmp/Fedora-17-x86_64-Live-KDE.iso,raw \
> +  # virtxml -d /tmp/Fedora-17-x86_64-Live-KDE.iso,iso \
>              -d /var/lib/libvirt/images/f17.img,qcow2 \
>              -i default,mac=00:11:22:33:44:55,link=down \
>              -i blue_network \
> diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c
> index 0d47d3c..5da8dd3 100644
> --- a/libvirt-designer/libvirt-designer-domain.c
> +++ b/libvirt-designer/libvirt-designer-domain.c
> @@ -894,6 +894,14 @@ gvir_designer_domain_add_disk_full(GVirDesignerDomain *design,
>      gvir_config_domain_disk_set_type(disk, type);
>      gvir_config_domain_disk_set_source(disk, path);
>      gvir_config_domain_disk_set_driver_name(disk, driver_name);
> +    if (g_strcmp0(format, "iso") == 0) {
> +        /* FIXME: Should probably reorder the disk devices so that floppies
> +         * go first, then disks, then CDROMs
> +         */
> +        gvir_config_domain_disk_set_guest_device_type(disk,
> +                                                      GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_CDROM);
> +        format = "raw";
> +    }

I don't think it is a good idea to overload 'format' for this purpose.
It is perfectly acceptable to back a CDROM device by a qcow2 files.
I think we should just have a gvir_designer_domain_add_cdrom() method
or some other indicator


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]