Bug 1212021 - RHELSA: handle virt-rhelsaX.Y machine types
Summary: RHELSA: handle virt-rhelsaX.Y machine types
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1212027
TreeView+ depends on / blocked
 
Reported: 2015-04-15 12:21 UTC by Andrew Jones
Modified: 2018-10-13 14:48 UTC (History)
6 users (show)

Fixed In Version: virt-manager-1.2.0-1-el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-13 14:48:38 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Andrew Jones 2015-04-15 12:21:53 UTC
virt-manager allows Machine Type to be selected under Architecture options. The default type is 'virt', but qemu-kvm-rhev.aarch64 presents virt-rhelsa7.1 as well. When installing a RHELSA7.1 guest, the virt-rhelsa7.1 type is the more logical to select, but it doesn't currently work. The problem is while 'virt' is special-cased in virt-manager since

commit 42ac7a3036f02296e883fc6129672e228cea8f7a
Author: Cole Robinson <crobinso>
Date:   Tue Sep 23 16:16:35 2014 -0400

    guest: Set optimal arm CPU defaults

to use host cpu passthrough (currently required for kvmarm), no other machine type is. Now, 'virt' is an alias for 'virt-rhelsa7.1' in qemu-kvm-rhev.aarch64

# /usr/libexec/qemu-kvm -M \?
Supported machines are:
virt                 RHELSA 7.1 ARM Virtual Machine (alias of virt-rhelsa7.1)
virt-rhelsa7.1       RHELSA 7.1 ARM Virtual Machine (default)
none                 empty machine

so perhaps virt-manager could "expand aliases" in order to enable is_arm_machvirt() to work with derivatives?

Comment 1 Giuseppe Scrivano 2015-04-15 13:43:14 UTC
should we expand the definition to something like the following?

diff --git a/virtinst/osxml.py b/virtinst/osxml.py
index 77643dd..576676c 100644
--- a/virtinst/osxml.py
+++ b/virtinst/osxml.py
@@ -64,7 +64,7 @@ class OSXML(XMLBuilder):
     def is_arm_vexpress(self):
         return self.is_arm() and str(self.machine).startswith("vexpress-")
     def is_arm_machvirt(self):
-        return self.is_arm() and self.machine == "virt"
+        return self.is_arm() and "virt" in self.machine

Comment 2 Giuseppe Scrivano 2015-04-21 14:10:28 UTC
as I have no access to any ARM machine, Andrew, could you please check if that change is enough?

Comment 3 Andrew Jones 2015-04-21 16:11:55 UTC
(In reply to Giuseppe Scrivano from comment #2)
> as I have no access to any ARM machine, Andrew, could you please check if
> that change is enough?

That should work, and we can commit to using "virt-" as the prefix for all our machine types. Actually, considering it will always be a prefix, to be a bit more precise, maybe it should be

str(self.machine).startswith("virt")

It might still be nice to write an "alias expansion" function that could be used though, as that would guarantee we have a match, and also give the freedom to match when we don't have common prefixes. That could be future work though.

Comment 4 Giuseppe Scrivano 2015-04-22 17:09:43 UTC
I tested it and it works as with the "virt" machine type.

Patch pushed upstream:

commit 1c2211817992c801246dd5019b085a61e8968daa
Author: Giuseppe Scrivano <gscrivan>
Date:   Wed Apr 22 18:39:43 2015 +0200

    aarch64: support virt-rhelsa7.1 machine type
    
    Just check for the prefix of the machine type, as it is done for ARM
    vexpress.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1212021
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>

Comment 8 Pavel Hrdina 2015-10-30 08:35:55 UTC
Tested with package virt-manager-1.2.1-8.el7.noarch, during installation there is a possibility to choose between 'virt' and 'virt-rhelsa7.1' machine type and the created XML is also correct according to the selection.

This bug is fixed and verified, the machine type is correctly parsed from qemu and offered to user in virt-manager.

Comment 9 tingting zheng 2015-10-30 15:04:13 UTC
Refer to comment 8,move this bug to VERIFIED,thanks Pavel.


Note You need to log in before you can comment on or make changes to this bug.