Re: [PATCH 1/1] lscpu: correct the Virtualization type on Xen DomU PV guest

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

 



On Fri, Mar 18, 2016 at 02:53:24PM +0800, Dongli Zhang wrote:
> +			fd = path_fopen("r", 0, _PATH_SYS_HYP_FEATURES);

 Is the file always available (including old XEN versions)? This
 function exit on error, maybe we need path_exist() before open.

 There is also path_read_u64() to avoid path_fopen() & fscanf().

    Karel

> +			if (fd && fscanf(fd, "%x", &features) == 1) {
> +				/* Xen para-virt (or pvh) */
> +				if (!(features & (1U << XENFEAT_hvm_pirqs)))
> +					desc->virtype = VIRT_PARA;
> +				fclose(fd);
> +			}
> +		}
> +	} else if (read_hypervisor_powerpc(desc) > 0) {}
>  
>  	/* Xen para-virt or dom0 */
>  	else if (path_exist(_PATH_PROC_XEN)) {

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux