Received: from eggs.gnu.org ([2001:4830:134:3::10]:38316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPug8-0005oE-2Z for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPug3-000651-UK for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:28 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:37273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPug3-00064q-Jt for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:23 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Aug 2015 16:44:20 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 101D517D8056 for ; Thu, 13 Aug 2015 16:45:51 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7DFiHHk29098190 for ; Thu, 13 Aug 2015 15:44:17 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7DFiGsm001877 for ; Thu, 13 Aug 2015 09:44:17 -0600 Message-ID: <55CCBB50.9050605@de.ibm.com> Date: Thu, 13 Aug 2015 17:44:16 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1437400198-25382-1-git-send-email-cornelia.huck@de.ibm.com> <1437400198-25382-8-git-send-email-cornelia.huck@de.ibm.com> <55ADFE0B.1090407@redhat.com> <20150721123718.6ab0b668@thinkpad-w530> In-Reply-To: <20150721123718.6ab0b668@thinkpad-w530> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.5 7/8] s390x: Migrate guest storage keys (initial memory only) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand , Thomas Huth , jjherne@linux.vnet.ibm.com Cc: Cornelia Huck , jfrei@linux.vnet.ibm.com, qemu-devel@nongnu.org, agraf@suse.de Am 21.07.2015 um 12:37 schrieb David Hildenbrand: >> >> So if I've got this code right, you send here a "header" that announces >> a packet with all pages ... >> >>> + while (handled_count < total_count) { >>> + cur_count = MIN(total_count - handled_count, S390_SKEYS_BUFFER_SIZE); >>> + >>> + ret = skeyclass->get_skeys(ss, cur_gfn, cur_count, buf); >>> + if (ret < 0) { >>> + error_report("S390_GET_KEYS error %d\n", ret); >>> + break; >> >> ... but when an error occurs here, you suddenly stop in the middle of >> that "packet" with all pages ... > > Indeed, although that should never fail, we never know. I think -ENOMEM would be a possible return code. > We don't want to overengineer the protocol but still abort migration at least > on the loading side in that (theoretical) case. [..] >>> +end_stream: >>> + qemu_put_be64(f, S390_SKEYS_SAVE_FLAG_EOS); what about sending zeroes for failed keys defining an error code #define S390_SKEYS_SAVE_FLAG_EOS 0x01 #define S390_SKEYS_SAVE_FLAG_SKEYS 0x02 +#define S390_SKEYS_SAVE_FLAG_FAILED 0x03 and then do if (ok) { qemu_put_be64(f, S390_SKEYS_SAVE_FLAG_EOS); } else { qemu_put_be64(f, S390_SKEYS_SAVE_FLAG_FAILED); } and the let target system fail migration (which should let the guest run at the source system?)