Clean up arch_get_xen_caps() to not use sprintf().
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Xen staging patchbot-unstable
diff -r
bd69e83b65ea-r9578ae319874xen/arch/ia64/xen/xensetup.cxen/arch/ia64/xen/xensetup.c +0
-1@@ -547,18 +547,19 @@ printk("num_online_cpus=%d, max_cpus=%d\void arch_get_xen_caps (xen_capabilities_info_t info) { -char *p=info;
xen/arch/ia64/xen/xensetup.c printk("num_online_cpus=%d, max_cpus=%d\ · line 557
Quoted 10 lines
xen/arch/ia64/xen/xensetup.c +6
-2int major =xen_major_version ();int minor =xen_minor_version (); - - p +=snprintf (p,sizeof (info),"xen-%d.%d-ia64 " , major, minor); +char s[32 ]; + + info[0 ] ='\0' ; + +snprintf (s,sizeof (s),"xen-%d.%d-ia54 " , major, minor); +safe_strcat (info, s);
This doesn't work. info is just a char* here, so the sizeof() insafe_strcat() only cats the first 8 bytes (or 4 on x86_32 I suppose). Thanks,
Alex
Signature · 1 line
Alex Williamson HP Open Source & Linux Org.
Quoted 6 lines · Alex Williamson
Quoted 5 lines · Xen staging patchbot-unstable
diff -r
bd69e83b65ea-r9578ae319874xen/arch/ia64/xen/xensetup.cxen/arch/ia64/xen/xensetup.c +0
-0@@ -547,18 +547,19 @@ printk("num_online_cpus=%d, max_cpus=%d\
Quoted 16 lines
xen/arch/ia64/xen/xensetup.c printk("num_online_cpus=%d, max_cpus=%d\ · line 557
Quoted 13 lines
xen/arch/ia64/xen/xensetup.c +6
-3void arch_get_xen_caps (xen_capabilities_info_t info) { -char *p=info;int major =xen_major_version ();int minor =xen_minor_version (); - - p +=snprintf (p,sizeof (info),"xen-%d.%d-ia64 " , major, minor); +char s[32 ]; + + info[0 ] ='\0' ; + +snprintf (s,sizeof (s),"xen-%d.%d-ia54 " , major, minor); +safe_strcat (info, s);This doesn't work. info is just a char* here, so the
sizeof()insafe_strcat()only cats the first 8 bytes (or 4 onx86_32I suppose).
And there's a typo, ia64, not 54. Thanks,
Alex
Signature · 1 line
Alex Williamson HP Open Source & Linux Org.
Quoted 24 lines · Alex Williamson
Quoted 6 lines · Alex Williamson
Quoted 5 lines · Xen staging patchbot-unstable
diff -r
bd69e83b65ea-r9578ae319874xen/arch/ia64/xen/xensetup.cxen/arch/ia64/xen/xensetup.c +0
-0@@ -547,18 +547,19 @@ printk("num_online_cpus=%d, max_cpus=%d\Quoted 16 lines
xen/arch/ia64/xen/xensetup.c printk("num_online_cpus=%d, max_cpus=%d\ · line 557
Quoted 13 lines
xen/arch/ia64/xen/xensetup.c +6
-3void arch_get_xen_caps (xen_capabilities_info_t info) { -char *p=info;int major =xen_major_version ();int minor =xen_minor_version (); - - p +=snprintf (p,sizeof (info),"xen-%d.%d-ia64 " , major, minor); +char s[32 ]; + + info[0 ] ='\0' ; + +snprintf (s,sizeof (s),"xen-%d.%d-ia54 " , major, minor); +safe_strcat (info, s);This doesn't work. info is just a char* here, so the
sizeof()insafe_strcat()only cats the first 8 bytes (or 4 onx86_32I suppose).
Quoted 1 line
And there's a typo, ia64, not 54. Thanks,
Fixed both of these, thanks for the heads up.
Ian.
about eventchannel
In reply to Alex WilliamsonHi
I try to understand the eventchannel part,
and I am confused by the differences of the physical IRQ line ,virtual IRQ line and virtual IPI line
for a vm , what do the physical IRQ line and virtual IRQ line mean for? Every vm has one or some vcpu ,then virtual IRQ line may be related with one of these vcpu , then what is the physical IRQ line for? I am really confused with it
could someone give me help
Thanks in advance
Re: about eventchannel
Hi,
Quoted 3 lines
I try to understand the eventchannel part,
and I am confused by the differences of the physical IRQ line ,virtual IRQ line and virtual IPI line
Physical IRQ lines correspond to actual IRQs from real hardware devices. Guests receive an event channel notification for a physical IRQ line if there is an interrupt generated by that device.
A virtual IRQ is something that is generated by Xen, e.g. the domain's timer interrupt.
The virtual IPI lines are interdomain event channels, allowing domains to notify each other (for instance to notify that there's data waiting for processing in a shared memory buffer).
Cheers,
Mark
Quoted 14 lines
for a vm , what do the physical IRQ line and virtual IRQ line mean for? Every vm has one or some vcpu ,then virtual IRQ line may be related with one of these vcpu , then what is the physical IRQ line for? I am really confused with it
could someone give me help
Thanks in advance_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel!
RE: about eventchannel
Quoted 15 lines
From: Mark Williamson
Sent: 2007年2月1日 4:48Hi,
Quoted 3 lines
I try to understand the eventchannel part,
and I am confused by the differences of the physical IRQ line ,virtual IRQ line and virtual IPI linePhysical IRQ lines correspond to actual IRQs from real hardware devices.
Guests receive an event channel notification for a physical IRQ line if there
is an interrupt generated by that device.
Quoted 7 lines
A virtual IRQ is something that is generated by Xen, e.g. the domain's timer
interrupt.The virtual IPI lines are interdomain event channels, allowing domains to notify each other (for instance to notify that there's data waiting for processing in a shared memory buffer).
I would say virtual IPI lines are inter-vcpu event channels within one domain, which just behaves like physical IPI. Then we can consider rest out of above 3 categories into inter-domain event ports. :-)
Thanks,
Kevin