blockdev: Keep a copy of DriveInfo.serial

Pointing to a QemuOpts element is surprising and can lead to subtle
use-after-free errors when the QemuOpts is freed after all options are
parsed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2013-03-15 10:35:06 +01:00 committed by Stefan Hajnoczi
parent 376609cc6c
commit bb44619b06
2 changed files with 5 additions and 2 deletions

View file

@ -40,7 +40,7 @@ struct DriveInfo {
int media_cd;
int cyls, heads, secs, trans;
QemuOpts *opts;
const char *serial;
char *serial;
QTAILQ_ENTRY(DriveInfo) next;
int refcount;
};