All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rick Gonzalez <rcgneo@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] HVM qemu-pid in xm-test output log
Date: Wed, 24 May 2006 15:36:32 -0500	[thread overview]
Message-ID: <4474C3D0.7020805@us.ibm.com> (raw)

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

This patch creates a new entry in "xenstored" under 
"/local/domain/<id>/" called "qemu-pid" containing the actual pid number 
for the HVM-domain created.

Then, xm-test probes that entry to include it in it's output log. This 
is usefull for debugging purposes.



Signed-off-by: Rick Gonzalez <rcgneo@us.ibm.com>


[-- Attachment #2: qemu-pid.patch --]
[-- Type: text/x-patch, Size: 2617 bytes --]

diff -Naur xen-unstable.hg/tools/python/xen/xend/image.py xen-unstable.hg-dompid/tools/python/xen/xend/image.py
--- xen-unstable.hg/tools/python/xen/xend/image.py	2006-05-21 22:25:37.000000000 -0500
+++ xen-unstable.hg-dompid/tools/python/xen/xend/image.py	2006-05-21 23:09:15.000000000 -0500
@@ -357,6 +357,11 @@
         self.pid = os.spawnve(os.P_NOWAIT, self.device_model, args, env)
         log.info("device model pid: %d", self.pid)
 
+        # put the new qemu pid number in a list and store it
+        # in the domain information dir.
+        store = ["qemu-pid", str(self.pid)]
+        self.vm.writeDom(store)
+
     def vncParams(self):
         # see if a vncviewer was specified
         # XXX RN: bit of a hack. should unify this, maybe stick in config space
diff -Naur xen-unstable.hg/tools/xm-test/lib/XmTestLib/Test.py xen-unstable.hg-dompid/tools/xm-test/lib/XmTestLib/Test.py
--- xen-unstable.hg/tools/xm-test/lib/XmTestLib/Test.py	2006-05-21 22:25:37.000000000 -0500
+++ xen-unstable.hg-dompid/tools/xm-test/lib/XmTestLib/Test.py	2006-05-21 23:13:58.000000000 -0500
@@ -89,7 +89,7 @@
     raise TimeoutError("Command execution time exceeded %i seconds" % timeout,
                        outputSoFar=output)
 
-def traceCommand(command, timeout=None, logOutput=True):
+def traceCommand(command, timeout=None, logOutput=True, dom=""):
     if verbose:
         print "[dom0] Running `%s'" % command
 
@@ -98,8 +98,18 @@
     else:
         status, output = commands.getstatusoutput(command)
 
+    # Get HVM domain pid number
+    if dom != "":
+        cmd = "xenstore-read /local/domain/%s/qemu-pid" % dom.getId()
+        # read qemu-pid from xenstored
+        s, dpid = commands.getstatusoutput(cmd)
+        dname = dom.getName()
+
     if logOutput and verbose:
         print output
+        #print HVM pid number on to xm-test output
+        if (dom != "") and (s == 0):
+            print "[%s] domain qemu pid: %s" % (dname,dpid)
 
     return status, output
 
diff -Naur xen-unstable.hg/tools/xm-test/lib/XmTestLib/XenDomain.py xen-unstable.hg-dompid/tools/xm-test/lib/XmTestLib/XenDomain.py
--- xen-unstable.hg/tools/xm-test/lib/XmTestLib/XenDomain.py	2006-05-21 22:25:37.000000000 -0500
+++ xen-unstable.hg-dompid/tools/xm-test/lib/XmTestLib/XenDomain.py	2006-05-21 23:14:50.000000000 -0500
@@ -208,7 +208,7 @@
 
     def start(self, noConsole=False):
 
-        ret, output = traceCommand("xm create %s" % self.config)
+        ret, output = traceCommand("xm create %s" % self.config, dom=self)
 
         if ret != 0:
             raise DomainError("Failed to create domain",


[-- 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:[~2006-05-24 20:36 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=4474C3D0.7020805@us.ibm.com \
    --to=rcgneo@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.