From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LF9oH-0002mC-JJ for qemu-devel@nongnu.org; Tue, 23 Dec 2008 11:08:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LF9oG-0002m0-58 for qemu-devel@nongnu.org; Tue, 23 Dec 2008 11:08:41 -0500 Received: from [199.232.76.173] (port=45966 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LF9oG-0002lx-26 for qemu-devel@nongnu.org; Tue, 23 Dec 2008 11:08:40 -0500 Received: from mail-bw0-f12.google.com ([209.85.218.12]:41956) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LF9oF-00008m-Kv for qemu-devel@nongnu.org; Tue, 23 Dec 2008 11:08:39 -0500 Received: by bwz5 with SMTP id 5so317605bwz.10 for ; Tue, 23 Dec 2008 08:08:38 -0800 (PST) Message-ID: Date: Tue, 23 Dec 2008 18:06:07 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH] add "serial" parameter to -drive flag In-Reply-To: <20081223132305.GA3435@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081223132305.GA3435@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 12/23/08, Gleb Natapov wrote: > Windows calculates HW "uniqueness" based on a hard drive serial number > among other things. The patch allows to specify drive serial number > from a command line. > > Signed-off-by: Gleb Natapov > - snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); > - snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); > - snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); > + sprintf(s->drive_serial_str, "QM%05d", s->drive_serial); You better watch out, this degrades snprintf to sprintf.