[Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-20 Thread Boris Ostrovsky
When parsing bitmap objects JSON parser will create libxl_bitmap map of the smallest size needed. This can cause problems when saved image file specifies CPU affinity. For example, if 'vcpu_hard_affinity' in the saved image has only the first CPU specified, just a single byte will be allocated and

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-21 Thread Wei Liu
On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: > When parsing bitmap objects JSON parser will create libxl_bitmap > map of the smallest size needed. > > This can cause problems when saved image file specifies CPU affinity. > For example, if 'vcpu_hard_affinity' in the saved image

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-21 Thread Dario Faggioli
On Thu, 2014-11-20 at 16:27 -0500, Boris Ostrovsky wrote: > diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c > index 58df4f3..2a08bef 100644 > --- a/tools/libxl/libxl_utils.c > +++ b/tools/libxl/libxl_utils.c > @@ -614,6 +614,13 @@ void libxl_bitmap_copy(libxl_ctx *ctx, libxl_bit

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-21 Thread Boris Ostrovsky
On 11/21/2014 06:12 AM, Wei Liu wrote: On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: When parsing bitmap objects JSON parser will create libxl_bitmap map of the smallest size needed. This can cause problems when saved image file specifies CPU affinity. For example, if 'vcpu_h

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-21 Thread Boris Ostrovsky
On 11/21/2014 06:26 AM, Dario Faggioli wrote: On Thu, 2014-11-20 at 16:27 -0500, Boris Ostrovsky wrote: diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c index 58df4f3..2a08bef 100644 --- a/tools/libxl/libxl_utils.c +++ b/tools/libxl/libxl_utils.c @@ -614,6 +614,13 @@ void libx

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-24 Thread Wei Liu
On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: > When parsing bitmap objects JSON parser will create libxl_bitmap > map of the smallest size needed. > > This can cause problems when saved image file specifies CPU affinity. > For example, if 'vcpu_hard_affinity' in the saved image

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-24 Thread Wei Liu
CC'ing Dario... On Mon, Nov 24, 2014 at 10:41:27AM +, Wei Liu wrote: > On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: > > When parsing bitmap objects JSON parser will create libxl_bitmap > > map of the smallest size needed. > > > > This can cause problems when saved image fi

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-24 Thread Boris Ostrovsky
On 11/24/2014 05:47 AM, Wei Liu wrote: CC'ing Dario... On Mon, Nov 24, 2014 at 10:41:27AM +, Wei Liu wrote: On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: When parsing bitmap objects JSON parser will create libxl_bitmap map of the smallest size needed. This can cause pro

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Dario Faggioli
On Mon, 2014-11-24 at 10:48 -0500, Boris Ostrovsky wrote: > On 11/24/2014 05:47 AM, Wei Liu wrote: > >> > >> The partial copy function should explicitly zero-out all remaining bits. > > I actually thought that partial copy function should do just that --- > copy bits that it has and leave others

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Wei Liu
On Tue, Nov 25, 2014 at 10:42:58AM +0100, Dario Faggioli wrote: > On Mon, 2014-11-24 at 10:48 -0500, Boris Ostrovsky wrote: > > On 11/24/2014 05:47 AM, Wei Liu wrote: > > > >> > > >> The partial copy function should explicitly zero-out all remaining bits. > > > > I actually thought that partial c

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Wei Liu
On Mon, Nov 24, 2014 at 10:48:19AM -0500, Boris Ostrovsky wrote: > On 11/24/2014 05:47 AM, Wei Liu wrote: > >CC'ing Dario... > > > >On Mon, Nov 24, 2014 at 10:41:27AM +, Wei Liu wrote: > >>On Thu, Nov 20, 2014 at 04:27:34PM -0500, Boris Ostrovsky wrote: > >>>When parsing bitmap objects JSON par

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Wei Liu
And here it is. Boris, can you give it a shot? ---8<--- >From 77531e31d239887b9f36c03e434300bc30683092 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 25 Nov 2014 10:59:47 + Subject: [PATCH] libxl: allow copying between bitmaps of different sizes When parsing bitmap objects JSON parser wi

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Dario Faggioli
On Tue, 2014-11-25 at 11:15 +, Wei Liu wrote: > And here it is. > > Boris, can you give it a shot? > > ---8<--- > From 77531e31d239887b9f36c03e434300bc30683092 Mon Sep 17 00:00:00 2001 > From: Wei Liu > Date: Tue, 25 Nov 2014 10:59:47 + > Subject: [PATCH] libxl: allow copying between bit

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Boris Ostrovsky
On 11/25/2014 06:41 AM, Dario Faggioli wrote: On Tue, 2014-11-25 at 11:15 +, Wei Liu wrote: And here it is. Boris, can you give it a shot? ---8<--- From 77531e31d239887b9f36c03e434300bc30683092 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 25 Nov 2014 10:59:47 + Subject: [PATCH]

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-25 Thread Konrad Rzeszutek Wilk
On Tue, Nov 25, 2014 at 09:57:54AM -0500, Boris Ostrovsky wrote: > On 11/25/2014 06:41 AM, Dario Faggioli wrote: > >On Tue, 2014-11-25 at 11:15 +, Wei Liu wrote: > >>And here it is. > >> > >>Boris, can you give it a shot? > >> > >>---8<--- > >> From 77531e31d239887b9f36c03e434300bc30683092 Mon

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-26 Thread Ian Campbell
On Tue, 2014-11-25 at 11:15 +, Wei Liu wrote: > This will result in assertion in libxl_set_vcpuaffinity()->libxl_bitmap_copy() > since the destination bitmap is created for maximum number of CPUs. FYI I'm also seeing this with libvirt (on ARM, but I don't think that matters) when the guest XML

Re: [Xen-devel] [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one

2014-11-28 Thread Ian Campbell
On Tue, 2014-11-25 at 10:54 -0500, Konrad Rzeszutek Wilk wrote: > > >>Reported-by: Boris Ostrovsky > > >>Signed-off-by: Wei Liu > > >>Cc: Ian Campbell > > >>Cc: Ian Jackson > > >>Cc: Dario Faggioli > > >> > > >If this end up being the approach, it can have the following: > > > > > >Reviewed-by