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

Re: [Xen-devel] [PATCH 10/12] docs/migration: Specify X86_{CPUID, MSR}_POLICY records



On 24.12.2019 16:19, Andrew Cooper wrote:
> @@ -439,6 +449,34 @@ def verify_record_static_data_end(self, content):
>              raise RecordError("Static data end record found in v2 stream")
>  
>  
> +    def verify_record_x86_cpuid_policy(self, content):
> +        """ x86 CPUID policy record """
> +
> +        if self.version < 3:
> +            raise RecordError("x86 CPUID policy record found in v2 stream")
> +
> +        sz = calcsize(X86_CPUID_POLICY_FORMAT)
> +        contentsz = len(content)
> +
> +        if contentsz < sz or (contentsz % sz) != 0:
> +            raise RecordError("Record length %u, expected multiple of %u" %
> +                              (contentsz, sz))
> +
> +
> +    def verify_record_x86_msr_policy(self, content):
> +        """ x86 MSR policy record """
> +
> +        if self.version < 3:
> +            raise RecordError("x86 MSR policy record found in v2 stream")
> +
> +        sz = calcsize(X86_MSR_POLICY_FORMAT)
> +        contentsz = len(content)
> +
> +        if contentsz < sz or (contentsz % sz) != 0:
> +            raise RecordError("Record length %u, expected multiple of %u" %
> +                              (contentsz, sz))

While I can't even see a theoretical case of the CPUID array
having zero elements, is it really entirely implausible to have
an empty MSRs array? I.e. wouldn't the left side of the "or"
better go away?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.