Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 88eb039

Browse files
committed
Add --os-type/variant options to virt-image.
1 parent e4f159c commit 88eb039

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

man/en/virt-convert.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Avoid verbose output.
7676
Optimize the guest configuration for a type of operating system (ex. 'linux',
7777
'windows'). This will attempt to pick the most suitable ACPI & APIC settings,
7878
optimally supported mouse drivers, virtio, and generally accommodate other
79-
operating system quirks.
79+
operating system quirks. See L<virt-install(1)> for valid values.
8080

8181
=item --os-variant=OS_VARIANT
8282

man/en/virt-image.pod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ C</image/devices/vcpu> in the XML descriptor.
5858

5959
Check that vcpus do not exceed physical CPUs and warn if they do.
6060

61+
=item --os-type=OS_TYPE
62+
63+
Optimize the guest configuration for a type of operating system (ex. 'linux',
64+
'windows'). This will attempt to pick the most suitable ACPI & APIC settings,
65+
optimally supported mouse drivers, virtio, and generally accommodate other
66+
operating system quirks. See L<virt-install(1)> for valid values.
67+
68+
=item --os-variant=OS_VARIANT
69+
70+
Further optimize the guest configuration for a specific operating system
71+
variant (ex. 'fedora8', 'winxp'). This parameter is optional, and does not
72+
require an C<--os-type> to be specified. See L<virt-install(1)> for valid
73+
values.
74+
6175
=item -m MAC, --mac=MAC
6276

6377
Fixed MAC address for the guest. See L<virt-install(1)> for details

virt-image

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ def parse_args():
106106
geng.add_option("", "--cpuset", type="string", dest="cpuset",
107107
action="callback", callback=cli.check_before_store,
108108
help=_("Set which physical CPUs Domain can use."))
109+
geng.add_option("", "--os-type", type="string", dest="distro_type",
110+
action="callback", callback=cli.check_before_store,
111+
help=_("The OS type being installed, e.g. "
112+
"'linux', 'unix', 'windows'"))
113+
geng.add_option("", "--os-variant", type="string", dest="distro_variant",
114+
action="callback", callback=cli.check_before_store,
115+
help=_("The OS variant being installed, "
116+
"e.g. 'fedora6', 'rhel5', 'solaris10', 'win2k'"))
109117
parser.add_option_group(geng)
110118

111119
fulg = OptionGroup(parser, _("Full Virtualization specific options."))
@@ -169,6 +177,7 @@ def parse_args():
169177
parser.add_option_group(misc)
170178

171179
(options,args) = parser.parse_args()
180+
172181
if len(args) < 1:
173182
parser.error(_("You need to provide an image XML descriptor"))
174183
options.image = args[0]
@@ -220,6 +229,11 @@ def main():
220229
get_graphics(image.domain, options.vnc, options.vncport,
221230
options.nographics, options.sdl, options.keymap, guest)
222231

232+
if options.distro_type:
233+
guest.set_os_type(options.distro_type)
234+
if options.distro_variant:
235+
guest.set_os_variant(options.distro_variant)
236+
223237
if installer.is_hvm():
224238
if options.noacpi:
225239
guest.features["acpi"] = False

0 commit comments

Comments
 (0)