All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Alfaro Solana <felipe.alfaro@gmail.com>
To: xen-devel <xen-devel@lists.sourceforge.net>
Subject: ctxt->pt_base != 0 when creating a new domain
Date: Mon, 7 Feb 2005 14:57:40 +0100	[thread overview]
Message-ID: <6f6293f10502070557374e50f8@mail.gmail.com> (raw)

Hi!

Since upgrading to the latest bkbits from xeno-unstable, I'm unable to
create a XenU domain I was previously able to create with no problems
at all:

# xm list
Name              Id  Mem(MB)  CPU  State  Time(s)  Console
Domain-0           0      414    0  r----     23.4        

# xm create xenU
Using config file "xenU"
Error: Error creating domain: (0, 'Error')

# cat /var/log/xend-debug.log
network start bridge=xen-br0 netdev=eth1 antispoof=no
ERROR: Domain is already constructed
op_create> Exception creating domain:
Traceback (most recent call last):
  File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 66, in op_create
    deferred = self.xd.domain_create(config)
  File "/usr/lib/python/xen/xend/XendDomain.py", line 357, in domain_create
    deferred = XendDomainInfo.vm_create(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 195, in vm_create
    ptr = vm.construct(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 469, in construct
    self.construct_image()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 503, in
construct_image
    self.image_handler(self, image)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 1137, in
vm_image_linux
    vm.create_domain("linux", kernel, ramdisk, cmdline)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 809, in create_domain
    self.build_domain(ostype, kernel, ramdisk, cmdline, memmap)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 789, in build_domain
    vcpus          = self.vcpus)
error: (0, 'Error')

I have made the following testcase patch:

--- tools/libxc/xc_linux_build.c.old    2005-02-07 13:49:57.000000000 +0100
+++ tools/libxc/xc_linux_build.c        2005-02-07 14:45:35.242555000 +0100
@@ -360,46 +360,51 @@
             goto error_out;
         }
     }
 
     if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
     {   
         PERROR("Unable to mlock ctxt");
         return 1;
     }
 
     op.cmd = DOM0_GETDOMAININFO;
     op.u.getdomaininfo.domain = (domid_t)domid;
     op.u.getdomaininfo.exec_domain = 0;
     op.u.getdomaininfo.ctxt = ctxt;
     if ( (do_dom0_op(xc_handle, &op) < 0) || 
          ((u16)op.u.getdomaininfo.domain != domid) )
     {
         PERROR("Could not get info on domain");
         goto error_out;
     }
+#if 1
     if ( !(op.u.getdomaininfo.flags & DOMFLAGS_PAUSED) ||
          (ctxt->pt_base != 0) )
     {
-               ERROR("Domain is already constructed");
+       if (!(op.u.getdomaininfo.flags & DOMFLAGS_PAUSED))
+               ERROR("Cannot create an unpaused domain");
+       else
+               ERROR("Domain is already constructed or ctxt->pt_base != 0");
         goto error_out;
     }
+#endif
 
     if ( setup_guestos(xc_handle, domid, image, image_size, 
                        initrd_gfd, initrd_size, nr_pages, 
                        &vstartinfo_start, &vkern_entry,
                        ctxt, cmdline,
                        op.u.getdomaininfo.shared_info_frame,
                        control_evtchn, flags, vcpus) < 0 )
     {
         ERROR("Error constructing guest OS");
         goto error_out;
     }
 
     if ( initrd_fd >= 0 )
         close(initrd_fd);
     if ( initrd_gfd )
         gzclose(initrd_gfd);
     if ( image != NULL )
         free(image);
 
     ctxt->flags = 0;


After applying the previous patch, rebuilnding and rebooting, this is
what gets logged into xend-debug.log:

# cat /var/log/xend-debug.log
network start bridge=xen-br0 netdev=eth1 antispoof=no
ERROR: Domain is already constructed or ctxt->pt_base != 0
op_create> Exception creating domain:
Traceback (most recent call last):
  File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 66, in op_create
    deferred = self.xd.domain_create(config)
  File "/usr/lib/python/xen/xend/XendDomain.py", line 357, in domain_create
    deferred = XendDomainInfo.vm_create(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 195, in vm_create
    ptr = vm.construct(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 469, in construct
    self.construct_image()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 503, in
construct_image
    self.image_handler(self, image)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 1137, in
vm_image_linux
    vm.create_domain("linux", kernel, ramdisk, cmdline)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 809, in create_domain
    self.build_domain(ostype, kernel, ramdisk, cmdline, memmap)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 789, in build_domain
    vcpus          = self.vcpus)
error: (0, 'Error')

This reveals that, for some misterious reason, the condition
"ctxt->pt_base != 0" evaluates TRUE. Why is this happening? What's
more, replacing the "#if 1" with an "#if 0" fixes the problem for me:
the domain is created and works properly.

Any ideas?


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

             reply	other threads:[~2005-02-07 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-07 13:57 Felipe Alfaro Solana [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-02-07 14:49 ctxt->pt_base != 0 when creating a new domain Ian Pratt

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=6f6293f10502070557374e50f8@mail.gmail.com \
    --to=felipe.alfaro@gmail.com \
    --cc=xen-devel@lists.sourceforge.net \
    /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.