All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH][libxenapi] Fix segmentaion fault in libxenapi
Date: Tue, 12 Jun 2007 15:45:52 -0600	[thread overview]
Message-ID: <466F1410.6070502@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

When calling xen_vbd_set_mode(), libxenapi attempted to convert the enum
mode parameter to a string twice - resulting in segfault.  Removed first
conversion since conversion is taking place in marshalling/demarshalling
layer.  Fixed similar double enum conversion in other places as well.

Regards,
Jim

[-- Attachment #2: libxenapi_enum_handling.patch --]
[-- Type: text/x-patch, Size: 2972 bytes --]

# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# Date 1181684273 21600
# Node ID e4e63812779c8bfc51e15dc137533f73f8e38858
# Parent  93f77a5a8437df0b34919a6987f48e84342b4a43
Fix segfault in libxenapi.

When calling xen_vbd_set_mode(), libxenapi attempted to convert enum mode
parameter to a string twice - resulting in segfault.  Removed first conversion
since conversion is taking place in marshalling/demarshalling layer.  Fixed
similar double enum conversion in other places as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>

diff -r 93f77a5a8437 -r e4e63812779c tools/libxen/src/xen_vbd.c
--- a/tools/libxen/src/xen_vbd.c	Sun Jun 10 19:58:22 2007 +0100
+++ b/tools/libxen/src/xen_vbd.c	Tue Jun 12 15:37:53 2007 -0600
@@ -463,7 +463,7 @@ xen_vbd_set_mode(xen_session *session, x
             { .type = &abstract_type_string,
               .u.string_val = vbd },
             { .type = &xen_vbd_mode_abstract_type_,
-              .u.string_val = xen_vbd_mode_to_string(mode) }
+              .u.enum_val = mode }
         };
 
     xen_call_(session, "VBD.set_mode", param_values, 2, NULL, NULL);
@@ -479,7 +479,7 @@ xen_vbd_set_type(xen_session *session, x
             { .type = &abstract_type_string,
               .u.string_val = vbd },
             { .type = &xen_vbd_type_abstract_type_,
-              .u.string_val = xen_vbd_type_to_string(type) }
+              .u.enum_val = type }
         };
 
     xen_call_(session, "VBD.set_type", param_values, 2, NULL, NULL);
diff -r 93f77a5a8437 -r e4e63812779c tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c	Sun Jun 10 19:58:22 2007 +0100
+++ b/tools/libxen/src/xen_vm.c	Tue Jun 12 15:37:53 2007 -0600
@@ -1142,7 +1142,7 @@ xen_vm_set_actions_after_shutdown(xen_se
             { .type = &abstract_type_string,
               .u.string_val = vm },
             { .type = &xen_on_normal_exit_abstract_type_,
-              .u.string_val = xen_on_normal_exit_to_string(after_shutdown) }
+              .u.enum_val = after_shutdown }
         };
 
     xen_call_(session, "VM.set_actions_after_shutdown", param_values, 2, NULL, NULL);
@@ -1158,7 +1158,7 @@ xen_vm_set_actions_after_reboot(xen_sess
             { .type = &abstract_type_string,
               .u.string_val = vm },
             { .type = &xen_on_normal_exit_abstract_type_,
-              .u.string_val = xen_on_normal_exit_to_string(after_reboot) }
+              .u.enum_val = after_reboot }
         };
 
     xen_call_(session, "VM.set_actions_after_reboot", param_values, 2, NULL, NULL);
@@ -1174,7 +1174,7 @@ xen_vm_set_actions_after_crash(xen_sessi
             { .type = &abstract_type_string,
               .u.string_val = vm },
             { .type = &xen_on_crash_behaviour_abstract_type_,
-              .u.string_val = xen_on_crash_behaviour_to_string(after_crash) }
+              .u.enum_val = after_crash }
         };
 
     xen_call_(session, "VM.set_actions_after_crash", param_values, 2, NULL, NULL);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2007-06-12 21:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466F1410.6070502@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.