|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] readnote: Add bzImage kernel support
On Thu, 2012-04-12 at 02:38 +0100, Xuesen Guo wrote:
> Add the check of bzImage kernel and make it work
> with RHEL 6 bzipped kernels
Thanks, a single small nit inline below.
> @@ -159,6 +204,27 @@ int main(int argc, char **argv)
> fprintf(stderr, "Unable to map %s: %s\n", f, strerror(errno));
> return 1;
> }
> +
> + /* Check the magic of bzImage kernel */
> + hdr = (struct setup_header *)image;
> + if ( memcmp(&hdr->header, HDR_MAGIC, HDR_MAGIC_SZ) == 0 )
> + {
> + if ( hdr->version < VERSION(2,8) )
> + {
> + printf("%s: boot protocol too old (%04x)",
> __FUNCTION__, hdr->version);
> + return -EINVAL;
Should be return 1 in this context.
Thanks,
Ian.
> + }
> +
> + /* upcast to 64 bits to avoid overflow */
> + /* setup_sects is u8 and so cannot overflow */
> + payload_offset = (hdr->setup_sects + 1) * 512;
> + payload_offset += hdr->payload_offset;
> + payload_length = hdr->payload_length;
> +
> + image = image + payload_offset;
> + st.st_size = payload_length;
> + }
> +
> size = st.st_size;
>
> usize = xc_dom_check_gzip(xch, image, st.st_size);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |