xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH v2 2/3] libxl: update vcpus bitmap in retrieved guest config
Date: Tue, 14 Jun 2016 14:20:26 +0100	[thread overview]
Message-ID: <20160614132026.GK5666@perard.uk.xensource.com> (raw)
In-Reply-To: <20160614105858.GJ5666@perard.uk.xensource.com>

On Tue, Jun 14, 2016 at 11:58:58AM +0100, Anthony PERARD wrote:
> On Tue, Jun 14, 2016 at 11:50:12AM +0100, Wei Liu wrote:
> > On Tue, Jun 14, 2016 at 11:47:57AM +0100, Anthony PERARD wrote:
> > [...]
> > > > > > +
> > > > > >  int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
> > > > > >                                          libxl_domain_config *d_config)
> > > > > >  {
> > > > > > @@ -7270,6 +7317,46 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
> > > > > >          libxl_dominfo_dispose(&info);
> > > > > >      }
> > > > > >  
> > > > > > +    /* VCPUs */
> > > > > > +    {
> > > > > > +        libxl_bitmap *map = &d_config->b_info.avail_vcpus;
> > > > > > +        unsigned int max_vcpus = d_config->b_info.max_vcpus;
> > > > > > +
> > > > > > +        libxl_bitmap_dispose(map);
> > > > > > +        libxl_bitmap_init(map);
> > > > > > +        libxl_bitmap_alloc(CTX, map, max_vcpus);
> > > > > > +        libxl_bitmap_set_none(map);
> > > > > > +
> > > > > > +        switch (d_config->b_info.type) {
> > > > > > +        case LIBXL_DOMAIN_TYPE_HVM:
> > > > > > +            switch (d_config->b_info.device_model_version) {
> > > > > > +            case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> > > > > > +                rc = libxl__update_avail_vcpus_qmp(gc, domid,
> > > > > > +                                                   max_vcpus, map);
> > > > > > +                break;
> > > > > > +            case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> > > > > > +            case LIBXL_DEVICE_MODEL_VERSION_NONE:
> > > > > > +                rc = libxl__update_avail_vcpus_xenstore(gc, domid,
> > > > > > +                                                        max_vcpus, map);
> > > > > > +                break;
> > > > > > +            default:
> > > > > > +            abort();
> > > > > 
> > > > > Missing indentation for abort.
> > > > > 
> > > > 
> > > > Will fix.
> > > > 
> > > > > Also, that is where xl abort on migration.
> > > > > 
> > > > 
> > > > Hmm...  This means the device model version is not valid (unknown?).
> > > > 
> > > > Can you paste in your guest config?
> > > 
> > > With all commented line removed:
> > > 
> > > builder = 'hvm'
> > > memory = 500
> > > vcpus = 2
> > > maxvcpus = 6
> > > name = "arch"
> > > vif = [ 'type=ioemu,mac=00:16:3e:XX:XX:XX' ]
> > > disk = [
> > > 'phy:/dev/vg42/guest_arch64,hda,w',
> > >  'file:/root/vm/iso/archlinux-2014.04.01-dual.iso,hdc:cdrom,r',
> > > ]
> > > device_model_args_hvm = [
> > > ]
> > > usbdevice='tablet'
> > > boot="cd"
> > > serial='pty'
> > > sdl = 0
> > > vnc = 1
> > > vnclisten = '0.0.0.0'
> > > vncunused = 1
> > > spice=0
> > > uuid = "XXXX"
> > > 
> > 
> > This means your device model version is LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN
> > so it should be covered by the correct case.
> > 
> > I'm confused.
> 
> If it works for you, I'll properly install Xen with your patch in,
> I may miss something...
> I did:
> LD_LIBRARY_PATH=`pwd` ./xl -vvv migrate arch localhost

I tried again, this time Xen properly installed with your patch series.

sh$ xl create arch.hvm
sh$ xl list
Name                                        ID   Mem VCPUs	State	Time(s)
Domain-0                                     0  4000     8     r-----      25.3
arch                                         1   500     2     -b----       5.4
sh$ xl vcpu-set arch 5
sh$ xl list
Name                                        ID   Mem VCPUs	State	Time(s)
Domain-0                                     0  4000     8     r-----      25.8
arch                                         1   500     5     -b----       6.4

# All fine up to here.

sh$ xl migrate arch localhost
Aborted (core dumped)
sh$  xl save arch savefile
Aborted (core dumped)
sh$ xl save arch savefile ~/arch.hvm
Saving to savefile new xl format (info 0x3/0x0/1540)
xc: info: Saving domain 1, type x86 HVM
xc: Frames: 1044482/1044482  100%
xc: End of stream: 0/0    0%

# So there is only one way to migrate or save the guest.

sh$ xl restore savefile
[...]
libxl: error: libxl_dm.c:2187:device_model_spawn_outcome: domain 2 device model: spawn failed (rc=-3)
[...]

# So restore still fail with this in QEMU log:
qemu-system-i386: Unknown savevm section or instance 'cpu_common' 2
qemu-system-i386: load of migration failed: Invalid argument

-- 
Anthony PERARD

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

  parent reply	other threads:[~2016-06-14 13:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 14:28 [PATCH v2 0/3] libxl: libxl: update available vcpus map in retrieve configuration function Wei Liu
2016-06-08 14:28 ` [PATCH v2 1/3] libxl: introduce libxl__qmp_query_cpus Wei Liu
2016-06-09  0:12   ` Dario Faggioli
2016-06-13 16:52   ` Anthony PERARD
2016-06-13 18:17     ` Wei Liu
2016-06-08 14:28 ` [PATCH v2 2/3] libxl: update vcpus bitmap in retrieved guest config Wei Liu
2016-06-09  0:11   ` Dario Faggioli
2016-06-13 17:39   ` Anthony PERARD
2016-06-13 18:21     ` Wei Liu
2016-06-14 10:47       ` Anthony PERARD
2016-06-14 10:50         ` Wei Liu
2016-06-14 10:58           ` Anthony PERARD
2016-06-14 11:00             ` Wei Liu
2016-06-14 16:27               ` Ian Jackson
2016-06-14 13:20             ` Anthony PERARD [this message]
2016-06-08 14:28 ` [PATCH v2 3/3] libxl: only issue cpu-add call to QEMU for not present CPU Wei Liu
2016-06-08 15:01   ` Jan Beulich
2016-06-13 17:47   ` Anthony PERARD

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=20160614132026.GK5666@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).