Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-05 Thread Michael S. Tsirkin
On Wed, Oct 05, 2011 at 07:54:21AM -0500, Anthony Liguori wrote: > On 10/04/2011 09:05 PM, Stefan Berger wrote: > >On 10/03/2011 09:43 AM, Anthony Liguori wrote: > >>On 10/03/2011 08:24 AM, Michael S. Tsirkin wrote: > >>>On Mon, Oct 03, 2011 at 07:51:00AM -0500, Anthony Liguori wrote: > >Here a

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-05 Thread Anthony Liguori
On 10/04/2011 09:05 PM, Stefan Berger wrote: On 10/03/2011 09:43 AM, Anthony Liguori wrote: On 10/03/2011 08:24 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 07:51:00AM -0500, Anthony Liguori wrote: Here are some suggestions: - Let's make the protocol be BER directly. As a first step,

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-05 Thread Anthony Liguori
On 10/05/2011 06:28 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 10:00:48AM -0500, Anthony Liguori wrote: Yes, it's easy to quantify. I think the following gives us the offset before and after, so the difference is the size we seek, right? OK, Orit (Cc'd) did some research - this is a

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-05 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 10:00:48AM -0500, Anthony Liguori wrote: > >Yes, it's easy to quantify. I think the following gives us > >the offset before and after, so the difference is the size > >we seek, right? OK, Orit (Cc'd) did some research - this is a booting while still in grub, size probably d

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-04 Thread Stefan Berger
On 10/03/2011 09:43 AM, Anthony Liguori wrote: On 10/03/2011 08:24 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 07:51:00AM -0500, Anthony Liguori wrote: Here are some suggestions: - Let's make the protocol be BER directly. As a first step, use a single octet string for the whole

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 11:05:02AM -0500, Anthony Liguori wrote: > On 10/03/2011 10:45 AM, Michael S. Tsirkin wrote: > >>BTW, putting this info properly into migration stats would probably > >>be pretty useful. > >> > >>Regards, > >> > >>Anthony Liguori > > > >Problem is adding anything to monitor

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Daniel P. Berrange
On Mon, Oct 03, 2011 at 11:05:02AM -0500, Anthony Liguori wrote: > On 10/03/2011 10:45 AM, Michael S. Tsirkin wrote: > >>BTW, putting this info properly into migration stats would probably > >>be pretty useful. > >> > >>Regards, > >> > >>Anthony Liguori > > > >Problem is adding anything to monitor

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 09:15 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: Having the ability to ignore some fields is not enough. But it is also really required. I agree. It's the principle of being conservative in what you send and liberal in what

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 10:45 AM, Michael S. Tsirkin wrote: BTW, putting this info properly into migration stats would probably be pretty useful. Regards, Anthony Liguori Problem is adding anything to monitor makes me worry about future compatibility so much I usually just give up. IMO we really need a

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 10:58 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 10:44:45AM -0500, Anthony Liguori wrote: Specifically the case where first field in a sequence tells you the meaning of the following ones? Can you give me the example in ASN.1? Regards, Anthony Liguori That would be

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 10:44:45AM -0500, Anthony Liguori wrote: > >>>Specifically > >>>the case where first field in a sequence tells > >>>you the meaning of the following ones? > >> > >>Can you give me the example in ASN.1? > >> > >>Regards, > >> > >>Anthony Liguori > > > >That would be a selecti

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 10:00:48AM -0500, Anthony Liguori wrote: > On 10/03/2011 09:41 AM, Michael S. Tsirkin wrote: > >On Mon, Oct 03, 2011 at 08:51:10AM -0500, Anthony Liguori wrote: > >>On 10/03/2011 08:38 AM, Michael S. Tsirkin wrote: > >>>On Mon, Oct 03, 2011 at 07:55:48AM -0500, Anthony Liguo

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 10:29 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 09:42:02AM -0500, Anthony Liguori wrote: On 10/03/2011 09:11 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: visit_start_array(v, "entries", errp); for (int i = 0; i

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 09:56:47AM -0500, Anthony Liguori wrote: > On 10/03/2011 09:18 AM, Michael S. Tsirkin wrote: > >>skip_indefinite: > >> while tag != CANARY: > >> if tag == INT: > >> visit_type_int(v, NULL, NULL, errp); > >> elif tag == STRING: > >> visit_type_str(v, NUL

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 09:55:45AM -0500, Anthony Liguori wrote: > How I see this all evolving in the future is that we would have a > formal protocol specification. From that spec, we would generate > Visitors. This would handle taking what's on the wire and building > an in-memory tree. If an

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 09:42:02AM -0500, Anthony Liguori wrote: > On 10/03/2011 09:11 AM, Michael S. Tsirkin wrote: > >On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: > visit_start_array(v, "entries", errp); > for (int i = 0; i< s->size; i++) { > visit_type_int(

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 09:41 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 08:51:10AM -0500, Anthony Liguori wrote: On 10/03/2011 08:38 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 07:55:48AM -0500, Anthony Liguori wrote: On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: On Sun, Oct 0

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 09:18 AM, Michael S. Tsirkin wrote: skip_indefinite: while tag != CANARY: if tag == INT: visit_type_int(v, NULL, NULL, errp); elif tag == STRING: visit_type_str(v, NULL, NULL, errp); elif tag == INDEFINITE: visit_start_struct(v, NULL, NULL, err

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 09:11 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: visit_start_array(v, "entries", errp); for (int i = 0; i< s->size; i++) { visit_type_int(v, NULL,&s->entry[i], errp); } visit_end_array(v, errp); Sequences can encode struc

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 08:51:10AM -0500, Anthony Liguori wrote: > On 10/03/2011 08:38 AM, Michael S. Tsirkin wrote: > >On Mon, Oct 03, 2011 at 07:55:48AM -0500, Anthony Liguori wrote: > >>On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: > >>>On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 08:48:05AM -0500, Anthony Liguori wrote: > On 10/03/2011 08:30 AM, Michael S. Tsirkin wrote: > >On Mon, Oct 03, 2011 at 08:18:31AM -0500, Anthony Liguori wrote: > >>On 10/03/2011 08:10 AM, Stefan Berger wrote: > >>>I am doing that. Indefinite length encoding *would* be a pro

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: > Having the ability to ignore some fields is not enough. But it is also really required. > We need to > also be able to split a single field into multiple fields, and event > split a single device into multiple devices. If we're d

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 08:43:54AM -0500, Anthony Liguori wrote: > >>visit_start_array(v, "entries", errp); > >>for (int i = 0; i< s->size; i++) { > >> visit_type_int(v, NULL,&s->entry[i], errp); > >>} > >>visit_end_array(v, errp); > > > >Sequences can encode structures not just arrays. > >How

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 08:38 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 07:55:48AM -0500, Anthony Liguori wrote: On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger wrote: 4) Implement the BERVisitor and make this the default migration

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 08:30 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 08:18:31AM -0500, Anthony Liguori wrote: On 10/03/2011 08:10 AM, Stefan Berger wrote: I am doing that. Indefinite length encoding *would* be a problem because you cannot push the size onto the stack so that you could skip

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 08:24 AM, Michael S. Tsirkin wrote: On Mon, Oct 03, 2011 at 07:51:00AM -0500, Anthony Liguori wrote: Here are some suggestions: - Let's make the protocol be BER directly. As a first step, use a single octet string for the whole of data. Next, start splitting this up. This

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 07:55:48AM -0500, Anthony Liguori wrote: > On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: > >On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger wrote: > >> > >>>4) Implement the BERVisitor and make this the default migration protocol. > >>> > >>>Most of the work will

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 08:18:31AM -0500, Anthony Liguori wrote: > On 10/03/2011 08:10 AM, Stefan Berger wrote: > >I am doing that. Indefinite length encoding *would* be a problem because you > >cannot push the size onto the stack so that you could skip to the end of the > >structure. > > For an i

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Michael S. Tsirkin
On Mon, Oct 03, 2011 at 07:51:00AM -0500, Anthony Liguori wrote: > >Here are some suggestions: > > > >- Let's make the protocol be BER directly. > > As a first step, use a single octet string for > > the whole of data. Next, start splitting this up. > > This can't be done without breaking the

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 08:10 AM, Stefan Berger wrote: I am doing that. Indefinite length encoding *would* be a problem because you cannot push the size onto the stack so that you could skip to the end of the structure. For an indefinite length encoding, you just have to keep reading the stream at end_s

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Stefan Berger
On 10/03/2011 08:55 AM, Anthony Liguori wrote: On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger wrote: 4) Implement the BERVisitor and make this the default migration protocol. Most of the work will be in 1), though with the implement

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/02/2011 04:08 PM, Michael S. Tsirkin wrote: On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger wrote: 4) Implement the BERVisitor and make this the default migration protocol. Most of the work will be in 1), though with the implementation in this series we should be able to do it

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-03 Thread Anthony Liguori
On 10/03/2011 01:46 AM, Michael S. Tsirkin wrote: On Mon, Sep 19, 2011 at 09:41:41AM -0500, Michael Roth wrote: OVERVIEW This patch series implements a QEMUFile Visitor class that's intended to abstract away direct calls to qemu_put_*/qemu_get_* for save/load functions. Currently this is done

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-02 Thread Michael S. Tsirkin
On Mon, Sep 19, 2011 at 09:41:41AM -0500, Michael Roth wrote: > OVERVIEW > > This patch series implements a QEMUFile Visitor class that's intended to > abstract away direct calls to qemu_put_*/qemu_get_* for save/load functions. > Currently this is done by always creating a > QEMUFileInputVisit

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-02 Thread Michael S. Tsirkin
On Sun, Oct 02, 2011 at 04:21:47PM -0400, Stefan Berger wrote: > > >4) Implement the BERVisitor and make this the default migration protocol. > > > >Most of the work will be in 1), though with the implementation in this > >series we should be able to do it incrementally. I'm not sure if the best

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-10-02 Thread Stefan Berger
4) Implement the BERVisitor and make this the default migration protocol. Most of the work will be in 1), though with the implementation in this series we should be able to do it incrementally. I'm not sure if the best approach is doing the mechanical phase 1 conversion, then doing phase 2 so

[Qemu-devel] [RFC] New Migration Protocol using Visitor Interface

2011-09-19 Thread Michael Roth
OVERVIEW This patch series implements a QEMUFile Visitor class that's intended to abstract away direct calls to qemu_put_*/qemu_get_* for save/load functions. Currently this is done by always creating a QEMUFileInputVisitor/QEMUFileOutputVisitor pair with each call to qemu_fopen_ops() and main