mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Disable xen platform PCI device when xen_platform_pci=0 is specified
- Change guest firmware to use new fixed byte port 0x10.
- Add "xen_platform_pci" option into guest config file and APIs.
xen_platform_pci=0: Disable xen platform device.
xen_platform_pci=1: Enable xen platform device. (default)
- Add "disable_pf" entry into xenstore.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
This commit is contained in:
1 parent
84b150afdb
commit
0456ddb432
8 files changed
+28
-36
No files matched your search
@@ -170,6 +170,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
||||
'xen_extended_power_mgmt': int,
|
||||
'pci_msitranslate': int,
|
||||
'pci_power_mgmt': int,
|
||||
'xen_platform_pci': int,
|
||||
}
|
||||
|
||||
# Xen API console 'other_config' keys.
|
||||
@@ -464,6 +465,8 @@ class XendConfig(dict):
|
||||
self['platform']['rtc_timeoffset'] = 0
|
||||
if 'hpet' not in self['platform']:
|
||||
self['platform']['hpet'] = 0
|
||||
if 'xen_platform_pci' not in self['platform']:
|
||||
self['platform']['xen_platform_pci'] = 1
|
||||
if 'vpt_align' not in self['platform']:
|
||||
self['platform']['vpt_align'] = 1
|
||||
if 'loader' not in self['platform']:
|
||||
|
||||
@@ -716,6 +716,7 @@ class HVMImageHandler(ImageHandler):
|
||||
if 'hvm' not in info['xen_caps']:
|
||||
raise HVMRequired()
|
||||
|
||||
xen_platform_pci = int(vmConfig['platform'].get('xen_platform_pci',1))
|
||||
rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')
|
||||
|
||||
if not self.display :
|
||||
@@ -724,13 +725,23 @@ class HVMImageHandler(ImageHandler):
|
||||
("image/device-model", self.device_model),
|
||||
("image/display", self.display))
|
||||
self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )
|
||||
|
||||
if xen_platform_pci == 0:
|
||||
disable_pf = 1
|
||||
log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
|
||||
else:
|
||||
disable_pf = 0
|
||||
log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())
|
||||
|
||||
xstransact.Store("/local/domain/0/device-model/%i"%self.vm.getDomid(),
|
||||
('disable_pf', disable_pf))
|
||||
self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
|
||||
self.vm.permissionsVm("rtc/timeoffset", { 'dom': self.vm.getDomid(), 'read': True } )
|
||||
|
||||
self.apic = int(vmConfig['platform'].get('apic', 0))
|
||||
self.acpi = int(vmConfig['platform'].get('acpi', 0))
|
||||
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
|
||||
|
||||
|
||||
|
||||
# Return a list of cmd line args to the device models based on the
|
||||
# xm config file
|
||||
|
||||
@@ -611,6 +611,10 @@ gopts.var('pci_power_mgmt', val='POWERMGMT',
|
||||
fn=set_int, default=0,
|
||||
use="""Global PCI Power Management flag (0=disable;1=enable).""")
|
||||
|
||||
gopts.var('xen_platform_pci', val='0|1',
|
||||
fn=set_int, default=1,
|
||||
use="Is xen_platform_pci used?")
|
||||
|
||||
def err(msg):
|
||||
"""Print an error to stderr and exit.
|
||||
"""
|
||||
@@ -924,7 +928,7 @@ def configure_hvm(config_image, vals):
|
||||
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
|
||||
'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
|
||||
'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
|
||||
'vpt_align', 'pci_power_mgmt' ]
|
||||
'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
|
||||
|
||||
for a in args:
|
||||
if a in vals.__dict__ and vals.__dict__[a] is not None:
|
||||
|
||||
@@ -1048,6 +1048,7 @@ class sxp2xml:
|
||||
'hap',
|
||||
'pci_msitranslate',
|
||||
'pci_power_mgmt',
|
||||
'xen_platform_pci',
|
||||
]
|
||||
|
||||
platform_configs = []
|
||||
|
||||