All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josht@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] xc_domain_getinfo should zero info struct; can leave crashed flag set otherwise
Date: Mon, 20 Jun 2005 13:32:23 -0700	[thread overview]
Message-ID: <42B727D7.7080501@us.ibm.com> (raw)

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

The xc_domain_getinfo does not clear the info structure before filling 
it in, and in some circumstances it doesn't completely fill in the 
structure for each domain.  In particular, it sets the crashed flag if 
the domain has crashed, but does not clear it if the domain has not 
crashed, so the crashed flag may be random stack garbage from the 
calling program.  With the attached patch (against the latest nightly), 
xc_domain_getinfo zeroes the array of info structures before filling 
them in.

Signed-off-by: Josh Triplett <josht@us.ibm.com>

- Josh Triplett

[-- Attachment #2: libxc-zero-domain-info-struct.patch --]
[-- Type: text/x-patch, Size: 461 bytes --]

diff -Nur xen-unstable.orig/tools/libxc/xc_domain.c xen-unstable/tools/libxc/xc_domain.c
--- xen-unstable.orig/tools/libxc/xc_domain.c	2005-06-12 20:13:42.000000000 -0700
+++ xen-unstable/tools/libxc/xc_domain.c	2005-06-15 18:31:24.000000000 -0700
@@ -77,6 +77,8 @@
     dom0_op_t op;
     int rc = 0; 
 
+    memset(info, 0, max_doms*sizeof(xc_dominfo_t));
+
     for ( nr_doms = 0; nr_doms < max_doms; nr_doms++ )
     {
         op.cmd = DOM0_GETDOMAININFO;

[-- 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:[~2005-06-20 20:32 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=42B727D7.7080501@us.ibm.com \
    --to=josht@us.ibm.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.