mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
spapr: tie spapr-nvram to -pflash
spapr-nvram's drive property is currently connected to a non-existent "-machine nvram=<drivename>" option. Instead, tie it to -pflash like other non-volatile RAM devices. This provides the following possibilities for adding a backend for the sPAPR non-volatile RAM: * -pflash filename * -drive if=pflash,file=filename,format=raw,... * -drive if=none,file=filename,format=raw,id=foo,... -global spapr-nvram.drive=foo Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
8a0e11045d
commit
3978b863a5
@ -739,18 +739,10 @@ static void spapr_cpu_reset(void *opaque)
|
||||
static void spapr_create_nvram(sPAPREnvironment *spapr)
|
||||
{
|
||||
DeviceState *dev = qdev_create(&spapr->vio_bus->bus, "spapr-nvram");
|
||||
const char *drivename = qemu_opt_get(qemu_get_machine_opts(), "nvram");
|
||||
DriveInfo *dinfo = drive_get(IF_PFLASH, 0, 0);
|
||||
|
||||
if (drivename) {
|
||||
BlockDriverState *bs;
|
||||
|
||||
bs = bdrv_find(drivename);
|
||||
if (!bs) {
|
||||
fprintf(stderr, "No such block device \"%s\" for nvram\n",
|
||||
drivename);
|
||||
exit(1);
|
||||
}
|
||||
qdev_prop_set_drive_nofail(dev, "drive", bs);
|
||||
if (dinfo) {
|
||||
qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
|
||||
}
|
||||
|
||||
qdev_init_nofail(dev);
|
||||
|
Loading…
Reference in New Issue
Block a user