[RFC] get guest OS infos

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

 



Different OSes have different capabilities and behaviors sometimes. We have to distinguish them then. 

For example, our clients want to send NMI interrupts to certain guests(eg.Linux distributions), but not others(eg.Windows guests).
They want to acquire the list below:
  guest1: RHEL 7
  guest2: RHEL 7
  guest3: Ubuntu 12
  guest4: Ubuntu 13
  guest5: Windows 7
  ......

AFAIK, neither libvirt nor openstack, nor qemu, have such capbility of showing these guest OS infos.
Libvirt now supports to show host capabilities and driver capability, but not an individual guest OS's capibility. We may refer to 
http://libvirt.org/formatdomaincaps.html for more information.

So, what's your opinion on adding such feature in libvirt and qemu? 

-----------------------------------------------------------------------
The solution I can see is:
1 add a new qga command in qemu agent, 'guest-get-osinfo', which gets the os infos by qemu-agent inside the guest.
  { 'command': 'guest-get-osinfo',
  'returns': ['GuestOSInfo'] }

  { 'struct': 'GuestOSInfo',
    'data': {'distribution': 'GuestOSDistribution',
             'version': 'int',
             'arch': 'GuestOSArchType'} }
  an example Json result:
  {"return":
    {"distribution": "RHEL",
     "version": "7",
     "arch": "x86_64"
    }
  }

2 add new helper APIs for that qga command in libvirt.
  qemuAgentGetOSInfo()
3 When the guest starts up and its qemu-agent is running, call qemuAgentGetOSINfo() in libvirt.
4 set the osinfo, which is got at step 3, into the guest's status and config file.
  <domainCapabilities>
    <path>/usr/bin/qemu-system-x86_64</path>
    <domain>kvm</domain>
    <machine>pc-i440fx-2.1</machine>
    <arch>x86_64</arch>
    <distribution>
      <type>RHEL</type>
      <version>7</version>
    </distribution>
    
  ...
 </domainCapabilities>

  This feature is added into the xml node 'domainCapabilities' here. If there's any other better choice, please let me know.
  



-- 
Oscar    
oscar.zhangbo@xxxxxxxxxx  

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




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