diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-07-13 11:58:01 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2012-07-13 12:01:36 +0200 |
commit | b84e77958ab1413fba8e12c3be12ca381fb5eb88 (patch) | |
tree | 4dac1f6ef12e31847c5ed253db915ca6947842d4 | |
parent | 9f91b436f663502d4d47b068d6b2fd2a3ae31ba1 (diff) |
Mark CDROM device as block-based/file-based early
The type of the libvirt disk config object is needed to generate
proper XML for the 'source' element, so we need to set it as early
as possible.
https://bugzilla.gnome.org/show_bug.cgi?id=679646
-rw-r--r-- | src/installer-media.vala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/installer-media.vala b/src/installer-media.vala index 5128a2a..06738cf 100644 --- a/src/installer-media.vala +++ b/src/installer-media.vala @@ -63,6 +63,12 @@ private class Boxes.InstallerMedia : GLib.Object { public virtual void setup_domain_config (Domain domain) { var disk = new DomainDisk (); + + if (from_image) + disk.set_type (DomainDiskType.FILE); + else + disk.set_type (DomainDiskType.BLOCK); + disk.set_guest_device_type (DomainDiskGuestDeviceType.CDROM); disk.set_driver_name ("qemu"); disk.set_driver_type ("raw"); @@ -71,11 +77,6 @@ private class Boxes.InstallerMedia : GLib.Object { disk.set_target_bus (DomainDiskBus.IDE); disk.set_startup_policy (DomainDiskStartupPolicy.MANDATORY); - if (from_image) - disk.set_type (DomainDiskType.FILE); - else - disk.set_type (DomainDiskType.BLOCK); - domain.add_device (disk); } |