From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UowbS-0006YH-RY for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:09:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UowbR-0007O1-Ld for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:09:46 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:53829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UowbR-0007Nt-En for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:09:45 -0400 Received: by mail-wi0-f170.google.com with SMTP id ey16so5241725wid.1 for ; Tue, 18 Jun 2013 07:09:44 -0700 (PDT) Date: Tue, 18 Jun 2013 16:09:39 +0200 From: Stefan Hajnoczi Message-ID: <20130618140939.GN7649@stefanha-thinkpad.redhat.com> References: <1371209999-15579-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1371209999-15579-8-git-send-email-xiawenc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371209999-15579-8-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH V2 07/12] qmp: add internal snapshot support in qmp_transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, phrdina@redhat.com, famz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, dietmar@proxmox.com On Fri, Jun 14, 2013 at 07:39:54PM +0800, Wenchao Xia wrote: > + /* Forbid having a name similar to id, empty name is also forbidden. */ > + if (!snapshot_name_wellformed(name)) { > + error_setg(errp, "Name %s on device %s is not a valid one", Please use '%s' instead of just %s for arguments in error messages. This will make the message easier to understand, especially when name is empty. It's also consistent with the rest of blockdev.c. > + name, device); > + return; > + } > + > + /* 3. take the snapshot */ > + sn1 = &state->sn; > + pstrcpy(sn1->name, sizeof(sn1->name), name); > + qemu_gettimeofday(&tv); > + sn1->date_sec = tv.tv_sec; > + sn1->date_nsec = tv.tv_usec * 1000; > + /* not good to use vm_clock in block layer, but that is what we can do now, > + or drop it later, since it is an emulater concept. */ It's appropriate here and blockdev.c is emulator code, so you can drop the comment.