ia64/xen-unstable

changeset 15181:c702d9a2781f

Merge with xen-ia64-unstable.hg
author kfraser@localhost.localdomain
date Tue May 22 06:43:05 2007 +0100 (2007-05-22)
parents ac28ee0ee098 b9da101ed945
children 98cf6c05c32a
files
line diff
     1.1 --- a/.hgtags	Wed May 16 11:38:48 2007 -0600
     1.2 +++ b/.hgtags	Tue May 22 06:43:05 2007 +0100
     1.3 @@ -17,3 +17,4 @@ af0573e9e5258db0a9d28aa954dd302ddd2c2d23
     1.4  d0d3fef37685be264a7f52201f8ef44c030daad3 3.0.2-branched
     1.5  6ed4368b4a9e1924c983774c4b1a2b6baf8e98a6 3.0.3-branched
     1.6  057f7c4dbed1c75a3fbe446d346cee04cff31497 3.0.4-branched
     1.7 +d2ef85c6bf84cc619ca2d42c2edfc6229e70a6ad 3.1.0-branched
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c	Wed May 16 11:38:48 2007 -0600
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c	Tue May 22 06:43:05 2007 +0100
     2.3 @@ -161,7 +161,9 @@ int xentap_sysfs_addif(struct xenbus_dev
     2.4  
     2.5  void xentap_sysfs_delif(struct xenbus_device *dev)
     2.6  {
     2.7 +	struct backend_info *be = dev->dev.driver_data;
     2.8  	sysfs_remove_group(&dev->dev.kobj, &tapstat_group);
     2.9 +	be->group_added = 0;
    2.10  }
    2.11  
    2.12  static int blktap_remove(struct xenbus_device *dev)
    2.13 @@ -212,11 +214,13 @@ static void tap_update_blkif_status(blki
    2.14  		return;
    2.15  	}
    2.16  
    2.17 -	err = xentap_sysfs_addif(blkif->be->dev);
    2.18 -	if (err) {
    2.19 -		xenbus_dev_fatal(blkif->be->dev, err, 
    2.20 -				 "creating sysfs entries");
    2.21 -		return;
    2.22 +	if (!blkif->be->group_added) {
    2.23 +		err = xentap_sysfs_addif(blkif->be->dev);
    2.24 +		if (err) {
    2.25 +			xenbus_dev_fatal(blkif->be->dev, err, 
    2.26 +					 "creating sysfs entries");
    2.27 +			return;
    2.28 +		}
    2.29  	}
    2.30  
    2.31  	blkif->xenblkd = kthread_run(tap_blkif_schedule, blkif, name);
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Wed May 16 11:38:48 2007 -0600
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Tue May 22 06:43:05 2007 +0100
     3.3 @@ -11,11 +11,11 @@
     3.4  extern void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, 
     3.5  					 struct kimage *image);
     3.6  
     3.7 -int xen_max_nr_phys_cpus;
     3.8 -struct resource xen_hypervisor_res;
     3.9 -struct resource *xen_phys_cpus;
    3.10 +static int __initdata xen_max_nr_phys_cpus;
    3.11 +static struct resource xen_hypervisor_res;
    3.12 +static struct resource *xen_phys_cpus;
    3.13  
    3.14 -void xen_machine_kexec_setup_resources(void)
    3.15 +void __init xen_machine_kexec_setup_resources(void)
    3.16  {
    3.17  	xen_kexec_range_t range;
    3.18  	struct resource *res;
    3.19 @@ -104,7 +104,7 @@ void xen_machine_kexec_setup_resources(v
    3.20  	return;
    3.21  }
    3.22  
    3.23 -void xen_machine_kexec_register_resources(struct resource *res)
    3.24 +void __init xen_machine_kexec_register_resources(struct resource *res)
    3.25  {
    3.26  	int k;
    3.27  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/examples/xeninfo.pl	Tue May 22 06:43:05 2007 +0100
     4.3 @@ -0,0 +1,284 @@
     4.4 +#!/usr/bin/perl -w
     4.5 +
     4.6 +#############################################################################################################
     4.7 +#                                                                                                           #
     4.8 +#  Developed by Ingard Mev├ąg @ Oslo University College, spring 2007                                         #
     4.9 +#  ingard [at] mevaag  [dot] no                                                                             #
    4.10 +#                                                                                                           #
    4.11 +#  This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.      #
    4.12 +#  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter #
    4.13 +#  to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.                #
    4.14 +#                                                                                                           #
    4.15 +#############################################################################################################
    4.16 +
    4.17 +use strict;
    4.18 +# http://search.cpan.org/~rjray/RPC-XML-0.59/lib/RPC/XML/Client.pm
    4.19 +require RPC::XML;
    4.20 +require RPC::XML::Client;
    4.21 +
    4.22 +# for debug purposes
    4.23 +#use Data::Dumper;
    4.24 +
    4.25 +##### CONFIG ######
    4.26 +
    4.27 +my %xenhosts = ("192.168.0.10" => {"port" => "9363"}, 
    4.28 +					 "192.168.0.11" => {"port" => "9363"}, 
    4.29 +					 "192.168.0.12" => {"port" => "9363"}, 
    4.30 +					 "192.168.0.13" => {"port" => "9363"});
    4.31 +
    4.32 +##### CONFIG END ###
    4.33 +
    4.34 +##### STATIC VARS #####
    4.35 +my %host_info;
    4.36 +
    4.37 +#######################
    4.38 +sub apiconnect
    4.39 +{
    4.40 +	foreach my $xenhost (keys %xenhosts)
    4.41 +	{
    4.42 +		my $xen = RPC::XML::Client->new("http://$xenhost:$xenhosts{$xenhost}{'port'}");
    4.43 +		my $session = $xen->simple_request("session.login_with_password", "user","");
    4.44 +		if (! $session)
    4.45 +		{
    4.46 +			print "Can't connect to $xenhost :(\n";
    4.47 +			$xenhosts{$xenhost} = {'xen' => $xen, 'session' => ""};
    4.48 +		}
    4.49 +		else
    4.50 +		{
    4.51 +			$xenhosts{$xenhost} = {'xen' => $xen, 'session' => $session->{'Value'}};
    4.52 +			print "Connected successfully to $xenhost..\n";
    4.53 +		}
    4.54 +	}
    4.55 +}
    4.56 +
    4.57 +sub validate_response
    4.58 +{
    4.59 +	my ($result_ref) = @_;
    4.60 +	if ($result_ref->{'Status'} eq "Success")
    4.61 +	{
    4.62 +		return $result_ref->{'Value'};
    4.63 +	}
    4.64 +	else
    4.65 +	{
    4.66 +		# status = Failure !
    4.67 +#		die ("xmlrpc failed! ErrorDescription: $result_ref->{'ErrorDescription'}[1] -> $result_ref->{'ErrorDescription'}[0]");
    4.68 +		print "xmlrpc failed! ErrorDescription: $result_ref->{'ErrorDescription'}[1] -> $result_ref->{'ErrorDescription'}[0]\n";
    4.69 +	}
    4.70 +}
    4.71 +
    4.72 +sub get_host_cpu_utilisation
    4.73 +{
    4.74 +	my ($xen, $session, $host_name, $host_ref) = @_;
    4.75 +	my $host_cpu_ref = validate_response($xen->simple_request("host.get_host_CPUs", $session, $host_ref));
    4.76 +	foreach (@$host_cpu_ref)
    4.77 +	{
    4.78 +		my $host_cpu_utilisation = validate_response($xen->simple_request("host_cpu.get_utilisation", $session, $_));
    4.79 +		$host_info{$host_name}{'cpus'}{$_} = $host_cpu_utilisation;
    4.80 +		print "     CPUiNFO: $host_cpu_utilisation\n";
    4.81 +	}
    4.82 +}
    4.83 +
    4.84 +sub get_host_pif_utilisation
    4.85 +{
    4.86 +	my ($xen, $session, $host_name, $host_ref) = @_;
    4.87 +
    4.88 +# This method isnt implemented yet it seems so using PIF.get_all for now.. 
    4.89 +# This will break when xen is made cluster aware..
    4.90 +#	my $host_pif_ref = validate_response($xen->simple_request("host.get_PIFs", $session, $host_ref)); 
    4.91 +	my $host_pif_ref = validate_response($xen->simple_request("PIF.get_all", $session));
    4.92 +	foreach (@$host_pif_ref)
    4.93 +	{
    4.94 +		my $host_pif_device = validate_response($xen->simple_request("PIF.get_device", $session, $_));
    4.95 +		my $host_pif_metrics_ref = validate_response($xen->simple_request("PIF.get_metrics", $session, $_));
    4.96 +
    4.97 +# Whats the best solution performancewise?
    4.98 +# Collecting stats from get_records, or pulling individually?
    4.99 +
   4.100 +#		my $host_pif_record = validate_response($xen->simple_request("PIF_metrics.get_record", $session, $host_pif_metrics_ref));
   4.101 +#		my $host_pif_io_read = $host_pif_record->{'io_read_kbs'};
   4.102 +#		my $host_pif_io_write = $host_pif_record->{'io_write_kbs'};
   4.103 +		my $host_pif_io_read = validate_response($xen->simple_request("PIF_metrics.get_io_read_kbs", $session, $host_pif_metrics_ref));
   4.104 +		my $host_pif_io_write = validate_response($xen->simple_request("PIF_metrics.get_io_write_kbs", $session, $host_pif_metrics_ref));
   4.105 +
   4.106 +		$host_info{$host_name}{'pifs'}{$host_pif_device} = {'read' => $host_pif_io_read, 'write' => $host_pif_io_write};
   4.107 +		print "     PiFiNFO: $host_pif_device READ: $host_pif_io_read - WRITE: $host_pif_io_write\n";
   4.108 +#		$host_info{$host_name}{'pifs'}{$host_pif_device}{'read'} = $host_pif_io_read;
   4.109 +#		$host_info{$host_name}{'pifs'}{$host_pif_device}{'write'} = $host_pif_io_write;
   4.110 +	}
   4.111 +}
   4.112 +
   4.113 +sub get_host_mem_utilisation
   4.114 +{
   4.115 +	my ($xen, $session, $host_name, $host_ref) = @_;
   4.116 +	my $host_metrics_ref = validate_response($xen->simple_request("host.get_metrics", $session, $host_ref)); 
   4.117 +	my $host_mem_total =  validate_response($xen->simple_request("host_metrics.get_memory_total", $session, $host_metrics_ref)) / 1024 / 1024;
   4.118 +	my $host_mem_free =  validate_response($xen->simple_request("host_metrics.get_memory_free", $session, $host_metrics_ref)) / 1024 / 1024;
   4.119 +	$host_info{$host_name}{'memory'} = {'total' => $host_mem_total, 'free' => $host_mem_free};
   4.120 +	print "     MEMiNFO: Total: $host_mem_total MB - Free: $host_mem_free MB\n";
   4.121 +}
   4.122 +
   4.123 +sub get_vm_mem_info
   4.124 +{
   4.125 +	my ($xen, $session, $host_name, $vm_ref, $vm_name_label) = @_;
   4.126 +	my $vm_mem_stat_max = validate_response($xen->simple_request("VM.get_memory_static_max",$session,$vm_ref));
   4.127 +	my $vm_mem_stat_min = validate_response($xen->simple_request("VM.get_memory_static_min",$session,$vm_ref));
   4.128 +	my $vm_mem_dyn_max = validate_response($xen->simple_request("VM.get_memory_dynamic_max",$session,$vm_ref));
   4.129 +	my $vm_mem_dyn_min = validate_response($xen->simple_request("VM.get_memory_dynamic_min",$session,$vm_ref));
   4.130 +
   4.131 +	# not implemented yet.. We'll do this at the same time as getting cpu utilisation
   4.132 +	# in the get_vm_metrics sub instead..
   4.133 +	#my $vm_metrics_ref = validate_response($xen->simple_request("VM.get_metrics",$session,$vm_ref));
   4.134 +	#my $vm_mem_actual = validate_response($xen->simple_request("VM_metrics.get_memory_actual",$session,$vm_metrics_ref));
   4.135 +
   4.136 +	$host_info{$host_name}{'vms'}{$vm_name_label}{'memory'} = {'static_max' => $vm_mem_stat_max,
   4.137 +								  'static_min' => $vm_mem_stat_min,
   4.138 +								  'dynamic_max' => $vm_mem_dyn_max,
   4.139 +								  'dynamic_min' => $vm_mem_dyn_min};
   4.140 +
   4.141 +	# xm list uses the dynamic min var as far as i can tell.. or?
   4.142 +	# Lets print the memactual info instead of this... I'll do that in the get_vm_metrics sub instead..
   4.143 +	# print "  |- MEMiNFO: Dynamic Min: $vm_mem_dyn_min - Actually in use: $vm_mem_actual\n";
   4.144 +}
   4.145 +
   4.146 +sub get_vm_metrics
   4.147 +{
   4.148 +	my ($xen, $session, $host_name, $vm_ref, $vm_name_label) = @_;
   4.149 +	my $vm_metrics_ref = validate_response($xen->simple_request("VM.get_metrics",$session,$vm_ref));
   4.150 +	
   4.151 +	my %vm_vcpu_utilisation = %{validate_response($xen->simple_request("VM_metrics.get_vcpus_utilisation",$session,$vm_metrics_ref))};
   4.152 +	for my $tempcpu (keys %vm_vcpu_utilisation)
   4.153 +	{
   4.154 +		print "  |- CPUiNFO: $tempcpu - $vm_vcpu_utilisation{$tempcpu}\n";
   4.155 +		$host_info{$host_name}{'vms'}{$vm_name_label}{'vcpus'} = {$tempcpu => $vm_vcpu_utilisation{$tempcpu}};
   4.156 +	}
   4.157 +	my $vm_mem_actual = validate_response($xen->simple_request("VM_metrics.get_memory_actual",$session,$vm_metrics_ref)) / 1024 / 1024;
   4.158 +	$host_info{$host_name}{'vms'}{$vm_name_label}{'memory'}{'actual'} = "$vm_mem_actual";
   4.159 +	print "  |- MEMiNFO: Actually in use: $vm_mem_actual MB\n";
   4.160 +}
   4.161 +
   4.162 +sub get_vm_vif_utilisation
   4.163 +{
   4.164 +	my ($xen, $session, $host_name, $vm_ref, $vm_name_label) = @_;
   4.165 +	my $vm_vifs = validate_response($xen->simple_request("VM.get_VIFs",$session,$vm_ref));
   4.166 +	foreach (@$vm_vifs)
   4.167 +	{
   4.168 +		my $vif_device = validate_response($xen->simple_request("VIF.get_device",$session,$_));
   4.169 +		my $vif_io_read = validate_response($xen->simple_request("VIF_metrics.get_io_read_kbs", $session, $_));
   4.170 +		my $vif_io_write = validate_response($xen->simple_request("VIF_metrics.get_io_write_kbs", $session, $_));
   4.171 +		$host_info{$host_name}{'vms'}{$vm_name_label}{'vifs'}{$vif_device} = {'read' => $vif_io_read, 'write' => $vif_io_write};
   4.172 +		print "  |- ViFiNFO: $vif_device READ: $vif_io_read - WRITE: $vif_io_write\n";
   4.173 +	}
   4.174 +}
   4.175 +
   4.176 +sub get_vm_vbd_utilisation
   4.177 +{
   4.178 +	my ($xen, $session, $host_name, $vm_ref, $vm_name_label) = @_;
   4.179 +	my $vm_vbds = validate_response($xen->simple_request("VM.get_VBDs",$session,$vm_ref));
   4.180 +	foreach (@$vm_vbds)
   4.181 +	{
   4.182 +		my $vbd_device = validate_response($xen->simple_request("VBD.get_device",$session,$_));
   4.183 +		my $vbd_io_read = validate_response($xen->simple_request("VBD_metrics.get_io_read_kbs", $session, $_));
   4.184 +		my $vbd_io_write = validate_response($xen->simple_request("VBD_metrics.get_io_write_kbs", $session, $_));
   4.185 +		$host_info{$host_name}{'vms'}{$vm_name_label}{'vbds'}{$vbd_device} = {'read' => $vbd_io_read, 'write' => $vbd_io_write};
   4.186 +		print "  |- VBDiNFO: $vbd_device READ: $vbd_io_read - WRITE: $vbd_io_write\n";
   4.187 +	}
   4.188 +}
   4.189 +
   4.190 +
   4.191 +sub get_vm_type
   4.192 +{
   4.193 +	my ($xen, $session, $host_name, $vm_ref, $vm_name_label) = @_;
   4.194 +	# not running response through validate_response() here to stop it from crashing..
   4.195 +	#
   4.196 +	# api docs says if this (following) field is set, its a HVM domain.
   4.197 +	my $vm_bootloader_results = $xen->simple_request("VM.get_HVM_boot_policy",$session,$vm_ref);
   4.198 +	if ("$vm_bootloader_results->{'Status'}" eq "Success")
   4.199 +	{
   4.200 +		if ("$vm_bootloader_results->{'Value'}" ne "")
   4.201 +		{
   4.202 +			$host_info{$host_name}{'vms'}{$vm_name_label}{'type'} = "HVM";
   4.203 +		}
   4.204 +		else
   4.205 +		{
   4.206 +			$host_info{$host_name}{'vms'}{$vm_name_label}{'type'} = "PV";
   4.207 +		}
   4.208 +	}
   4.209 +	else
   4.210 +	{
   4.211 +		# However, xen 3.0.4 doest support this part of the api, so afaik I can get the difference with: 
   4.212 +		my $vm_pv_kernel_results = $xen->simple_request("VM.get_PV_kernel",$session,$vm_ref);
   4.213 +		# which is something like:
   4.214 +		# 'PV_kernel': '/boot/vmlinuz-2.6.18-xen',
   4.215 +		# or
   4.216 +		# 'PV_kernel': '/usr/lib/xen/boot/hvmloader',
   4.217 +		if ("$vm_pv_kernel_results->{'Value'}" =~ m/hvm/i)
   4.218 +		{
   4.219 +			$host_info{$host_name}{'vms'}{$vm_name_label}{'type'} = "HVM";
   4.220 +		}
   4.221 +		else
   4.222 +		{
   4.223 +			$host_info{$host_name}{'vms'}{$vm_name_label}{'type'} = "PV";
   4.224 +		}
   4.225 +	}
   4.226 +}
   4.227 +
   4.228 +sub get_complete_info
   4.229 +{	
   4.230 +	my %all_vms;
   4.231 +	foreach my $xenhost (sort keys %xenhosts)
   4.232 +	{
   4.233 +		next unless $xenhosts{$xenhost}{'session'};
   4.234 +		my $xen = $xenhosts{$xenhost}{'xen'};
   4.235 +		my $session = $xenhosts{$xenhost}{'session'};
   4.236 +		print "_______________________\n## $xenhost ##\n-----------------------\n";
   4.237 +	
   4.238 +		my $host_ref = validate_response($xen->simple_request("session.get_this_host", $session));
   4.239 +		
   4.240 +		my $host_name = validate_response($xen->simple_request("host.get_name_label", $session, $host_ref));
   4.241 +		$xenhosts{$xenhost}{'hostname'} = $host_name;
   4.242 +		$host_info{$host_name}{'ip'} = $xenhost;
   4.243 +		
   4.244 +		get_host_cpu_utilisation($xen, $session, $host_name, $host_ref);
   4.245 +
   4.246 +		get_host_mem_utilisation($xen, $session, $host_name, $host_ref);
   4.247 +	
   4.248 +		get_host_pif_utilisation($xen, $session, $host_name, $host_ref);
   4.249 +	
   4.250 +	
   4.251 +		my $all_vm_refs = validate_response($xen->simple_request("host.get_resident_VMs",$session, $host_ref));
   4.252 +		
   4.253 +		foreach my $vm_ref (@$all_vm_refs)
   4.254 +		{
   4.255 +			my $vm_name_label = validate_response($xen->simple_request("VM.get_name_label",$session,$vm_ref));
   4.256 +			get_vm_type($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.257 +			
   4.258 +			my $vm_id = validate_response($xen->simple_request("VM.get_domid",$session,$vm_ref));
   4.259 +
   4.260 +			print "vm: $vm_id\t$vm_name_label\ttype: $host_info{$host_name}{'vms'}->{$vm_name_label}{'type'}\n";
   4.261 +			
   4.262 +			# vm_metrics includes both mem_actual & cpu utilisation
   4.263 +			# So we'll add all stats found in that class in one go..
   4.264 +			get_vm_metrics($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.265 +#			get_vm_cpu_utilisation($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.266 +
   4.267 +			# all other mem stats are added seperately..
   4.268 +			# This might not be needed at all as xen doesnt have functionality to
   4.269 +			# resize mem for a VM atm (afaik)
   4.270 +			get_vm_mem_info($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.271 +	
   4.272 +			get_vm_vif_utilisation($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.273 +			
   4.274 +			get_vm_vbd_utilisation($xen,$session,$host_name,$vm_ref,$vm_name_label);
   4.275 +			
   4.276 +			$all_vms{$vm_name_label} = "" unless ("$vm_name_label" eq "Domain-0");
   4.277 +		}
   4.278 +		print "\n";
   4.279 +	}
   4.280 +	# Debug: Uncomment to see the nested datastructure..
   4.281 +	#print Dumper(%host_info);
   4.282 +}
   4.283 +
   4.284 +
   4.285 +
   4.286 +apiconnect();
   4.287 +get_complete_info();
     5.1 --- a/tools/firmware/vmxassist/machine.h	Wed May 16 11:38:48 2007 -0600
     5.2 +++ b/tools/firmware/vmxassist/machine.h	Tue May 22 06:43:05 2007 +0100
     5.3 @@ -115,7 +115,7 @@ struct tss {
     5.4  #ifdef	ENABLE_VME
     5.5  	unsigned long	int_redir[8];
     5.6  #endif
     5.7 -	unsigned char	iomap[8192];
     5.8 +	unsigned char	iomap[8193];
     5.9  };
    5.10  
    5.11  static inline void
     6.1 --- a/tools/firmware/vmxassist/setup.c	Wed May 16 11:38:48 2007 -0600
     6.2 +++ b/tools/firmware/vmxassist/setup.c	Tue May 22 06:43:05 2007 +0100
     6.3 @@ -127,6 +127,7 @@ setup_gdt(void)
     6.4  	tss.ss0 = DATA_SELECTOR;
     6.5  	tss.esp0 = (unsigned) stack_top;
     6.6  	tss.iomap_base = offsetof(struct tss, iomap);
     6.7 +	tss.iomap[sizeof(tss.iomap)-1] = 0xff;
     6.8  
     6.9  	/* initialize gdt's tss selector */
    6.10  	gdt[TSS_SELECTOR / sizeof(gdt[0])] |=
     7.1 --- a/tools/libxc/xc_dom.h	Wed May 16 11:38:48 2007 -0600
     7.2 +++ b/tools/libxc/xc_dom.h	Tue May 22 06:43:05 2007 +0100
     7.3 @@ -136,6 +136,7 @@ struct xc_dom_arch {
     7.4      int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
     7.5  
     7.6      char *guest_type;
     7.7 +    char *native_protocol;
     7.8      int page_shift;
     7.9      int sizeof_pfn;
    7.10  
     8.1 --- a/tools/libxc/xc_dom_x86.c	Wed May 16 11:38:48 2007 -0600
     8.2 +++ b/tools/libxc/xc_dom_x86.c	Tue May 22 06:43:05 2007 +0100
     8.3 @@ -19,6 +19,7 @@
     8.4  #include <xen/foreign/x86_64.h>
     8.5  #include <xen/hvm/hvm_info_table.h>
     8.6  #include <xen/hvm/e820.h>
     8.7 +#include <xen/io/protocols.h>
     8.8  
     8.9  #include "xg_private.h"
    8.10  #include "xc_dom.h"
    8.11 @@ -589,6 +590,7 @@ static int vcpu_x86_64(struct xc_dom_ima
    8.12  
    8.13  static struct xc_dom_arch xc_dom_32 = {
    8.14      .guest_type = "xen-3.0-x86_32",
    8.15 +    .native_protocol = XEN_IO_PROTO_ABI_X86_32,
    8.16      .page_shift = PAGE_SHIFT_X86,
    8.17      .sizeof_pfn = 4,
    8.18      .alloc_magic_pages = alloc_magic_pages,
    8.19 @@ -600,6 +602,7 @@ static struct xc_dom_arch xc_dom_32 = {
    8.20  };
    8.21  static struct xc_dom_arch xc_dom_32_pae = {
    8.22      .guest_type = "xen-3.0-x86_32p",
    8.23 +    .native_protocol = XEN_IO_PROTO_ABI_X86_32,
    8.24      .page_shift = PAGE_SHIFT_X86,
    8.25      .sizeof_pfn = 4,
    8.26      .alloc_magic_pages = alloc_magic_pages,
    8.27 @@ -612,6 +615,7 @@ static struct xc_dom_arch xc_dom_32_pae 
    8.28  
    8.29  static struct xc_dom_arch xc_dom_64 = {
    8.30      .guest_type = "xen-3.0-x86_64",
    8.31 +    .native_protocol = XEN_IO_PROTO_ABI_X86_64,
    8.32      .page_shift = PAGE_SHIFT_X86,
    8.33      .sizeof_pfn = 8,
    8.34      .alloc_magic_pages = alloc_magic_pages,
     9.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Wed May 16 11:38:48 2007 -0600
     9.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue May 22 06:43:05 2007 +0100
     9.3 @@ -407,6 +407,7 @@ static PyObject *pyxc_linux_build(XcObje
     9.4      unsigned long console_mfn = 0;
     9.5      PyObject* elfnote_dict;
     9.6      PyObject* elfnote = NULL;
     9.7 +    PyObject* ret;
     9.8      int i;
     9.9  
    9.10      static char *kwd_list[] = { "domid", "store_evtchn", "memsize",
    9.11 @@ -455,12 +456,22 @@ static PyObject *pyxc_linux_build(XcObje
    9.12  	Py_DECREF(elfnote);
    9.13      }
    9.14  
    9.15 +    ret = Py_BuildValue("{s:i,s:i,s:N}",
    9.16 +			"store_mfn", store_mfn,
    9.17 +			"console_mfn", console_mfn,
    9.18 +			"notes", elfnote_dict);
    9.19 +
    9.20 +    if ( dom->arch_hooks->native_protocol )
    9.21 +    {
    9.22 +	PyObject *native_protocol =
    9.23 +	    Py_BuildValue("s", dom->arch_hooks->native_protocol);
    9.24 +	PyDict_SetItemString(ret, "native_protocol", native_protocol);
    9.25 +	Py_DECREF(native_protocol);
    9.26 +    }
    9.27 +
    9.28      xc_dom_release(dom);
    9.29  
    9.30 -    return Py_BuildValue("{s:i,s:i,s:N}", 
    9.31 -                         "store_mfn", store_mfn,
    9.32 -                         "console_mfn", console_mfn,
    9.33 -			 "notes", elfnote_dict);
    9.34 +    return ret;
    9.35  
    9.36    out:
    9.37      xc_dom_release(dom);
    10.1 --- a/tools/python/xen/xend/XendAPI.py	Wed May 16 11:38:48 2007 -0600
    10.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue May 22 06:43:05 2007 +0100
    10.3 @@ -882,7 +882,8 @@ class XendAPI(object):
    10.4      
    10.5      host_attr_rw = ['name_label',
    10.6                      'name_description',
    10.7 -                    'other_config']
    10.8 +                    'other_config',
    10.9 +                    'logging']
   10.10  
   10.11      host_methods = [('disable', None),
   10.12                      ('enable', None),
   10.13 @@ -957,7 +958,11 @@ class XendAPI(object):
   10.14          return xen_api_success(XendNode.instance().get_vcpus_policy())
   10.15      def host_get_cpu_configuration(self, _, host_ref):
   10.16          return xen_api_success(XendNode.instance().get_cpu_configuration())
   10.17 -    
   10.18 +    def host_set_logging(self, _, host_ref, logging):
   10.19 +        return xen_api_todo()
   10.20 +    def host_get_logging(self, _, host_ref):
   10.21 +        return xen_api_todo()
   10.22 +
   10.23      # object methods
   10.24      def host_disable(self, session, host_ref):
   10.25          XendDomain.instance().set_allow_new_domains(False)
   10.26 @@ -1010,7 +1015,10 @@ class XendAPI(object):
   10.27                    'metrics': node.host_metrics_uuid,
   10.28                    'capabilities': node.get_capabilities(),
   10.29                    'supported_bootloaders': ['pygrub'],
   10.30 -                  'sched_policy': node.get_vcpus_policy()}
   10.31 +                  'sched_policy': node.get_vcpus_policy(),
   10.32 +                  'logging': {},
   10.33 +                  'PIFs': XendPIF.get_all(),
   10.34 +                  'PBDs': XendPBD.get_all()}
   10.35          return xen_api_success(record)
   10.36  
   10.37      # class methods
   10.38 @@ -1133,7 +1141,8 @@ class XendAPI(object):
   10.39                    'tools_version',
   10.40                    'domid',
   10.41                    'is_control_domain',
   10.42 -                  'metrics'
   10.43 +                  'metrics',
   10.44 +                  'crash_dumps',
   10.45                    ]
   10.46                    
   10.47      VM_attr_rw = ['name_label',
   10.48 @@ -1572,6 +1581,9 @@ class XendAPI(object):
   10.49          else:
   10.50              return xen_api_success_void()
   10.51  
   10.52 +    def VM_get_crash_dumps(self, _, vm_ref):
   10.53 +        return xen_api_todo()
   10.54 +
   10.55      # class methods
   10.56      def VM_get_all(self, session):
   10.57          refs = [d.get_uuid() for d in XendDomain.instance().list('all')]
   10.58 @@ -1636,7 +1648,8 @@ class XendAPI(object):
   10.59              'other_config': xeninfo.info.get('other_config', {}),
   10.60              'domid': domid is None and -1 or domid,
   10.61              'is_control_domain': xeninfo.info['is_control_domain'],
   10.62 -            'metrics': xeninfo.get_metrics()
   10.63 +            'metrics': xeninfo.get_metrics(),
   10.64 +            'crash_dumps': []
   10.65          }
   10.66          return xen_api_success(record)
   10.67  
   10.68 @@ -1767,6 +1780,7 @@ class XendAPI(object):
   10.69                  return_cfg[k] = cfg[k]
   10.70  
   10.71          return_cfg['metrics'] = vbd_ref
   10.72 +        return_cfg['runtime_properties'] = {} #todo
   10.73  
   10.74          return xen_api_success(return_cfg)
   10.75  
   10.76 @@ -1836,7 +1850,7 @@ class XendAPI(object):
   10.77          try:
   10.78              devid = int(device['id'])
   10.79              device_sxps = dominfo.getDeviceSxprs('vbd')
   10.80 -            device_dicts  = [dict(device_sxp[1][1:]) for device_sxp in device_sxps]
   10.81 +            device_dicts  = [dict(device_sxp[1][0:]) for device_sxp in device_sxps]
   10.82              device_dict = [device_dict
   10.83                             for device_dict in device_dicts
   10.84                             if int(device_dict['virtual-device']) == devid][0]
    11.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed May 16 11:38:48 2007 -0600
    11.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue May 22 06:43:05 2007 +0100
    11.3 @@ -357,6 +357,8 @@ class XendDomainInfo:
    11.4          self.console_port = None
    11.5          self.console_mfn = None
    11.6  
    11.7 +        self.native_protocol = None
    11.8 +
    11.9          self.vmWatch = None
   11.10          self.shutdownWatch = None
   11.11          self.shutdownStartTime = None
   11.12 @@ -1520,6 +1522,8 @@ class XendDomainInfo:
   11.13                  self.console_mfn = channel_details['console_mfn']
   11.14              if 'notes' in channel_details:
   11.15                  self.info.set_notes(channel_details['notes'])
   11.16 +            if 'native_protocol' in channel_details:
   11.17 +                self.native_protocol = channel_details['native_protocol'];
   11.18  
   11.19              self._introduceDomain()
   11.20  
    12.1 --- a/tools/python/xen/xend/XendNode.py	Wed May 16 11:38:48 2007 -0600
    12.2 +++ b/tools/python/xen/xend/XendNode.py	Tue May 22 06:43:05 2007 +0100
    12.3 @@ -195,7 +195,7 @@ class XendNode:
    12.4                          network_uuid, 'network')
    12.5                      if network.get_name_label() == bridge_name:
    12.6                          XendPIF.create_phy(network_uuid, name,
    12.7 -                                           mtu, mac)
    12.8 +                                           mac, mtu)
    12.9                          break
   12.10                  else:
   12.11                      log.debug("Cannot find network for bridge %s "
   12.12 @@ -233,8 +233,9 @@ class XendNode:
   12.13    ##      self.save_networks()
   12.14  
   12.15  
   12.16 -##    def get_PIF_refs(self):
   12.17 -##       return self.pifs[:]
   12.18 +    def get_PIF_refs(self):
   12.19 +        log.debug(XendPIF.get_all())
   12.20 +        return XendPIF.get_all()
   12.21  
   12.22  ##   def _PIF_create(self, name, mtu, vlan, mac, network, persist = True,
   12.23  ##                     pif_uuid = None, metrics_uuid = None):
    13.1 --- a/tools/python/xen/xend/XendVMMetrics.py	Wed May 16 11:38:48 2007 -0600
    13.2 +++ b/tools/python/xen/xend/XendVMMetrics.py	Tue May 22 06:43:05 2007 +0100
    13.3 @@ -117,7 +117,7 @@ class XendVMMetrics(XendBase):
    13.4          except Exception, err:
    13.5              # ignore missing domain
    13.6              log.trace("domain_getinfo(%d) failed, ignoring: %s", domid, str(err))
    13.7 -        return ""
    13.8 +        return []
    13.9  
   13.10      def get_VCPUs_params(self):
   13.11          domid = self.xend_domain_instance.getDomid()
    14.1 --- a/tools/python/xen/xend/server/DevController.py	Wed May 16 11:38:48 2007 -0600
    14.2 +++ b/tools/python/xen/xend/server/DevController.py	Tue May 22 06:43:05 2007 +0100
    14.3 @@ -459,6 +459,8 @@ class DevController:
    14.4              'state' : str(xenbusState['Initialising'])
    14.5              })
    14.6  
    14.7 +        if self.vm.native_protocol:
    14.8 +            frontDetails.update({'protocol' : self.vm.native_protocol})
    14.9  
   14.10          backDetails.update({
   14.11              'domain' : self.vm.getName(),