--- virt-manager-1.4.2.orig/man/virt-install.pod 2017-07-17 08:06:02.000000000 -0500 +++ virt-manager-1.4.2/man/virt-manager.pod 2016-06-17 17:54:21.000000000 -0500 @@ -1,1797 +1,115 @@ -=pod =head1 NAME -virt-install - provision new virtual machines +virt-manager - display the virtual machine desktop management tool =head1 SYNOPSIS -B [OPTION]... +B [OPTIONS] =head1 DESCRIPTION -B is a command line tool for creating new KVM, Xen, or Linux -container guests using the C hypervisor management library. -See the EXAMPLES section at the end of this document to quickly get started. - -B tool supports graphical installations using (for example) -VNC or SPICE, as well as text mode installs over serial console. The guest -can be configured to use one or more virtual disks, network interfaces, -audio devices, physical USB or PCI devices, among others. - -The installation media can be held locally or remotely on NFS, HTTP, FTP -servers. In the latter case C will fetch the minimal files -necessary to kick off the installation process, allowing the guest -to fetch the rest of the OS distribution as needed. PXE booting, and importing -an existing disk image (thus skipping the install phase) are also supported. - -Given suitable command line arguments, C is capable of running -completely unattended, with the guest 'kickstarting' itself too. This allows -for easy automation of guest installs. - -Many arguments have sub options, specified like opt1=foo,opt2=bar, etc. Try ---option=? to see a complete list of sub options associated with that -argument, example: virt-install --disk=? +B is a desktop tool for managing virtual machines. It +provides the ability to control the lifecycle of existing machines +(bootup/shutdown,pause/resume,suspend/restore), provision new virtual +machines and various types of store, manage virtual networks, +access the graphical console of virtual machines, and view performance +statistics, all done locally or remotely. -Most options are not required. Minimum requirements are --name, --memory, -guest storage (--disk or --filesystem), and an install option. +=head1 OPTIONS - -=head1 CONNECTING TO LIBVIRT - -=over 4 - -=item B<--connect> URI - -Connect to a non-default hypervisor. If this isn't specified, libvirt -will try and choose the most suitable default. - -Some valid options here are: - -=over 4 - -=item qemu:///system - -For creating KVM and QEMU guests to be run by the system libvirtd instance. -This is the default mode that virt-manager uses, and what most KVM users -want. - -=item qemu:///session - -For creating KVM and QEMU guests for libvirtd running as the regular user. - -=item xen:/// - -For connecting to Xen. - -=item lxc:/// - -For creating linux containers - -=back - -=back - - - - -=head1 GENERAL OPTIONS - -General configuration parameters that apply to all types of guest installs. - -=over 4 - -=item B<-n> NAME - -=item B<--name> NAME - -Name of the new guest virtual machine instance. This must be unique amongst -all guests known to the hypervisor on the connection, including those not -currently active. To re-define an existing guest, use the C tool -to shut it down ('virsh shutdown') & delete ('virsh undefine') it prior to -running C. - -=item B<--memory> OPTIONS - -Memory to allocate for the guest, in MiB. This deprecates the -r/--ram option. -Sub options are available, like 'maxmemory', 'hugepages', 'hotplugmemorymax' -and 'hotplugmemoryslots'. The memory parameter is mapped to element, -the 'maxmemory' sub-option is mapped to element and 'hotplugmemorymax' -and 'hotplugmemoryslots' are mapped to element. - -To configure memory modules which can be hotunplugged see B<--memdev> description. - -Use --memory=? to see a list of all available sub options. Complete details at L - -=item B<--memorybacking> OPTIONS - -This option will influence how virtual memory pages are backed by host pages. - -Use --memorybacking=? to see a list of all available sub options. Complete details at L - -=item B<--arch> ARCH - -Request a non-native CPU architecture for the guest virtual machine. -If omitted, the host CPU architecture will be used in the guest. - -=item B<--machine> MACHINE - -The machine type to emulate. This will typically not need to be specified -for Xen or KVM, but is useful for choosing machine types of more exotic -architectures. - -=item B<--metadata> OPT=VAL,[...] - -Specify metadata values for the guest. Possible options include name, uuid, title, and description. This option deprecates -u/--uuid and --description. - -Use --metadata=? to see a list of all available sub options. Complete details at L - -=item B<--events> OPT=VAL,[...] - -Specify events values for the guest. Possible options include on_poweroff, on_reboot, and on_crash. - -Use --events=? to see a list of all available sub options. Complete details at L - -=item B<--resource> OPT=VAL,[...] - -Specify resource partitioning for the guest. - -Use --resource=? to see a list of all available sub options. Complete details at L - -=item B<--sysinfo> OPT=VAL,[...] - -Configure sysinfo/SMBIOS values exposed to the guest OS. '--sysinfo host' can be used to expose the host's SMBIOS info to the VM, otherwise values can be manually specified. - -Use --sysinfo=? to see a list of all available sub options. Complete details at L - -=item B<--qemu-commandline> ARGS - -Pass options directly to the qemu emulator. Only works for the libvirt qemu driver. The option can take a string of arguments, for example: - - --qemu-commandline="-display gtk,gl=on" - -Environment variables are specified with 'env', for example: - - --qemu-commandline=env=DISPLAY=:0.1 - -Complete details about the libvirt feature: L - -=item B<--vcpus> OPTIONS - -Number of virtual cpus to configure for the guest. If 'maxvcpus' is specified, -the guest will be able to hotplug up to MAX vcpus while the guest is running, -but will startup with VCPUS. - -CPU topology can additionally be specified with sockets, cores, and threads. -If values are omitted, the rest will be autofilled preferring sockets over -cores over threads. - -'cpuset' sets which physical cpus the guest can use. C is a comma separated list of numbers, which can also be specified in ranges or cpus to exclude. Example: - - 0,2,3,5 : Use processors 0,2,3 and 5 - 1-5,^3,8 : Use processors 1,2,4,5 and 8 - -If the value 'auto' is passed, virt-install attempts to automatically determine -an optimal cpu pinning using NUMA data, if available. - -Use --vcpus=? to see a list of all available sub options. Complete details at L - -=item B<--numatune> OPTIONS - -Tune NUMA policy for the domain process. Example invocations - - --numatune 1,2,3,4-7 - --numatune 1-3,5,mode=preferred - -Specifies the numa nodes to allocate memory from. This has the same syntax -as C<--vcpus cpuset=> option. mode can be one of 'interleave', 'preferred', or -'strict' (the default). See 'man 8 numactl' for information about each -mode. - -Use --numatune=? to see a list of all available sub options. Complete details at L - -=item B<--memtune> OPTIONS - -Tune memory policy for the domain process. Example invocations - - --memtune 1000 - --memtune hard_limit=100,soft_limit=60,swap_hard_limit=150,min_guarantee=80 - -Use --memtune=? to see a list of all available sub options. Complete details at L - -=item B<--blkiotune> OPTIONS - -Tune blkio policy for the domain process. Example invocations - - --blkiotune 100 - --blkiotune weight=100,device_path=/dev/sdc,device_weight=200 - -Use --blkiotune=? to see a list of all available sub options. Complete details at L - -=item B<--cpu> MODEL[,+feature][,-feature][,match=MATCH][,vendor=VENDOR],... - -Configure the CPU model and CPU features exposed to the guest. The only -required value is MODEL, which is a valid CPU model as known to libvirt. - -Libvirt's feature policy values force, require, optional, disable, or forbid, -or with the shorthand '+feature' and '-feature', which equal 'force=feature' -and 'disable=feature' respectively - -Some examples: - -=over 4 - -=item B<--cpu core2duo,+x2apic,disable=vmx> - -Expose the core2duo CPU model, force enable x2apic, but do not expose vmx - -=item B<--cpu host> - -Expose the host CPUs configuration to the guest. This enables the guest to -take advantage of many of the host CPUs features (better performance), but -may cause issues if migrating the guest to a host without an identical CPU. - -=item B<--cpu host-model-only> - -Expose the nearest host CPU model configuration to the guest. -It is the best CPU which can be used for a guest on any of the hosts. - -=item B<--cpu cell0.memory=1234,cell0.cpus=0-3,cell1.memory=5678,cell1.cpus=4-7> - -Example of specifying two NUMA cells. This will generate XML like: - - - - - - - - -=back - -Use --cpu=? to see a list of all available sub options. Complete details at L - -=item B<--security> type=TYPE[,label=LABEL][,relabel=yes|no] - -Configure domain security driver settings. Type can be either 'static' or -'dynamic'. 'static' configuration requires a security LABEL. Specifying -LABEL without TYPE implies static configuration. - -To have libvirt automatically apply your static label, you must specify -relabel=yes. Otherwise disk images must be manually labeled by the admin, -including images that virt-install is asked to create. - -Use --security=? to see a list of all available sub options. Complete details at L - -=item B<--features> FEAT=on|off,... - -Set elements in the guests XML on or off. Examples include acpi, -apic, eoi, privnet, and hyperv features. Some examples: - -=over 4 - -=item B<--features eoi=on> - -Enable APIC PV EOI - -=item B<--features hyperv_vapic=on,hyperv_spinlocks=off> - -Enable hypver VAPIC, but disable spinlocks - -=item B<--features kvm_hidden=on> - -Allow the KVM hypervisor signature to be hidden from the guest - -=item B<--features pvspinlock=on> - -Notify the guest that the host supports paravirtual spinlocks for example by exposing the pvticketlocks mechanism. - -=item B<--features gic_version=2> - -This is relevant only for ARM architectures. Possible values are "host" or -version number. - -=item B<--features smm=on> - -This enables System Management Mode of hypervisor. Some UEFI firmwares may -require this feature to be present. (QEMU supports SMM only with q35 machine -type.) - -=back - -Use --features=? to see a list of all available sub options. Complete details at L - -=item B<--clock> offset=OFFSET,TIMER_OPT=VAL,... - -Configure the guest's XML. Some supported options: - -=over 4 - -=item B<--clock offset=OFFSET> - -Set the clock offset, ex. 'utc' or 'localtime' - -=item B<--clock TIMER_present=no> - -Disable a boolean timer. TIMER here might be hpet, kvmclock, etc. - -=item B<--clock TIMER_tickpolicy=VAL> - -Set a timer's tickpolicy value. TIMER here might be rtc, pit, etc. VAL -might be catchup, delay, etc. Refer to the libvirt docs for all values. - -=back - -Use --clock=? to see a list of all available sub options. Complete details at L - - -=item B<--pm> OPTIONS - -Configure guest power management features. Example suboptions include suspend_to_mem=on|off and suspend_to_disk=on|off - -Use --pm=? to see a list of all available sub options. Complete details at L - - - -=back - -=head1 INSTALLATION OPTIONS - -=over 4 - -=item B<-c> OPTIONS - -=item B<--cdrom> OPTIONS - -File or device used as a virtual CD-ROM device. -It can be path to an ISO image, or to a CDROM device. It can also be a URL -from which to fetch/access a minimal boot ISO image. The URLs take the same -format as described for the C<--location> argument. If a cdrom has been -specified via the C<--disk> option, and neither C<--cdrom> nor any other -install option is specified, the C<--disk> cdrom is used as the install media. - -=item B<-l> LOCATION - -=item B<--location> OPTIONS - -Distribution tree installation source. virt-install can recognize -certain distribution trees and fetches a bootable kernel/initrd pair to -launch the install. - -With libvirt 0.9.4 or later, network URL installs work for remote connections. -virt-install will download kernel/initrd to the local machine, and then -upload the media to the remote host. This option requires the URL to -be accessible by both the local and remote host. - ---location allows things like --extra-args for kernel arguments, and using --initrd-inject. If you want to use those options with CDROM media, you have a few options: - -* Run virt-install as root and do --location ISO - -* Mount the ISO at a local directory, and do --location DIRECTORY - -* Mount the ISO at a local directory, export that directory over local http, and do --location http://localhost/DIRECTORY - -The C can take one of the following forms: - -=over 4 - -=item http://host/path - -An HTTP server location containing an installable distribution image. - -=item ftp://host/path - -An FTP server location containing an installable distribution image. - -=item nfs:host:/path or nfs://host/path - -An NFS server location containing an installable distribution image. This requires running virt-install as root. - -=item DIRECTORY - -Path to a local directory containing an installable distribution image. Note that the directory will not be accessible by the guest after initial boot, so the OS installer will need another way to access the rest of the install media. - -=item ISO - -Mount the ISO and probe the directory. This requires running virt-install as root, and has the same VM access caveat as DIRECTORY. - -=back - -Some distro specific url samples: - -=over 4 - -=item Fedora/Red Hat Based - -http://download.fedoraproject.org/pub/fedora/linux/releases/25/Server/x86_64/os - -=item Debian - -http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/ - -=item Ubuntu - -http://us.archive.ubuntu.com/ubuntu/dists/wily/main/installer-amd64/ - -=item Suse - -http://download.opensuse.org/distribution/11.0/repo/oss/ - -=item Mandriva - -ftp://ftp.uwsg.indiana.edu/linux/mandrake/official/2009.0/i586/ - -=item Mageia - -ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/1 - -=back - -=item B<--pxe> - -Use the PXE boot protocol to load the initial ramdisk and kernel for starting -the guest installation process. - -=item B<--import> - -Skip the OS installation process, and build a guest around an existing -disk image. The device used for booting is the first device specified via -C<--disk> or C<--filesystem>. - -=item B<--livecd> - -Specify that the installation media is a live CD and thus the guest -needs to be configured to boot off the CDROM device permanently. It -may be desirable to also use the C<--disk none> flag in combination. - -=item B<-x> EXTRA - -=item B<--extra-args> OPTIONS - -Additional kernel command line arguments to pass to the installer when -performing a guest install from C<--location>. One common usage is specifying -an anaconda kickstart file for automated installs, such as ---extra-args "ks=http://myserver/my.ks" - -=item B<--initrd-inject> PATH - -Add PATH to the root of the initrd fetched with C<--location>. This can be -used to run an automated install without requiring a network hosted kickstart -file: - ---initrd-inject=/path/to/my.ks --extra-args "ks=file:/my.ks" - -=item B<--os-variant> OS_VARIANT - -Optimize the guest configuration for a specific operating system (ex. -'fedora18', 'rhel7', 'winxp'). While not required, specifying this -options is HIGHLY RECOMMENDED, as it can greatly increase performance -by specifying virtio among other guest tweaks. - -By default, virt-install will attempt to auto detect this value from -the install media (currently only supported for URL installs). Autodetection -can be disabled with the special value 'none'. Autodetection can be -forced with the special value 'auto'. - -Use the command "osinfo-query os" to get the list of the accepted OS -variants. - -=item B<--boot> BOOTOPTS - -Optionally specify the post-install VM boot configuration. This option allows -specifying a boot device order, permanently booting off kernel/initrd with -option kernel arguments, and enabling a BIOS boot menu (requires libvirt -0.8.3 or later) - ---boot can be specified in addition to other install options -(such as --location, --cdrom, etc.) or can be specified on its own. In -the latter case, behavior is similar to the --import install option: there -is no 'install' phase, the guest is just created and launched as specified. - -Some examples: - -=over 4 - -=item B<--boot cdrom,fd,hd,network,menu=on> - -Set the boot device priority as first cdrom, first floppy, first harddisk, -network PXE boot. Additionally enable BIOS boot menu prompt. - -=item B<--boot kernel=KERNEL,initrd=INITRD,kernel_args="console=/dev/ttyS0"> - -Have guest permanently boot off a local kernel/initrd pair, with the -specified kernel options. - -=item B<--boot kernel=KERNEL,initrd=INITRD,dtb=DTB> - -Have guest permanently boot off a local kernel/initrd pair with an -external device tree binary. DTB can be required for some non-x86 -configurations like ARM or PPC - -=item B<--boot loader=BIOSPATH> - -Use BIOSPATH as the virtual machine BIOS. - -=item B<--boot menu=on,useserial=on> - -Enable the bios boot menu, and enable sending bios text output over -serial console. - -=item B<--boot init=INITPATH> - -Path to a binary that the container guest will init. If a root C<--filesystem> -has been specified, virt-install will default to /sbin/init, otherwise -will default to /bin/sh. - -=item B<--boot uefi> - -Configure the VM to boot from UEFI. In order for virt-install to know the -correct UEFI parameters, libvirt needs to be advertising known UEFI binaries -via domcapabilities XML, so this will likely only work if using properly -configured distro packages. - -=item B<--boot loader=/.../OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram_template=/.../OVMF_VARS.fd,loader_secure=no> - -Specify that the virtual machine use the custom OVMF binary as boot firmware, -mapped as a virtual flash chip. In addition, request that libvirt instantiate -the VM-specific UEFI varstore from the custom "/.../OVMF_VARS.fd" varstore -template. This is the recommended UEFI setup, and should be used if ---boot uefi doesn't know about your UEFI binaries. If your UEFI firmware -supports Secure boot feature you can enable it via loader_secure. - -=back - -Use --boot=? to see a list of all available sub options. Complete details at L - -=item B<--idmap> OPTIONS - -If the guest configuration declares a UID or GID mapping, -the 'user' namespace will be enabled to apply these. -A suitably configured UID/GID mapping is a pre-requisite to -make containers secure, in the absence of sVirt confinement. - ---idmap can be specified to enable user namespace for LXC containers - -Example: - --idmap uid_start=0,uid_target=1000,uid_count=10,gid_start=0,gid_target=1000,gid_count=10 - -Use --idmap=? to see a list of all available sub options. Complete details at L - -=back - - - - - -=head1 STORAGE OPTIONS - -=over 4 - -=item B<--disk> OPTIONS - -Specifies media to use as storage for the guest, with various options. The -general format of a disk string is - - --disk opt1=val1,opt2=val2,... - -The simplest invocation to create a new 10G disk image and associated disk device: - - --disk size=10 - -virt-install will generate a path name, and place it in the default image location for the hypervisor. To specify media, the command can either be: - - --disk /some/storage/path[,opt1=val1]... - -or explicitly specify one of the following arguments: - -=over 4 - -=item B - -A path to some storage media to use, existing or not. Existing media can be -a file or block device. - -Specifying a non-existent path implies attempting to create the new storage, -and will require specifying a 'size' value. Even for remote hosts, virt-install -will try to use libvirt storage APIs to automatically create the given path. - -If the hypervisor supports it, B can also be a network URL, like -http://example.com/some-disk.img . For network paths, they hypervisor will -directly access the storage, nothing is downloaded locally. - -=item B - -An existing libvirt storage pool name to create new storage on. Requires -specifying a 'size' value. - -=item B - -An existing libvirt storage volume to use. This is specified as -'poolname/volname'. - -=back - -Other available options: - -=over 4 - -=item B - -Disk device type. Value can be 'cdrom', 'disk', 'lun' or 'floppy'. Default is -'disk'. If a 'cdrom' is specified, and no install method is chosen, the -cdrom is used as the install media. - -=item B - -Guest installation with multiple disks will need this parameter to boot correctly after being installed. A boot_order parameter will take values 1,2,3,... Devices with lower value has higher priority. - -=item B - -Disk bus type. Value can be 'ide', 'sata', 'scsi', 'usb', 'virtio' or 'xen'. -The default is hypervisor dependent since not all hypervisors support all -bus types. - -=item B - -Sets the removable flag (/sys/block/$dev/removable on Linux). Only -used with QEMU and bus=usb. Value can be 'on' or 'off'. - -=item B - -Set drive as readonly (takes 'on' or 'off') - -=item B - -Set drive as shareable (takes 'on' or 'off') - -=item B - -size (in GiB) to use if creating new storage - -=item B - -whether to skip fully allocating newly created storage. Value is 'yes' or -'no'. Default is 'yes' (do not fully allocate) unless it isn't -supported by the underlying storage type. - -The initial time taken to fully-allocate the guest virtual disk (sparse=no) -will be usually balanced by faster install times inside the guest. Thus -use of this option is recommended to ensure consistently high performance -and to avoid I/O errors in the guest should the host filesystem fill up. - -=item B - -Path to a disk to use as the backing store for the newly created image. - -=item B - -Disk image format of B - -=item B - -The cache mode to be used. The host pagecache provides cache memory. -The cache value can be 'none', 'writethrough', 'directsync', 'unsafe' -or 'writeback'. -'writethrough' provides read caching. 'writeback' provides -read and write caching. 'directsync' bypasses the host page -cache. 'unsafe' may cache all content and ignore flush requests from -the guest. - -=item B - -Whether discard (also known as "trim" or "unmap") requests are ignored -or passed to the filesystem. The value can be either "unmap" (allow -the discard request to be passed) or "ignore" (ignore the discard -request). Since 1.0.6 (QEMU and KVM only) - -=item B - -Disk image format. For file volumes, this can be 'raw', 'qcow2', 'vmdk', etc. See format types in L for possible values. This is often mapped to the B value as well. - -If not specified when creating file images, this will default to 'qcow2'. - -If creating storage, this will be the format of the new image. If using an existing image, this overrides libvirt's format auto-detection. - -=item B - -Driver name the hypervisor should use when accessing the specified -storage. Typically does not need to be set by the user. - -=item B - -Driver format/type the hypervisor should use when accessing the specified -storage. Typically does not need to be set by the user. - -=item B - -Disk IO backend. Can be either "threads" or "native". - -=item B - -How guest should react if a write error is encountered. Can be one of -"stop", "ignore", or "enospace" - -=item B - -Serial number of the emulated disk device. This is used in linux guests -to set /dev/disk/by-id symlinks. An example serial number might be: -WD-WMAP9A966149 - -=item B - -It defines what to do with the disk if the source file is not accessible. See -possible values in L - -=back - -See the examples section for some uses. This option deprecates -f/--file, --s/--file-size, --nonsparse, and --nodisks. - -Use --disk=? to see a list of all available sub options. Complete details at L - -=item B<--filesystem> - -Specifies a directory on the host to export to the guest. The most simple -invocation is: - - --filesystem /source/on/host,/target/point/in/guest - -Which will work for recent QEMU and linux guest OS or LXC containers. For -QEMU, the target point is just a mounting hint in sysfs, so will not be -automatically mounted. - -The following explicit options can be specified: - -=over 4 - -=item B - -The type or the source directory. Valid values are 'mount' (the default) or -'template' for OpenVZ templates. - -=item B - -The access mode for the source directory from the guest OS. Only used with -QEMU and type=mount. Valid modes are 'passthrough' (the default), 'mapped', -or 'squash'. See libvirt domain XML documentation for more info. - -=item B - -The directory on the host to share. - -=item B - -The mount location to use in the guest. - -=back - -Use --filesystem=? to see a list of all available sub options. Complete details at L - -=back - - - - - -=head1 NETWORKING OPTIONS - -=over 4 - -=item B<-w> OPTIONS - -=item B<--network> OPTIONS - -Connect the guest to the host network. The value for C can take -one of 4 formats: - -=over 4 - -=item bridge=BRIDGE - -Connect to a bridge device in the host called C. Use this option if -the host has static networking config & the guest requires full outbound -and inbound connectivity to/from the LAN. Also use this if live migration -will be used with this guest. - -=item network=NAME - -Connect to a virtual network in the host called C. Virtual networks -can be listed, created, deleted using the C command line tool. In -an unmodified install of C there is usually a virtual network -with a name of C. Use a virtual network if the host has dynamic -networking (eg NetworkManager), or using wireless. The guest will be -NATed to the LAN by whichever connection is active. - -=item type=direct,source=IFACE[,source_mode=MODE] - -Direct connect to host interface IFACE using macvtap. - -=item user - -Connect to the LAN using SLIRP. Only use this if running a QEMU guest as -an unprivileged user. This provides a very limited form of NAT. - -=item none - -Tell virt-install not to add any default network interface. - -=back - -If this option is omitted a single NIC will be created in the guest. If -there is a bridge device in the host with a physical interface enslaved, -that will be used for connectivity. Failing that, the virtual network -called C will be used. This option can be specified multiple -times to setup more than one NIC. - -Other available options are: - -=over 4 - -=item B - -Network device model as seen by the guest. Value can be any nic model supported -by the hypervisor, e.g.: 'e1000', 'rtl8139', 'virtio', ... - -=item B - -Fixed MAC address for the guest; If this parameter is omitted, or the value -C is specified a suitable address will be randomly generated. For -Xen virtual machines it is required that the first 3 pairs in the MAC address -be the sequence '00:16:3e', while for QEMU or KVM virtual machines it must -be '52:54:00'. - -=item B - -Controlling firewall and network filtering in libvirt. Value can be any nwfilter -defined by the C 'nwfilter' subcommands. Available filters can be listed -by running 'virsh nwfilter-list', e.g.: 'clean-traffic', 'no-mac-spoofing', ... - -=item B - -The type of virtual port profile, one the following values - -=over 4 - -=item C<802.Qbg> - -The following additional parameters are accepted - -=over 4 - -=item B - - -The VSI Manager ID identifies the database containing the VSI type -and instance definitions. This is an integer value and the value -0 is reserved. - -=item B - -The VSI Type ID identifies a VSI type characterizing the network -access. VSI types are typically managed by network administrator. -This is an integer value. - -=item B - -The VSI Type Version allows multiple versions of a VSI Type. This -is an integer value. - -=item B - -The VSI Instance ID Identifier is generated when a VSI instance -(i.e. a virtual interface of a virtual machine) is created. This -is a globally unique identifier. - -=back - -=item C<802.Qbh> - -The following additional parameters are accepted - -=over 4 - -=item B - -The profile ID contains the name of the port profile that is to -be applied to this interface. This name is resolved by the port -profile database into the network parameters from the port profile, -and those network parameters will be applied to this interface. - -=back - -=item C - -The following additional parameters are accepted - -=over 4 - -=item B - -The OpenVSwitch port profile for the interface - -=item B - -A UUID to uniquely identify the interface. If omitted one will -be generated automatically - -=back - -=item C - -The following additional parameters are accepted - -=over 4 - -=item B - -A UUID identifying the port in the network to which the interface -will be bound - -=back - -=back - -=back - -Use --network=? to see a list of all available sub options. Complete details at L - -This option deprecates -m/--mac, -b/--bridge, and --nonetworks - -=back - - - - - -=head1 GRAPHICS OPTIONS - -If no graphics option is specified, C will try to select -the appropriate graphics if the DISPLAY environment variable is set, -otherwise '--graphics none' is used. - -=over 4 - -=item B<--graphics> TYPE,opt1=arg1,opt2=arg2,... - -Specifies the graphical display configuration. This does not configure any -virtual hardware, just how the guest's graphical display can be accessed. -Typically the user does not need to specify this option, virt-install will -try and choose a useful default, and launch a suitable connection. - -General format of a graphical string is - - --graphics TYPE,opt1=arg1,opt2=arg2,... - -For example: - - --graphics vnc,password=foobar - -The supported options are: - -=over 4 - -=item B - -The display type. This is one of: - -vnc - -Setup a virtual console in the guest and export it as a VNC server in -the host. Unless the C parameter is also provided, the VNC -server will run on the first free port number at 5900 or above. The -actual VNC display allocated can be obtained using the C -command to C (or L can be used which handles this -detail for the use). - -spice - -Export the guest's console using the Spice protocol. Spice allows advanced -features like audio and USB device streaming, as well as improved graphical -performance. - -Using spice graphic type will work as if those arguments were given: - - --video qxl --channel spicevmc - -none - -No graphical console will be allocated for the guest. Guests will likely -need to have a text console configured on the first -serial port in the guest (this can be done via the --extra-args option). The -command 'virsh console NAME' can be used to connect to the serial device. - -=item B - -Request a permanent, statically assigned port number for the guest -console. This is used by 'vnc' and 'spice' - -=item B - -Specify the spice tlsport. - -=item B - -Address to listen on for VNC/Spice connections. Default is typically 127.0.0.1 -(localhost only), but some hypervisors allow changing this globally (for -example, the qemu driver default can be changed in /etc/libvirt/qemu.conf). -Use 0.0.0.0 to allow access from other machines. - -Use 'none' to specify that the display server should not listen on any -port. The display server can be accessed only locally through -libvirt unix socket (virt-viewer with --attach for instance). - -Use 'socket' to have the VM listen on a libvirt generated unix socket -path on the host filesystem. - -This is used by 'vnc' and 'spice' - -=item B - -Request that the virtual console be configured to run with a specific -keyboard layout. If the special value 'local' is specified, virt-install -will attempt to configure to use the same keymap as the local system. A value -of 'none' specifically defers to the hypervisor. Default behavior is -hypervisor specific, but typically is the same as 'local'. This is used -by 'vnc' and 'spice'. - -=item B - -Request a console password, required at connection time. Beware, this info may -end up in virt-install log files, so don't use an important password. This -is used by 'vnc' and 'spice' - -=item B - -Whether to use OpenGl accelerated rendering. Value is 'yes' or 'no'. This is -used by 'spice'. - -=item B - -DRM render node path to use. This is used when 'gl' is enabled. - -=back - -Use --graphics=? to see a list of all available sub options. Complete details at L - -This deprecates the following options: --vnc, --vncport, --vnclisten, -k/--keymap, --sdl, --nographics - -=item B<--noautoconsole> - -Don't automatically try to connect to the guest console. The default behaviour -is to launch L to display the graphical console, or to run the -C C command to display the text console. Use of this parameter -will disable this behaviour. - -=back - - - - -=head1 VIRTUALIZATION OPTIONS - -Options to override the default virtualization type choices. - -=over 4 - -=item B<-v> - -=item B<--hvm> - -Request the use of full virtualization, if both para & full virtualization are -available on the host. This parameter may not be available if connecting to a -Xen hypervisor on a machine without hardware virtualization support. This -parameter is implied if connecting to a QEMU based hypervisor. - -=item B<-p> - -=item B<--paravirt> - -This guest should be a paravirtualized guest. If the host supports both -para & full virtualization, and neither this parameter nor the C<--hvm> -are specified, this will be assumed. - -=item B<--container> - -This guest should be a container type guest. This option is only required -if the hypervisor supports other guest types as well (so for example this -option is the default behavior for LXC and OpenVZ, but is provided for -completeness). - -=item B<--virt-type> - -The hypervisor to install on. Example choices are kvm, qemu, or xen. -Available options are listed via 'virsh capabilities' in the tags. - -This deprecates the --accelerate option, which is now the default behavior. To install a plain QEMU guest, use '--virt-type qemu' - -=back - - - - - -=head1 DEVICE OPTIONS - -All devices have a set of B options for configuring the -particulars of the device's address on its parent controller or bus. -See C for details. - -=over 4 - -=item B<--controller> OPTIONS - -Attach a controller device to the guest. TYPE is one of: -B, B, B, B, B, or B. - -Controller also supports the special values B and B to -specify which version of the USB controller should be used (version 2 -or 3). - -=over 4 - -=item B - -Controller model. These may vary according to the hypervisor and its -version. Most commonly used models are e.g. B, B -for the B controller, B or B for the B -controller. For full list and further details on controllers/models, -see C. - -=item B
- -Shorthand for setting a manual PCI address from an lscpi style string. -The preferred method for setting this is using the address.* parameters. - -=item B - -A decimal integer describing in which order the bus controller is -encountered, and to reference the controller bus. - -=item B - -Applicable to USB companion controllers, to define the master bus startport. - -=back - -Examples: - -=over 4 - -=item B<--controller usb,model=ich9-ehci1,address=0:0:4.0,index=0> - -Adds a ICH9 EHCI1 USB controller on PCI address 0:0:4.0 - -=item B<--controller usb,model=ich9-uhci2,address=0:0:4.7,index=0,master=2> - -Adds a ICH9 UHCI2 USB companion controller for the previous master -controller, ports start from port number 2. - -The parameter multifunction='on' will be added automatically to the -proper device (if needed). This applies to all PCI devices. - -=back - -Use --controller=? to see a list of all available sub options. Complete details at L - - -=item B<--input> OPTIONS - -Attach an input device to the guest. Example input device types are mouse, tablet, or keyboard. - -Use --input=? to see a list of all available sub options. Complete details at L - - -=item B<--hostdev> OPTIONS - -=item B<--host-device> OPTIONS - -Attach a physical host device to the guest. Some example values for HOSTDEV: - -=over 4 - -=item B<--hostdev pci_0000_00_1b_0> - -A node device name via libvirt, as shown by 'virsh nodedev-list' - -=item B<--hostdev 001.003> - -USB by bus, device (via lsusb). - -=item B<--hostdev 0x1234:0x5678> - -USB by vendor, product (via lsusb). - -=item B<--hostdev 1f.01.02> - -PCI device (via lspci). - -=back - -Use --hostdev=? to see a list of all available sub options. Complete details at L - -=item B<--sound> MODEL - -Attach a virtual audio device to the guest. MODEL specifies the emulated -sound card model. Possible values are ich6, ich9, ac97, es1370, sb16, pcspk, -or default. 'default' will try to pick the best model that the specified -OS supports. - -This deprecates the old --soundhw option. - -Use --sound=? to see a list of all available sub options. Complete details at L - -=item B<--watchdog> MODEL[,action=ACTION] - -Attach a virtual hardware watchdog device to the guest. This requires a -daemon and device driver in the guest. The watchdog fires a signal when -the virtual machine appears to hung. ACTION specifies what libvirt will do -when the watchdog fires. Values are - -=over 4 - -=item B - -Forcefully reset the guest (the default) - -=item B - -Forcefully power off the guest - -=item B - -Pause the guest - -=item B - -Do nothing - -=item B - -Gracefully shutdown the guest (not recommended, since a hung guest probably -won't respond to a graceful shutdown) - -=back - -MODEL is the emulated device model: either i6300esb (the default) or ib700. -Some examples: - -Use the recommended settings: - ---watchdog default - -Use the i6300esb with the 'poweroff' action - ---watchdog i6300esb,action=poweroff - -Use --watchdog=? to see a list of all available sub options. Complete details at L - -=item B<--parallel> OPTIONS - -=item B<--serial> OPTIONS - -Specifies a serial device to attach to the guest, with various options. The -general format of a serial string is - - --serial type,opt1=val1,opt2=val2,... - ---serial and --parallel devices share all the same options, unless otherwise -noted. Some of the types of character device redirection are: - -=over 4 - -=item B<--serial pty> - -Pseudo TTY. The allocated pty will be listed in the running guests XML -description. - -=item B<--serial dev,path=HOSTPATH> - -Host device. For serial devices, this could be /dev/ttyS0. For parallel -devices, this could be /dev/parport0. - -=item B<--serial file,path=FILENAME> - -Write output to FILENAME. - -=item B<--serial pipe,path=PIPEPATH> - -Named pipe (see pipe(7)) - -=item B<--serial tcp,host=HOST:PORT,mode=MODE,protocol=PROTOCOL> - -TCP net console. MODE is either 'bind' (wait for connections on HOST:PORT) -or 'connect' (send output to HOST:PORT), default is 'bind'. HOST defaults -to '127.0.0.1', but PORT is required. PROTOCOL can be either 'raw' or 'telnet' -(default 'raw'). If 'telnet', the port acts like a telnet server or client. -Some examples: - -Wait for connections on any address, port 4567: - ---serial tcp,host=0.0.0.0:4567 - -Connect to localhost, port 1234: - ---serial tcp,host=:1234,mode=connect - -Wait for telnet connection on localhost, port 2222. The user could then -connect interactively to this console via 'telnet localhost 2222': - ---serial tcp,host=:2222,mode=bind,protocol=telnet - -=item B<--serial udp,host=CONNECT_HOST:PORT,bind_host=BIND_HOST:BIND_PORT> - -UDP net console. HOST:PORT is the destination to send output to (default -HOST is '127.0.0.1', PORT is required). BIND_HOST:BIND_PORT is the optional -local address to bind to (default BIND_HOST is 127.0.0.1, but is only set if -BIND_PORT is specified). Some examples: - -Send output to default syslog port (may need to edit /etc/rsyslog.conf -accordingly): - ---serial udp,host=:514 - -Send output to remote host 192.168.10.20, port 4444 (this output can be -read on the remote host using 'nc -u -l 4444'): - ---serial udp,host=192.168.10.20:4444 - -=item B<--serial unix,path=UNIXPATH,mode=MODE> - -Unix socket, see unix(7). MODE has similar behavior and defaults as ---serial tcp,mode=MODE - -=back - -Use --serial=? or --parallel=? to see a list of all available sub options. Complete details at L and L - -=item B<--channel> - -Specifies a communication channel device to connect the guest and host -machine. This option uses the same options as --serial and --parallel -for specifying the host/source end of the channel. Extra 'target' options -are used to specify how the guest machine sees the channel. - -Some of the types of character device redirection are: - -=over 4 - -=item B<--channel SOURCE,target_type=guestfwd,target_address=HOST:PORT> - -Communication channel using QEMU usermode networking stack. The guest can -connect to the channel using the specified HOST:PORT combination. - -=item B<--channel SOURCE,target_type=virtio[,name=NAME]> - -Communication channel using virtio serial (requires 2.6.34 or later host and -guest). Each instance of a virtio --channel line is exposed in the -guest as /dev/vport0p1, /dev/vport0p2, etc. NAME is optional metadata, and -can be any string, such as org.linux-kvm.virtioport1. -If specified, this will be exposed in the guest at -/sys/class/virtio-ports/vport0p1/NAME - -=item B<--channel spicevmc,target_type=virtio[,name=NAME]> - -Communication channel for QEMU spice agent, using virtio serial -(requires 2.6.34 or later host and guest). NAME is optional metadata, -and can be any string, such as the default com.redhat.spice.0 that -specifies how the guest will see the channel. - -=back - -Use --channel=? to see a list of all available sub options. Complete details at L - -=item B<--console> - -Connect a text console between the guest and host. Certain guest and -hypervisor combinations can automatically set up a getty in the guest, so -an out of the box text login can be provided (target_type=xen for xen -paravirt guests, and possibly target_type=virtio in the future). - -Example: - -=over 4 - -=item B<--console pty,target_type=virtio> - -Connect a virtio console to the guest, redirected to a PTY on the host. -For supported guests, this exposes /dev/hvc0 in the guest. See -http://fedoraproject.org/wiki/Features/VirtioSerial for more info. virtio -console requires libvirt 0.8.3 or later. - -=back - -Use --console=? to see a list of all available sub options. Complete details at L - -=item B<--video> OPTIONS - -Specify what video device model will be attached to the guest. Valid values -for VIDEO are hypervisor specific, but some options for recent kvm are -cirrus, vga, qxl, virtio, or vmvga (vmware). - -Use --video=? to see a list of all available sub options. Complete details at L - -=item B<--smartcard> MODE[,OPTIONS] - -Configure a virtual smartcard device. - -Mode is one of B, B, or B. Additional -options are: - -=over 4 - -=item B - -Character device type to connect to on the host. This is only applicable -for B mode. - -=back - -An example invocation: - -=over 4 - -=item B<--smartcard passthrough,type=spicevmc> - -Use the smartcard channel of a SPICE graphics device to pass smartcard info -to the guest - -=back - -Use --smartcard=? to see a list of all available sub options. Complete details at L - -=item B<--redirdev> BUS[,OPTIONS] - -Add a redirected device. - -=over 4 - -=item B - -The redirection type, currently supported is B or B. - -=item B - -The TCP server connection details, of the form 'server:port'. - -=back - -Examples of invocation: +The following options are accepted when running C: =over 4 -=item B<--redirdev usb,type=tcp,server=localhost:4000> - -Add a USB redirected device provided by the TCP server on 'localhost' -port 4000. - -=item B<--redirdev usb,type=spicevmc> - -Add a USB device redirected via a dedicated Spice channel. - -=back - -Use --redirdev=? to see a list of all available sub options. Complete details at L - -=item B<--memballoon> MODEL - -Attach a virtual memory balloon device to the guest. If the memballoon device -needs to be explicitly disabled, MODEL='none' is used. - -MODEL is the type of memballoon device provided. The value can be 'virtio', -'xen' or 'none'. -Some examples: - -Use the recommended settings: - ---memballoon virtio - -Do not use memballoon device: - ---memballoon none - -Use --memballoon=? to see a list of all available sub options. Complete details at L - -=item B<--tpm> TYPE[,OPTIONS] - -Configure a virtual TPM device. - -Type must be B. Additional options are: - -=over 4 - -=item B - -The device model to present to the guest operating system. Model -must be B. - -=back - -An example invocation: - -=over 4 - -=item B<--tpm passthrough,model=tpm-tis> - -Make the host's TPM accessible to a single guest. - -=item B<--tpm /dev/tpm> - -Convenience option for passing through the hosts TPM. - -=back - -Use --tpm=? to see a list of all available sub options. Complete details at L - -=item B<--rng> TYPE[,OPTIONS] - -Configure a virtual RNG device. - -Type can be B or B. - -If the specified type is B then these values must -be specified: - -=over 4 - -=item B - -The device to use as a source of entropy. - -=back +=item B<-h> -Whereas, when the type is B, these values must be provided: +=item B<--help> -=over 4 +Display command line help summary -=item B +=item B<--version> -Specify the host of the Entropy Gathering Daemon to connect to. +Show virt-manager's version number and exit -=item B +=item B<-c> URI -Specify the port of the Entropy Gathering Daemon to connect to. +=item B<--connect>=URI -=item B +Specify the hypervisor connection C -Specify the type of the connection: B or B. +=item B<--debug> -=item B +List debugging output to the console (normally this is only logged in +~/.cache/virt-manager/virt-manager.log). This function implies --no-fork. -Specify the mode of the connection. It is either 'bind' (wait for -connections on HOST:PORT) or 'connect' (send output to HOST:PORT). +=item B<--no-fork> -=item B +Don't fork C off into the background: run it blocking the +current terminal. Useful for seeing possible errors dumped to stdout/stderr. -Specify the remote host to connect to when the specified backend_type is B -and backend_mode is B. +=item B<--no-conn-autostart> -=item B +Don't autostart any libvirt connections when launching C. -Specify the remote service to connect to when the specified backend_type is -B and backend_mode is B. +=item B<--show-DIALOG-WINDOW> -=back +Display the corresponding C when launching C. This +function implies --no-conn-autostart and the manager window will not be shown +at startup in this case. -An example invocation: +The following C options are currently available: =over 4 -=item B<--rng egd,backend_host=localhost,backend_service=8000,backend_type=tcp> - -Connect to localhost to the TCP port 8000 to get entropy data. +=item B<--show-domain-creator> -=item B<--rng /dev/random> +Display the wizard for creating new virtual machines -Use the /dev/random device to get entropy data, this form implicitly uses the -"random" model. - -Use --rng=? to see a list of all available sub options. Complete details at L - -=back +=item B<--show-domain-editor> NAME|ID|UUID -=item B<--panic> OPTS +Display the dialog for editing properties of the virtual machine with +unique ID matching either the domain name, ID, or UUID -Attach a panic notifier device to the guest. For the recommended settings, use: +=item B<--show-domain-performance> NAME|ID|UUID ---panic default +Display the dialog for monitoring performance of the virtual machine with +unique ID matching either the domain name, ID, or UUID -Use --panic=? to see a list of all available sub options. Complete details at L +=item B<--show-domain-console> NAME|ID|UUID -=item B<--memdev> OPTS +Display the virtual console of the virtual machine with +unique ID matching either the domain name, ID, or UUID -Add a memory module to a guest which can be hotunplugged. To add a memdev you need -to configure hotplugmemory and NUMA for a guest. - -Use --memdev=? to see a list of all available sub options. Complete details at L. +=item B<--show-host-summary> +Display the main window summarizing performance for all virtual machines +on the host. =back -=head1 MISCELLANEOUS OPTIONS - -=over 4 - -=item B<-h> - -=item B<--help> - -Show the help message and exit - -=item B<--version> - -Show program's version number and exit +=item B<--spice-disable-auto-usbredir> -=item B<--autostart> - -Set the autostart flag for a domain. This causes the domain to be started -on host boot up. - -=item B<--transient> - -Use --import or --boot and --transient if you want a transient libvirt -VM. These VMs exist only until the domain is shut down or the host -server is restarted. Libvirt forgets the XML configuration of the VM -after either of these events. Note that the VM's disks will not be -deleted. See: -L - -=item B<--print-xml> [STEP] - -Print the generated XML of the guest, instead of defining it. By default this WILL do storage creation (can be disabled with --dry-run). This option implies --quiet. - -If the VM install has multiple phases, by default this will print all generated XML. If you want to print a particular step, use --print-xml 2 (for the second phase XML). - -=item B<--noreboot> - -Prevent the domain from automatically rebooting after the install has -completed. - -=item B<--wait> WAIT - -Amount of time to wait (in minutes) for a VM to complete its install. -Without this option, virt-install will wait for the console to close (not -necessarily indicating the guest has shutdown), or in the case of ---noautoconsole, simply kick off the install and exit. Any negative -value will make virt-install wait indefinitely, a value of 0 triggers the -same results as noautoconsole. If the time limit is exceeded, virt-install -simply exits, leaving the virtual machine in its current state. - -=item B<--dry-run> - -Proceed through the guest creation process, but do NOT create storage devices, -change host device configuration, or actually teach libvirt about the guest. -virt-install may still fetch install media, since this is required to -properly detect the OS to install. - -=item B<--check> - -Enable or disable some validation checks. Some examples are warning about using a disk that's already assigned to another VM (--check path_in_use=on|off), or warning about potentially running out of space during disk allocation (--check disk_size=on|off). Most checks are performed by default. - -=item B<-q> - -=item B<--quiet> - -Only print fatal error messages. - -=item B<-d> - -=item B<--debug> - -Print debugging information to the terminal when running the install process. -The debugging information is also stored in -C<~/.cache/virt-manager/virt-install.log> even if this parameter is omitted. +Auto USB redirection is supported by default. This option switches off it. =back -=head1 EXAMPLES - -Install a Fedora 20 KVM guest with virtio accelerated disk/network, -creating a new 10GiB qcow2 file, installing from media in the hosts -CDROM drive. This will use Spice graphics by default, and launch autolaunch -a graphical client. - - # virt-install \ - --connect qemu:///system \ - --virt-type kvm \ - --name demo \ - --memory 500 \ - --disk size=10 \ - --cdrom /dev/cdrom \ - --os-variant fedora13 - -Install a Fedora 9 plain QEMU guest, using LVM partition, virtual networking, -booting from PXE, using VNC server/viewer, with virtio-scsi disk - - # virt-install \ - --connect qemu:///system \ - --name demo \ - --memory 500 \ - --disk path=/dev/HostVG/DemoVM,bus=scsi \ - --controller virtio-scsi \ - --network network=default \ - --virt-type qemu \ - --graphics vnc \ - --os-variant fedora9 - -Run a Live CD image under Xen fullyvirt, in diskless environment - - # virt-install \ - --hvm \ - --name demo \ - --memory 500 \ - --disk none \ - --livecd \ - --graphics vnc \ - --cdrom /root/fedora7live.iso - -Run /usr/bin/httpd in a linux container guest (LXC). Resource usage is capped -at 512 MiB of ram and 2 host cpus: - - # virt-install \ - --connect lxc:/// \ - --name httpd_guest \ - --memory 512 \ - --vcpus 2 \ - --init /usr/bin/httpd - -Start a linux container guest(LXC) with a private root filesystem, -using /bin/sh as init. -Container's root will be under host dir /home/LXC. -The host dir "/home/test" will be mounted at -"/mnt" dir inside container: - - # virt-install \ - --connect lxc:/// \ - --name container \ - --memory 128 \ - --filesystem /home/LXC,/ \ - --filesystem /home/test,/mnt \ - --init /bin/sh - -Install a paravirtualized Xen guest, 500 MiB of RAM, a 5 GiB of disk, and -Fedora Core 6 from a web server, in text-only mode, with old style --file -options: - - # virt-install \ - --paravirt \ - --name demo \ - --memory 500 \ - --disk /var/lib/xen/images/demo.img,size=6 \ - --graphics none \ - --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/ - -Create a guest from an existing disk image 'mydisk.img' using defaults for -the rest of the options. - - # virt-install \ - --name demo \ - --memory 512 \ - --disk /home/user/VMs/mydisk.img \ - --import - -Start serial QEMU ARM VM, which requires specifying a manual kernel. - - # virt-install \ - --name armtest \ - --memory 1024 \ - --arch armv7l --machine vexpress-a9 \ - --disk /home/user/VMs/myarmdisk.img \ - --boot kernel=/tmp/my-arm-kernel,initrd=/tmp/my-arm-initrd,dtb=/tmp/my-arm-dtb,kernel_args="console=ttyAMA0 rw root=/dev/mmcblk0p3" \ - --graphics none +Standard GTK options like --g-fatal-warnings are also accepted. =head1 BUGS -Please see http://virt-manager.org/page/BugReporting +Please see L =head1 COPYRIGHT Copyright (C) Red Hat, Inc, and various contributors. -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License C. There -is NO WARRANTY, to the extent permitted by law. +This is free software. You may redistribute copies of it under the terms of the GNU General +Public License C. There is NO WARRANTY, to the extent +permitted by law. =head1 SEE ALSO -C, C, C, the project website C +C, C, the project website C =cut + --- virt-manager-1.4.2.orig/man/virt-xml.pod 2017-07-17 08:06:02.000000000 -0500 +++ virt-manager-1.4.2/man/virt-xml.pod 2017-08-14 22:36:32.652992525 -0500 @@ -290,53 +290,10 @@ # virt-xml winxp --edit --cpu host-model,clearxml=yes --confirm -Change the second sound card to model=ich6 on 'fedora19', but only output the diff: - - # virt-xml fedora19 --edit 2 --sound model=ich6 --print-diff - -Update the every graphics device password to 'foo' of the running VM 'rhel6': - - # virt-xml rhel6 --edit all --graphics password=foo --update - -Remove the disk path from disk device hdc: - - # virt-xml rhel6 --edit target=hdc --disk path= - Change all disk devices of type 'disk' to use cache=none, using XML from stdin, printing the new XML to stdout. # cat | virt-xml --edit device=disk --disk cache=none -Change disk 'hda' IO to native and use startup policy as 'optional'. - - # virt-xml fedora20 --edit target=hda \ - --disk io=native,startup_policy=optional - -Change all host devices to use driver_name=vfio for VM 'fedora20' on the remote connection - - # virt-xml --connect qemu+ssh://remotehost/system \ - fedora20 --edit all --hostdev driver_name=vfio - -Hotplug host USB device 001.003 to running domain 'fedora19': - - # virt-xml fedora19 --update --add-device --hostdev 001.003 - -Add a spicevmc channel to the domain 'winxp', that will be available after the next VM shutdown. - - # virt-xml winxp --add-device --channel spicevmc - -Create a 10G qcow2 disk image and attach it to 'fedora18' for the next VM startup: - - # virt-xml fedora18 --add-device \ - --disk /var/lib/libvirt/images/newimage.qcow2,format=qcow2,size=10 - -Hotunplug the disk vdb from the running domain 'rhel7': - - # virt-xml rhel7 --update --remove-device --disk target=vdb - -Remove all graphics devices from the VM 'rhel7' after the next shutdown: - - # virt-xml rhel7 --remove-device --graphics all - Generate XML for a virtio console device and print it to stdout: # virt-xml --build-xml --console pty,target_type=virtio --- virt-manager-1.4.2.orig/setup.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/setup.py 2017-08-14 22:38:05.058814528 -0500 @@ -338,7 +338,6 @@ self.libvirt_package_names = None self.kvm_package_names = None self.askpass_package_names = None - self.preferred_distros = None self.stable_defaults = None self.default_graphics = None self.default_hvs = None @@ -356,8 +355,6 @@ template += "hv_packages = %s\n" % self.kvm_package_names if self.askpass_package_names is not None: template += "askpass_packages = %s\n" % self.askpass_package_names - if self.preferred_distros is not None: - template += "preferred_distros = %s\n" % self.preferred_distros if self.stable_defaults is not None: template += ("stable_defaults = %s\n" % self.stable_defaults) --- virt-manager-1.4.2.orig/virt-manager.spec 2017-08-08 17:15:54.000000000 -0500 +++ virt-manager-1.4.2/virt-manager.spec 2017-08-14 22:40:06.757018202 -0500 @@ -7,14 +7,8 @@ %global qemu_user "qemu" %global libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network" %global kvm_packages "" -%global preferred_distros "fedora,rhel" %global default_hvs "qemu,xen,lxc" -%if 0%{?rhel} -%global preferred_distros "rhel,fedora" -%global stable_defaults 1 -%endif - # End local config @@ -48,10 +42,6 @@ Requires: gtk-vnc2 Requires: spice-gtk3 -%if 0%{?rhel} == 7 -Requires: gnome-icon-theme -%endif - BuildRequires: intltool BuildRequires: /usr/bin/pod2man @@ -118,10 +108,6 @@ %global _kvm_packages --kvm-package-names=%{kvm_packages} %endif -%if %{preferred_distros} -%global _preferred_distros --preferred-distros=%{preferred_distros} -%endif - %if %{libvirt_packages} %global _libvirt_packages --libvirt-package-names=%{libvirt_packages} %endif @@ -143,7 +129,6 @@ %{?_kvm_packages} \ %{?_libvirt_packages} \ %{?_askpass_package} \ - %{?_preferred_distros} \ %{?_stable_defaults} \ %{?_default_hvs} --- virt-manager-1.4.2.orig/virt-manager.spec.in 2017-07-17 08:06:02.000000000 -0500 +++ virt-manager-1.4.2/virt-manager.spec.in 2017-08-14 22:41:34.683050407 -0500 @@ -7,14 +7,8 @@ %global qemu_user "qemu" %global libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network" %global kvm_packages "" -%global preferred_distros "fedora,rhel" %global default_hvs "qemu,xen,lxc" -%if 0%{?rhel} -%global preferred_distros "rhel,fedora" -%global stable_defaults 1 -%endif - # End local config @@ -48,10 +42,6 @@ Requires: gtk-vnc2 Requires: spice-gtk3 -%if 0%{?rhel} == 7 -Requires: gnome-icon-theme -%endif - BuildRequires: intltool BuildRequires: /usr/bin/pod2man @@ -118,10 +108,6 @@ %global _kvm_packages --kvm-package-names=%{kvm_packages} %endif -%if %{preferred_distros} -%global _preferred_distros --preferred-distros=%{preferred_distros} -%endif - %if %{libvirt_packages} %global _libvirt_packages --libvirt-package-names=%{libvirt_packages} %endif @@ -143,7 +129,6 @@ %{?_kvm_packages} \ %{?_libvirt_packages} \ %{?_askpass_package} \ - %{?_preferred_distros} \ %{?_stable_defaults} \ %{?_default_hvs} --- virt-manager-1.4.2.orig/virtManager/config.py 2017-08-08 07:42:58.000000000 -0500 +++ virt-manager-1.4.2/virtManager/config.py 2017-08-14 22:42:52.471973552 -0500 @@ -170,7 +170,6 @@ self.keyring = None self.default_qemu_user = CLIConfig.default_qemu_user - self.preferred_distros = CLIConfig.preferred_distros self.hv_packages = CLIConfig.hv_packages self.libvirt_packages = CLIConfig.libvirt_packages self.askpass_package = CLIConfig.askpass_package --- virt-manager-1.4.2.orig/virtManager/connection.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtManager/connection.py 2017-08-14 22:44:21.107973719 -0500 @@ -665,8 +665,8 @@ continue if (devtype == "usb_device" and - (("Linux Foundation" in str(xmlobj.vendor_name) or - ("Linux" in str(xmlobj.vendor_name) and + (("Free Software Foundation" in str(xmlobj.vendor_name) or + ("GNU/Linux" in str(xmlobj.vendor_name) and xmlobj.vendor_id == "0x1d6b")) and ("root hub" in str(xmlobj.product_name) or ("host controller" in str(xmlobj.product_name).lower() and --- virt-manager-1.4.2.orig/virtManager/create.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtManager/create.py 2017-08-15 00:10:08.678589639 -0500 @@ -997,9 +997,7 @@ model = widget.get_model() model.clear() - # Kind of a hack, just show linux + windows by default since - # that's all 98% of people care about - supported = {"generic", "linux", "windows"} + supported = {"generic"} # Move 'generic' to the front of the list types = virtinst.OSDB.list_types() @@ -1009,13 +1007,7 @@ # Pretty names for OSes. If a new OS is not found here, # its capitalized name is used. oses = { - "bsd": _("BSD"), "generic": _("Generic"), - "linux": _("Linux"), - "macos": _("macOS"), - "other": _("Others"), - "solaris": _("Solaris"), - "windows": _("Windows"), } # When only the "supported" types are requested, @@ -1046,32 +1038,14 @@ completion_model = self.widget("install-os-version-entry").get_completion().get_model() completion_model.clear() - preferred = self.config.preferred_distros - # All the subgroups for top-level types. Distributions not # belonging to these groups will be shown either in a "Others" # group, or top-level if there are no other groups. - groups = { - "altlinux": _("ALT Linux"), - "centos": _("CentOS"), - "debian": _("Debian"), - "fedora": _("Fedora"), - "freebsd": _("FreeBSD"), - "mageia": _("Mageia"), - "netbsd": _("NetBSD"), - "openbsd": _("OpenBSD"), - "opensuse": _("openSUSE"), - "rhel": _("Red Hat Enterprise Linux"), - "sled": _("SUSE Linux Enterprise Desktop"), - "sles": _("SUSE Linux Enterprise Server"), - "ubuntu": _("Ubuntu"), - } + groups = {} if self._show_all_os_was_selected: # List all the OSes, and determine which OSes have groups, # and which do not. - variants = virtinst.OSDB.list_os(typename=_type, - sortpref=preferred) all_distros = set([_os.distro for _os in variants]) distros = [_os for _os in all_distros if _os in groups] distros.sort() @@ -1099,15 +1073,13 @@ else: # We are showing only the supported systems, so query them, # and add them directly to their type. - variants = virtinst.OSDB.list_os(typename=_type, - sortpref=preferred, only_supported=True) for v in variants: self._add_os_row(model, v.name, v.label) self._add_completion_row(completion_model, v.name, v.label) # Add the menu entries to show all the OSes - self._add_os_row(model, sep=True) - self._add_os_row(model, label=_("Show all OS options"), action=True) + self._add_os_row(model, sep=False) + self._add_os_row(model, label=_("Show all OS options"), action=False) widget.set_active(0) @@ -1224,9 +1196,7 @@ osstr = "" have_os = True - if self._guest.os.is_container(): - osstr = _("Linux") - elif not distro: + if not distro: osstr = _("Generic") have_os = False elif not version: @@ -1328,7 +1298,7 @@ break if not variant: - return (None, None, False, None, None) + return (None, None, True, None, None) if drow: distro = drow[OS_COL_ID] --- virt-manager-1.4.2.orig/virtcli/cliconfig.py 2017-08-08 17:04:11.000000000 -0500 +++ virt-manager-1.4.2/virtcli/cliconfig.py 2017-08-15 01:23:24.289573171 -0500 @@ -79,8 +79,6 @@ self.default_qemu_user = _get_param("default_qemu_user", "root") self.stable_defaults = bool(int(_get_param("stable_defaults", "0"))) - self.preferred_distros = _split_list( - _get_param("preferred_distros", "")) self.hv_packages = _split_list(_get_param("hv_packages", "")) self.askpass_package = _split_list(_get_param("askpass_packages", "")) self.libvirt_packages = _split_list(_get_param("libvirt_packages", "")) --- virt-manager-1.4.2.orig/virtinst/guest.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtinst/guest.py 2017-08-15 01:35:54.605724267 -0500 @@ -708,7 +708,6 @@ return if (self.conn.is_qemu() and - self._os_object.supports_qemu_ga() and self.conn.check_support(self.conn.SUPPORT_CONN_AUTOSOCKET)): dev = VirtualChannelDevice(self.conn) dev.type = "unix" @@ -772,8 +771,7 @@ # But only if we are installing windows which has a multi stage # install. if (dev.is_cdrom() and - getattr(dev, "installer_media", False) and - not self._os_object.is_windows()): + getattr(dev, "installer_media", False)): dev.path = None def _set_defaults(self): @@ -856,10 +854,8 @@ hpet.present = False hv_clock = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK) - hv_clock_rhel = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK_RHEL) - if (self._os_object.is_windows() and self._hyperv_supported() and - (hv_clock or (self.stable_defaults() and hv_clock_rhel))): + if (self._hyperv_supported() and (hv_clock or self.stable_defaults())): hyperv = self.clock.add_timer() hyperv.name = "hypervclock" hyperv.present = True @@ -900,8 +896,6 @@ return self.cpu.set_special_mode(self.x86_cpu_default) - if self._os_object.broken_x2apic(): - self.cpu.add_feature("x2apic", policy="disable") def _hyperv_supported(self): @@ -937,8 +931,7 @@ return default = True - if (self._os_object.need_old_xen_disable_acpi() and - not self.conn.check_support(support.SUPPORT_CONN_CAN_ACPI)): + if (not self.conn.check_support(support.SUPPORT_CONN_CAN_ACPI)): default = False if self.features.acpi == "default": @@ -962,8 +955,7 @@ self.conn.check_support(self.conn.SUPPORT_CONN_VMPORT)): self.features.vmport = False - if (self._os_object.is_windows() and - self._hyperv_supported() and + if (self._hyperv_supported() and self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_VAPIC)): if self.features.hyperv_relaxed is None: self.features.hyperv_relaxed = True @@ -1065,9 +1057,7 @@ return True if (self.os.is_arm_vexpress() and - self.os.dtb and - self._os_object.supports_virtiommio() and - self.conn.check_support(support.SUPPORT_CONN_VIRTIO_MMIO)): + self.os.dtb): return True return False --- virt-manager-1.4.2.orig/virtinst/initrdinject.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtinst/initrdinject.py 2017-08-15 01:38:49.171182454 -0500 @@ -24,61 +24,6 @@ import tempfile -def _rhel4_initrd_inject(initrd, injections): - try: - file_proc = subprocess.Popen(["file", "-z", initrd], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - if "ext2 filesystem" not in file_proc.communicate()[0]: - return False - except Exception: - logging.exception("Failed to file command for rhel4 initrd detection") - return False - - logging.debug("Is RHEL4 initrd") - - # Uncompress the initrd - newinitrd = open(initrd + ".new", "wb") - gzip_proc = subprocess.Popen(["gzip", "-d", "-f", "-c", initrd], - stdout=newinitrd, - stderr=subprocess.PIPE) - gzip_proc.wait() - newinitrd.close() - - debugfserr = "" - for filename in injections: - # We have an ext2 filesystem, use debugfs to inject files - cmd = ["debugfs", "-w", "-R", - "write %s %s" % (filename, os.path.basename(filename)), - newinitrd.name] - logging.debug("Copying %s to the initrd with cmd=%s", filename, cmd) - - debugfs_proc = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - debugfs_proc.wait() - debugfserr += debugfs_proc.stderr.read() or "" - - gziperr = gzip_proc.stderr.read() - if gziperr: - logging.debug("gzip stderr=%s", gziperr) - if debugfserr: - logging.debug("debugfs stderr=%s", debugfserr) - - # Recompress the initrd - gzip_proc = subprocess.Popen(["gzip"], - stdin=open(newinitrd.name, "rb"), - stdout=open(initrd, "wb"), - stderr=subprocess.PIPE) - gzip_proc.wait() - gziperr = gzip_proc.stderr.read() - if gziperr: - logging.debug("gzip stderr=%s", gziperr) - os.unlink(newinitrd.name) - - return True - - def perform_initrd_injections(initrd, injections, scratchdir): """ Insert files into the root directory of the initial ram disk @@ -86,9 +31,6 @@ if not injections: return - if _rhel4_initrd_inject(initrd, injections): - return - tempdir = tempfile.mkdtemp(dir=scratchdir) os.chmod(tempdir, 0o775) --- virt-manager-1.4.2.orig/virtinst/osdict.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtinst/osdict.py 2017-08-15 01:46:42.306504635 -0500 @@ -39,10 +39,6 @@ return int(osobj.name.rsplit(".", 1)[-1]) def _find_latest(prefix): - """ - Given a prefix like 'rhel4', find the latest 'rhel4.X', - and remove the rest from the os list - """ latest_os = None first_id = None for osobj in ret[:]: @@ -61,15 +57,6 @@ if latest_os: ret.insert(first_id, latest_os) - _find_latest("rhel4") - _find_latest("rhel5") - _find_latest("rhel6") - _find_latest("rhel7") - _find_latest("freebsd9") - _find_latest("freebsd10") - _find_latest("freebsd11") - _find_latest("centos6") - _find_latest("centos7") return ret @@ -137,49 +124,7 @@ # This is only for back compatibility with pre-libosinfo support. # This should never change. _aliases = { - "altlinux" : "altlinux1.0", - "debianetch" : "debian4", - "debianlenny" : "debian5", - "debiansqueeze" : "debian6", - "debianwheezy" : "debian7", - "freebsd10" : "freebsd10.0", - "freebsd6" : "freebsd6.0", - "freebsd7" : "freebsd7.0", - "freebsd8" : "freebsd8.0", - "freebsd9" : "freebsd9.0", - "mandriva2009" : "mandriva2009.0", - "mandriva2010" : "mandriva2010.0", - "mbs1" : "mbs1.0", - "msdos" : "msdos6.22", - "openbsd4" : "openbsd4.2", - "opensolaris" : "opensolaris2009.06", - "opensuse11" : "opensuse11.4", - "opensuse12" : "opensuse12.3", - "rhel4" : "rhel4.0", - "rhel5" : "rhel5.0", - "rhel6" : "rhel6.0", - "rhel7" : "rhel7.0", - "ubuntuhardy" : "ubuntu8.04", - "ubuntuintrepid" : "ubuntu8.10", - "ubuntujaunty" : "ubuntu9.04", - "ubuntukarmic" : "ubuntu9.10", - "ubuntulucid" : "ubuntu10.04", - "ubuntumaverick" : "ubuntu10.10", - "ubuntunatty" : "ubuntu11.04", - "ubuntuoneiric" : "ubuntu11.10", - "ubuntuprecise" : "ubuntu12.04", - "ubuntuquantal" : "ubuntu12.10", - "ubunturaring" : "ubuntu13.04", - "ubuntusaucy" : "ubuntu13.10", - "virtio26": "fedora10", - "vista" : "winvista", - "winxp64" : "winxp", - # Old --os-type values - "linux" : "generic", - "windows" : "winxp", - "solaris" : "solaris10", - "unix": "freebsd9.0", "other": "generic", } @@ -235,17 +180,11 @@ return None osname = ret[0].get_short_id() - if osname == "fedora-unknown": - osname = self.latest_fedora_version() - logging.debug("Detected location=%s as os=fedora-unknown. " - "Converting that to the latest fedora OS version=%s", - location, osname) return osname def list_types(self): - approved_types = ["linux", "windows", "bsd", "macos", - "solaris", "other", "generic"] + approved_types = ["generic"] return approved_types def list_os(self, typename=None, only_supported=False, sortpref=None): @@ -268,13 +207,6 @@ return _sort(sortmap, sortpref=sortpref, limit_point_releases=only_supported) - def latest_fedora_version(self): - for osinfo in self.list_os(): - if (osinfo.name.startswith("fedora") and - "unknown" not in osinfo.name): - # First fedora* occurrence should be the newest - return osinfo.name - ##################### # OsVariant classes # @@ -291,7 +223,6 @@ self.distro = self._os and self._os.get_distro() or "" self.sortby = self._get_sortby() - self.urldistro = self._get_urldistro() self._supported = None @@ -366,34 +297,6 @@ return (datetime.datetime.strptime(eol_date, "%Y-%m-%d") > datetime.datetime.now()) - if self.name == "fedora-unknown": - return False - - # As of libosinfo 2.11, many clearly EOL distros don't have an - # EOL date. So assume None == EOL, add some manual work arounds. - # We should fix this in a new libosinfo version, and then drop - # this hack - if self._is_related_to(["fedora24", "rhel7.0", "debian6", - "ubuntu13.04", "win8", "win2k12", "mageia5", "centos7.0"], - check_clones=False, check_derives=False): - return True - return False - - def _get_urldistro(self): - if not self._os: - return None - urldistro = self.distro - remap = { - "opensuse" : "suse", - "sles" : "suse", - "mes" : "mandriva" - } - - if remap.get(urldistro): - return remap[urldistro] - - return urldistro - ############### # Public APIs # @@ -410,43 +313,11 @@ """ if not self._os: return "generic" - - if self._family in ['linux']: - return "linux" - - if self._family in ['win9x', 'winnt', 'win16']: - return "windows" - - if self._family in ['solaris']: - return "solaris" - - if self._family in ['openbsd', 'freebsd', 'netbsd']: - return "bsd" - - if self._family in ['darwin']: - return "macos" - - return "other" - - def is_windows(self): - return self.get_typename() == "windows" - - def need_old_xen_disable_acpi(self): - return self._is_related_to(["winxp", "win2k"], check_upgrades=False) - - def broken_x2apic(self): - # x2apic breaks networking in solaris10 - # https://bugs.launchpad.net/bugs/1395217 - return self.name in ('solaris10', 'solaris11') + return None def get_clock(self): - if self.is_windows() or self._family in ['solaris']: - return "localtime" return "utc" - def supports_virtiommio(self): - return self._is_related_to(["fedora19"]) - def default_netmodel(self): """ Default non-virtio net-model, since we check for that separately @@ -512,9 +383,6 @@ return False - def supports_qemu_ga(self): - return self._is_related_to(["debian8", "fedora18", "rhel6.0", "sles11sp4"]) - def default_videomodel(self, guest): if guest.os.is_pseries(): return "vga" @@ -525,9 +393,6 @@ else: return "qxl" - if self.is_windows(): - return "vga" - return None def get_recommended_resources(self, guest): --- virt-manager-1.4.2.orig/virtinst/urlfetcher.py 2017-08-02 12:57:43.000000000 -0500 +++ virt-manager-1.4.2/virtinst/urlfetcher.py 2017-08-15 01:50:32.319461427 -0500 @@ -382,96 +382,6 @@ return treeinfo -def _distroFromSUSEContent(fetcher, arch, vmtype=None): - # Parse content file for the 'LABEL' field containing the distribution name - # None if no content, GenericDistro if unknown label type. - try: - cbuf = fetcher.acquireFileContent("content") - except ValueError: - return None - - distribution = None - distro_version = None - distro_summary = None - distro_distro = None - distro_arch = None - - lines = cbuf.splitlines()[1:] - for line in lines: - if line.startswith("LABEL "): - distribution = line.split(' ', 1) - elif line.startswith("DISTRO "): - distro_distro = line.rsplit(',', 1) - elif line.startswith("VERSION "): - distro_version = line.split(' ', 1) - if len(distro_version) > 1: - d_version = distro_version[1].split('-', 1) - if len(d_version) > 1: - distro_version[1] = d_version[0] - elif line.startswith("SUMMARY "): - distro_summary = line.split(' ', 1) - elif line.startswith("BASEARCHS "): - distro_arch = line.split(' ', 1) - elif line.startswith("DEFAULTBASE "): - distro_arch = line.split(' ', 1) - elif line.startswith("REPOID "): - distro_arch = line.rsplit('/', 1) - if distribution and distro_version and distro_arch: - break - - if not distribution: - if distro_summary: - distribution = distro_summary - elif distro_distro: - distribution = distro_distro - if distro_arch: - arch = distro_arch[1].strip() - # Fix for 13.2 official oss repo - if arch.find("i586-x86_64") != -1: - arch = "x86_64" - else: - if cbuf.find("x86_64") != -1: - arch = "x86_64" - elif cbuf.find("i586") != -1: - arch = "i586" - elif cbuf.find("s390x") != -1: - arch = "s390x" - - def _parse_sle_distribution(d): - sle_version = d[1].strip().rsplit(' ')[4] - if len(d[1].strip().rsplit(' ')) > 5: - sle_version = sle_version + '.' + d[1].strip().rsplit(' ')[5][2] - return ['VERSION', sle_version] - - dclass = GenericDistro - if distribution: - if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \ - re.match(".*SUSE SLES*", distribution[1]): - dclass = SLESDistro - if distro_version is None: - distro_version = _parse_sle_distribution(distribution) - elif re.match(".*SUSE Linux Enterprise Desktop*", distribution[1]): - dclass = SLEDDistro - if distro_version is None: - distro_version = _parse_sle_distribution(distribution) - elif re.match(".*openSUSE.*", distribution[1]): - dclass = OpensuseDistro - if distro_version is None: - distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]] - - if distro_version is None: - return None - - ob = dclass(fetcher, arch, vmtype) - if dclass != GenericDistro: - ob.version_from_content = distro_version - - # Explictly call this, so we populate os_type/variant info - ob.isValidStore() - - return ob - - def getDistroStore(guest, fetcher): stores = [] logging.debug("Finding distro store for location=%s", fetcher.location) @@ -762,529 +672,6 @@ return self.fetcher.acquireFile(self._valid_iso_path) -class RedHatDistro(Distro): - """ - Base image store for any Red Hat related distros which have - a common layout - """ - uses_treeinfo = True - _version_number = None - - _boot_iso_paths = ["images/boot.iso"] - _hvm_kernel_paths = [("images/pxeboot/vmlinuz", - "images/pxeboot/initrd.img")] - _xen_kernel_paths = [("images/xen/vmlinuz", - "images/xen/initrd.img")] - - def isValidStore(self): - raise NotImplementedError() - - def _get_method_arg(self): - if (self._version_number is not None and - ((self.urldistro == "rhel" and self._version_number >= 7) or - (self.urldistro == "fedora" and self._version_number >= 19))): - return "inst.repo" - return "method" - - -# Fedora distro check -class FedoraDistro(RedHatDistro): - name = "Fedora" - urldistro = "fedora" - - def isValidStore(self): - if not self.treeinfo: - return self.fetcher.hasFile("Fedora") - - if not re.match(".*Fedora.*", self.treeinfo.get("general", "family")): - return False - - ver = self.treeinfo.get("general", "version") - if not ver: - logging.debug("No version found in .treeinfo") - return False - logging.debug("Found treeinfo version=%s", ver) - - latest_variant = OSDB.latest_fedora_version() - if re.match("fedora[0-9]+", latest_variant): - latest_vernum = int(latest_variant[6:]) - else: - logging.debug("Failed to parse version number from latest " - "fedora variant=%s. Using safe default 22", latest_variant) - latest_vernum = 22 - - # rawhide trees changed to use version=Rawhide in Apr 2016 - if ver in ["development", "rawhide", "Rawhide"]: - self._version_number = latest_vernum - self.os_variant = latest_variant - return True - - # Dev versions can be like '23_Alpha' - if "_" in ver: - ver = ver.split("_")[0] - - # Typical versions are like 'fedora-23' - vernum = str(ver).split("-")[0] - if vernum.isdigit(): - vernum = int(vernum) - else: - logging.debug("Failed to parse version number from treeinfo " - "version=%s, using vernum=latest=%s", ver, latest_vernum) - vernum = latest_vernum - - if vernum > latest_vernum: - self.os_variant = latest_variant - else: - self.os_variant = "fedora" + str(vernum) - - self._version_number = vernum - return True - - -# Red Hat Enterprise Linux distro check -class RHELDistro(RedHatDistro): - name = "Red Hat Enterprise Linux" - urldistro = "rhel" - - def isValidStore(self): - if self.treeinfo: - # Matches: - # Red Hat Enterprise Linux - # RHEL Atomic Host - m = re.match(".*(Red Hat Enterprise Linux|RHEL).*", - self.treeinfo.get("general", "family")) - ret = (m is not None) - - if ret: - self._variantFromVersion() - return ret - - if (self.fetcher.hasFile("Server") or - self.fetcher.hasFile("Client")): - self.os_variant = "rhel5" - return True - return self.fetcher.hasFile("RedHat") - - - ################################ - # osdict autodetection helpers # - ################################ - - def _parseTreeinfoVersion(self, verstr): - def _safeint(c): - try: - val = int(c) - except Exception: - val = 0 - return val - - version = _safeint(verstr[0]) - update = 0 - - # RHEL has version=5.4, scientific linux=54 - updinfo = verstr.split(".") - if len(updinfo) > 1: - update = _safeint(updinfo[1]) - elif len(verstr) > 1: - update = _safeint(verstr[1]) - - return version, update - - def _variantFromVersion(self): - ver = self.treeinfo.get("general", "version") - name = None - if self.treeinfo.has_option("general", "name"): - name = self.treeinfo.get("general", "name") - if not ver: - return - - if name and name.startswith("Red Hat Enterprise Linux Server for ARM"): - # Kind of a hack, but good enough for the time being - version = 7 - update = 0 - else: - version, update = self._parseTreeinfoVersion(ver) - - self._version_number = version - self._setRHELVariant(version, update) - - def _setRHELVariant(self, version, update): - base = "rhel" + str(version) - if update < 0: - update = 0 - - ret = None - while update >= 0: - tryvar = base + ".%s" % update - if not self._check_osvariant_valid(tryvar): - update -= 1 - continue - - ret = tryvar - break - - if not ret: - # Try plain rhel5, rhel6, whatev - if self._check_osvariant_valid(base): - ret = base - - if ret: - self.os_variant = ret - - -# CentOS distro check -class CentOSDistro(RHELDistro): - name = "CentOS" - urldistro = "centos" - - def isValidStore(self): - if not self.treeinfo: - return self.fetcher.hasFile("CentOS") - - m = re.match(".*CentOS.*", self.treeinfo.get("general", "family")) - ret = (m is not None) - if ret: - self._variantFromVersion() - if self.os_variant: - new_variant = self.os_variant.replace("rhel", "centos") - if self._check_osvariant_valid(new_variant): - self.os_variant = new_variant - return ret - - -# Scientific Linux distro check -class SLDistro(RHELDistro): - name = "Scientific Linux" - urldistro = None - - _boot_iso_paths = RHELDistro._boot_iso_paths + ["images/SL/boot.iso"] - _hvm_kernel_paths = RHELDistro._hvm_kernel_paths + [ - ("images/SL/pxeboot/vmlinuz", "images/SL/pxeboot/initrd.img")] - - def isValidStore(self): - if self.treeinfo: - m = re.match(".*Scientific.*", - self.treeinfo.get("general", "family")) - ret = (m is not None) - - if ret: - self._variantFromVersion() - return ret - - return self.fetcher.hasFile("SL") - - -class SuseDistro(Distro): - name = "SUSE" - - _boot_iso_paths = ["boot/boot.iso"] - - def __init__(self, *args, **kwargs): - Distro.__init__(self, *args, **kwargs) - if re.match(r'i[4-9]86', self.arch): - self.arch = 'i386' - - oldkern = "linux" - oldinit = "initrd" - if self.arch == "x86_64": - oldkern += "64" - oldinit += "64" - - if self.arch == "s390x": - self._hvm_kernel_paths = [("boot/%s/linux" % self.arch, - "boot/%s/initrd" % self.arch)] - # No Xen on s390x - self._xen_kernel_paths = [] - else: - # Tested with Opensuse >= 10.2, 11, and sles 10 - self._hvm_kernel_paths = [("boot/%s/loader/linux" % self.arch, - "boot/%s/loader/initrd" % self.arch)] - # Tested with Opensuse 10.0 - self._hvm_kernel_paths.append(("boot/loader/%s" % oldkern, - "boot/loader/%s" % oldinit)) - # Tested with SLES 12 for ppc64le - self._hvm_kernel_paths.append(("boot/%s/linux" % self.arch, - "boot/%s/initrd" % self.arch)) - - # Matches Opensuse > 10.2 and sles 10 - self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch, - "boot/%s/initrd-xen" % self.arch)] - - def _variantFromVersion(self): - distro_version = self.version_from_content[1].strip() - version = distro_version.split('.', 1)[0].strip() - self.os_variant = self.urldistro - if int(version) >= 10: - if self.os_variant.startswith(("sles", "sled")): - sp_version = None - if len(distro_version.split('.', 1)) == 2: - sp_version = 'sp' + distro_version.split('.', 1)[1].strip() - self.os_variant += version - if sp_version: - self.os_variant += sp_version - else: - # Tumbleweed 8 digit date - if len(version) == 8: - self.os_variant += "tumbleweed" - else: - self.os_variant += distro_version - else: - self.os_variant += "9" - - def isValidStore(self): - # self.version_from_content is the VERSION line from the contents file - if (not self.version_from_content or - self.version_from_content[1] is None): - return False - - self._variantFromVersion() - - self.os_variant = self._detect_osdict_from_url() - - # Reset kernel name for sle11 source on s390x - if self.arch == "s390x": - if self.os_variant == "sles11" or self.os_variant == "sled11": - self._hvm_kernel_paths = [("boot/%s/vmrdr.ikr" % self.arch, - "boot/%s/initrd" % self.arch)] - - return True - - def _get_method_arg(self): - return "install" - - ################################ - # osdict autodetection helpers # - ################################ - - def _detect_osdict_from_url(self): - root = "opensuse" - oses = [n for n in OSDB.list_os() if n.name.startswith(root)] - - for osobj in oses: - codename = osobj.name[len(root):] - if re.search("/%s/" % codename, self.uri): - return osobj.name - return self.os_variant - - -class SLESDistro(SuseDistro): - urldistro = "sles" - - -class SLEDDistro(SuseDistro): - urldistro = "sled" - - -# Suse image store is harder - we fetch the kernel RPM and a helper -# RPM and then munge bits together to generate a initrd -class OpensuseDistro(SuseDistro): - urldistro = "opensuse" - - -class DebianDistro(Distro): - # ex. http://ftp.egr.msu.edu/debian/dists/sarge/main/installer-i386/ - # daily builds: http://d-i.debian.org/daily-images/amd64/ - name = "Debian" - urldistro = "debian" - - def __init__(self, *args, **kwargs): - Distro.__init__(self, *args, **kwargs) - - self._treeArch = self._find_treearch() - self._url_prefix = 'current/images' - self._installer_dirname = self.name.lower() + "-installer" - self._set_media_paths() - - def _find_treearch(self): - for pattern in ["^.*/installer-(\w+)/?$", - "^.*/daily-images/(\w+)/?$"]: - arch = re.findall(pattern, self.uri) - if not arch: - continue - logging.debug("Found pattern=%s treearch=%s in uri", - pattern, arch[0]) - return arch[0] - - # Check for standard 'i386' and 'amd64' which will be - # in the URI name for --location $ISO mounts - for arch in ["i386", "amd64", "x86_64"]: - if arch in self.uri: - logging.debug("Found treearch=%s in uri", arch) - if arch == "x86_64": - arch = "amd64" - return arch - - # Otherwise default to i386 - arch = "i386" - logging.debug("No treearch found in uri, defaulting to arch=%s", arch) - return arch - - def _set_media_paths(self): - self._boot_iso_paths = ["%s/netboot/mini.iso" % self._url_prefix] - - hvmroot = "%s/netboot/%s/%s/" % (self._url_prefix, - self._installer_dirname, - self._treeArch) - initrd_basename = "initrd.gz" - kernel_basename = "linux" - if self._treeArch in ["ppc64el"]: - kernel_basename = "vmlinux" - self._hvm_kernel_paths = [ - (hvmroot + kernel_basename, hvmroot + initrd_basename)] - - xenroot = "%s/netboot/xen/" % self._url_prefix - self._xen_kernel_paths = [(xenroot + "vmlinuz", xenroot + "initrd.gz")] - - def isValidStore(self): - if self.fetcher.hasFile("%s/MANIFEST" % self._url_prefix): - # For regular trees - pass - elif self.fetcher.hasFile("daily/MANIFEST"): - # For daily trees - self._url_prefix = "daily" - self._set_media_paths() - else: - return False - - filename = "%s/MANIFEST" % self._url_prefix - regex = ".*%s.*" % self._installer_dirname - if not self._fetchAndMatchRegex(filename, regex): - logging.debug("Regex didn't match, not a %s distro", self.name) - return False - - self.os_variant = self._detect_debian_osdict_from_url() - return True - - - ################################ - # osdict autodetection helpers # - ################################ - - def _detect_debian_osdict_from_url(self): - root = self.name.lower() - oses = [n for n in OSDB.list_os() if n.name.startswith(root)] - - if self._url_prefix == "daily": - logging.debug("Appears to be debian 'daily' URL, using latest " - "debian OS") - return oses[0].name - - for osobj in oses: - if osobj.codename: - # Ubuntu codenames look like 'Warty Warthog' - codename = osobj.codename.split()[0].lower() - else: - if " " not in osobj.label: - continue - # Debian labels look like 'Debian Sarge' - codename = osobj.label.split()[1].lower() - - if ("/%s/" % codename) in self.uri: - logging.debug("Found codename=%s in the URL string", codename) - return osobj.name - - logging.debug("Didn't find any known codename in the URL string") - return self.os_variant - - -class UbuntuDistro(DebianDistro): - # http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/ - name = "Ubuntu" - urldistro = "ubuntu" - - def isValidStore(self): - if self.fetcher.hasFile("%s/MANIFEST" % self._url_prefix): - # For regular trees - filename = "%s/MANIFEST" % self._url_prefix - regex = ".*%s.*" % self._installer_dirname - elif self.fetcher.hasFile("install/netboot/version.info"): - # For trees based on ISO's - self._url_prefix = "install" - self._set_media_paths() - filename = "%s/netboot/version.info" % self._url_prefix - regex = "%s*" % self.name - elif self.fetcher.hasFile(".disk/info") and self.arch == "s390x": - self._hvm_kernel_paths += [("boot/kernel.ubuntu", "boot/initrd.ubuntu")] - self._xen_kernel_paths += [("boot/kernel.ubuntu", "boot/initrd.ubuntu")] - filename = ".disk/info" - regex = "%s*" % self.name - else: - return False - - if not self._fetchAndMatchRegex(filename, regex): - logging.debug("Regex didn't match, not a %s distro", self.name) - return False - - self.os_variant = self._detect_debian_osdict_from_url() - return True - - -class MandrivaDistro(Distro): - # ftp://ftp.uwsg.indiana.edu/linux/mandrake/official/2007.1/x86_64/ - name = "Mandriva/Mageia" - urldistro = "mandriva" - - _boot_iso_paths = ["install/images/boot.iso"] - _xen_kernel_paths = [] - - def __init__(self, *args, **kwargs): - Distro.__init__(self, *args, **kwargs) - self._hvm_kernel_paths = [] - - # At least Mageia 5 uses arch in the names - self._hvm_kernel_paths += [ - ("isolinux/%s/vmlinuz" % self.arch, - "isolinux/%s/all.rdz" % self.arch)] - - # Kernels for HVM: valid for releases 2007.1, 2008.*, 2009.0 - self._hvm_kernel_paths += [ - ("isolinux/alt0/vmlinuz", "isolinux/alt0/all.rdz")] - - - def isValidStore(self): - # Don't support any paravirt installs - if self.type is not None and self.type != "hvm": - return False - - # Mandriva websites / media appear to have a VERSION - # file in top level which we can use as our 'magic' - # check for validity - if not self.fetcher.hasFile("VERSION"): - return False - - for name in ["Mandriva", "Mageia"]: - if self._fetchAndMatchRegex("VERSION", ".*%s.*" % name): - return True - - logging.debug("Regex didn't match, not a %s distro", self.name) - return False - - -class ALTLinuxDistro(Distro): - # altlinux doesn't have installable URLs, so this is just for a - # mounted ISO - name = "ALT Linux" - urldistro = "altlinux" - - _boot_iso_paths = [("altinst", "live")] - _hvm_kernel_paths = [("syslinux/alt0/vmlinuz", "syslinux/alt0/full.cz")] - _xen_kernel_paths = [] - - def isValidStore(self): - # Don't support any paravirt installs - if self.type is not None and self.type != "hvm": - return False - - if not self.fetcher.hasFile(".disk/info"): - return False - - if self._fetchAndMatchRegex(".disk/info", ".*%s.*" % self.name): - return True - - logging.debug("Regex didn't match, not a %s distro", self.name) - return False - - # Build list of all *Distro classes def _build_distro_list(): allstores = []