I have a kernel patch for RHEL5 and want to apply it to the kernel source of RHEL4. The patch is called "x2v-x32-rhel.patch" and contains the following code:
Code:
diff -pruN linux-2.6.18.i686/drivers/xen/core/xen_sysfs.c b/drivers/xen/core/xen_sysfs.c
--- linux-2.6.18.i686/drivers/xen/core/xen_sysfs.c 2008-04-21 09:30:08.000000000 -0400
+++ b/drivers/xen/core/xen_sysfs.c 2008-04-21 09:33:37.000000000 -0400
@@ -104,6 +104,10 @@ static ssize_t uuid_show(struct hyp_sysf
{
char *vm, *val;
int ret;
+ extern int xenstored_ready;
+
+ if (!xenstored_ready)
+ return -EBUSY;
vm = xenbus_read(XBT_NIL, "vm", "", NULL);
if (IS_ERR(vm))
I'm not sure about what it does but I think it will change some code in the following file. I got the latest RHEL4 kernel which contains xen and I changed the kernel version and applied the patch. I did a quick search on the xen_sysfs.c file and found the following lines:
xen_sysfs.c
Code:
static ssize_t uuid_show(struct hyp_sysfs_attr *attr, char *buffer)
{
char *vm, *val;
int ret;
extern int xenstored_ready;
if (!xenstored_ready)
return -EBUSY;
vm = xenbus_read(XBT_NIL, "vm", "", NULL);
if (IS_ERR(vm))
return PTR_ERR(vm);
val = xenbus_read(XBT_NIL, vm, "uuid", NULL);
kfree(vm);
if (IS_ERR(val))
return PTR_ERR(val);
ret = sprintf(buffer, "%s\n", val);
kfree(val);
return ret;
}
How am I sure the file is patched correctly? Matches the code below the changes above?