nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWsKbsAAoJEEy22O7T6HE4e58QAITA++LhG9ulH0YBtWbY5pnF
 7eTbO/QiDKjepV+/P92SbBVhv7gFROCJdUFqqGs+b8aGolxcyzghZafUE0HWYirR
 JQ8vtF2yHTUN9IAdq/qv2xlukci78PtuDnC2tybXNbIqcOXGOllPq6hVcRSrt8lE
 t5tfF7+Jc0QwTIvLhj5FcMa2kChz5rbp0UAF9hjSufRwfqukFVDhFb3zxJze5226
 V1kpeSAA2WhPnyi+F77NRl7ucOKhfdN816Wkj8xpSCpIrfiuCtTVlKXD+M0FuPU8
 BH6VrQZqGu2WFY5RldKjnMpw2wUTJuavLd/IEfGDC6XgRQUtyTIcNBFxFg02HWM7
 WL5T/BApoRcadzl5MToIRMeEKwaAnmWkGctHY26TfOsbk2dQhXTHzhAYcTRPT/WM
 ag3Vsorr6k8Iwn/yWkGSBGz6LBejh9zq/DsGjeJepFxkQLd4Dw39DzgsBwoLhUcM
 zBRib/p5dF1GFPdpcAOjK1GV4a/rpQYpKJ7DjIjtkA865ocKoEW2fVA8ApRqUh2K
 +JDRnFI7LMG4izshSrNLQbWswaqsuRwcSjU11DepJquGglRBdhvfgKhL3yKXpna7
 a4+XbgrrwMCURNictcgi6WD+Gncw92OMfonki61CrLZhkqhye/TQfseucKYvru7g
 lcvRDp54suBPxviT9OZa
 =tAQf
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-fwcfg-20160202-1' into staging

nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file

# gpg: Signature made Tue 02 Feb 2016 12:54:04 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-fwcfg-20160202-1:
  nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2016-02-02 14:27:12 +00:00
commit dce0238c74

View File

@ -916,45 +916,13 @@ static void nvme_class_init(ObjectClass *oc, void *data)
dc->vmsd = &nvme_vmstate;
}
static void nvme_get_bootindex(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
NvmeCtrl *s = NVME(obj);
visit_type_int32(v, &s->conf.bootindex, name, errp);
}
static void nvme_set_bootindex(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
NvmeCtrl *s = NVME(obj);
int32_t boot_index;
Error *local_err = NULL;
visit_type_int32(v, &boot_index, name, &local_err);
if (local_err) {
goto out;
}
/* check whether bootindex is present in fw_boot_order list */
check_boot_index(boot_index, &local_err);
if (local_err) {
goto out;
}
/* change bootindex to a new one */
s->conf.bootindex = boot_index;
out:
if (local_err) {
error_propagate(errp, local_err);
}
}
static void nvme_instance_init(Object *obj)
{
object_property_add(obj, "bootindex", "int32",
nvme_get_bootindex,
nvme_set_bootindex, NULL, NULL, NULL);
object_property_set_int(obj, -1, "bootindex", NULL);
NvmeCtrl *s = NVME(obj);
device_add_bootindex_property(obj, &s->conf.bootindex,
"bootindex", "/namespace@1,0",
DEVICE(obj), &error_abort);
}
static const TypeInfo nvme_info = {