qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ide: Adds "model=s" option, allowing the user t


From: Floris Bos / Maxnet
Subject: Re: [Qemu-devel] [PATCH] ide: Adds "model=s" option, allowing the user to override the default disk model name "QEMU HARDDISK"
Date: Mon, 12 Mar 2012 12:30:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 03/12/2012 11:26 AM, Stefan Hajnoczi wrote:
On Sat, Mar 10, 2012 at 7:56 PM, Floris Bos<address@hidden>  wrote:
@@ -1885,6 +1885,22 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, 
IDEDriveKind kind,
         snprintf(s->drive_serial_str, sizeof(s->drive_serial_str),
                  "QM%05d", s->drive_serial);
     }
+    if (model) {
+        strncpy(s->drive_model_str, model, sizeof(s->drive_model_str));
strncpy(3) does not NUL-terminate if the max length is reached.
Either you need to use pstrcpy() or specify sizeof(s->drive_model_str)
- 1 and make sure s->drive_model_str[40] = '\0'.

Thanks for the feedback.

Will change that line (and serial that used strncpy() as well) to pstrcpy(), correct the cosmetic issues mentioned by Andreas and submit a v2 patch.

--
Yours sincerely,

Floris Bos




reply via email to

[Prev in Thread] Current Thread [Next in Thread]