Revision aa2c91bd blockdev.c

b/blockdev.c
532 532
    dinfo->unit = unit_id;
533 533
    dinfo->opts = opts;
534 534
    dinfo->refcount = 1;
535
    if (serial)
536
        strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1);
535
    if (serial) {
536
        pstrcpy(dinfo->serial, sizeof(dinfo->serial), serial);
537
    }
537 538
    QTAILQ_INSERT_TAIL(&drives, dinfo, next);
538 539

  
539 540
    bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error);

Also available in: Unified diff