mirror of https://gitee.com/openkylin/qemu.git
NUMA queue, 2015-12-18
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJWdEgsAAoJECgHk2+YTcWm1J8P/0tI1tGWpq5CAEtewpmlEXLC +Ld7DBe6OMgW4CB3f/WqG7JqOfzPGrbPzaI22+gzMxZit6qPLqetwNYyxo2iTM/Y HZPSwN9uRQRSq4GB/jtG6k8cDtSpBEdLdEtXlsd5UCTWc1h6zDiiLdDD3wIXchI6 EUp7XgWD2aepRi5bCMb1S3kOPWo8wAq2D4XmiRDR+m/IuXDeCTr5o1mGAUo4mSfz QwxOu7r9LfdGN5D2cHXm4GQG11ajqJsZXyKtEFbmCClRrVwaSb7iCxPxi2wWQL2U 26Y+PkgTlg+WhgV6vhAAkz2ypdOoPtvWvEEwSmsS8F4+xDaiT/KN7KjFwPP7UO4O htXLq2Hut9XKesLw98rqVfi9kyBCYPX9kVdf1Kz6vfmZbj34+ze/ps0iygUKznKs CN1vpu0cPpumcPNRdPpkrF5qn4PKyp4RoiCft/vqL7MBSBo+728j0zZFsnTYgp46 Tmn5n/rown7Apx4xS89XxhwQ0yKPMbghf7kirDNLEGltX94P5Lnqp1xvYOpSYnPz FvIFk+CgpB39lo8/or58Cff7XPPfA8mr79zRl1AtSpUFrhgaFV2Yqt8SAlFUh8zG si2R1YUId8tdnnn5uQ9Aiq1ZiYV0JYh+8FOYBqp723SsiTGGcMGQkboQKBGkager BRAvPHLSpkuBbOueEd4k =KG6V -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging NUMA queue, 2015-12-18 # gpg: Signature made Fri 18 Dec 2015 17:53:48 GMT using RSA key ID 984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" * remotes/ehabkost/tags/numa-pull-request: numa: Clean up query-memdev error handling Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
c595b21888
59
numa.c
59
numa.c
|
@ -517,7 +517,6 @@ static int query_memdev(Object *obj, void *opaque)
|
|||
{
|
||||
MemdevList **list = opaque;
|
||||
MemdevList *m = NULL;
|
||||
Error *err = NULL;
|
||||
|
||||
if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
|
||||
m = g_malloc0(sizeof(*m));
|
||||
|
@ -525,72 +524,34 @@ static int query_memdev(Object *obj, void *opaque)
|
|||
m->value = g_malloc0(sizeof(*m->value));
|
||||
|
||||
m->value->size = object_property_get_int(obj, "size",
|
||||
&err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
&error_abort);
|
||||
m->value->merge = object_property_get_bool(obj, "merge",
|
||||
&err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
&error_abort);
|
||||
m->value->dump = object_property_get_bool(obj, "dump",
|
||||
&err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
&error_abort);
|
||||
m->value->prealloc = object_property_get_bool(obj,
|
||||
"prealloc", &err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
"prealloc",
|
||||
&error_abort);
|
||||
m->value->policy = object_property_get_enum(obj,
|
||||
"policy",
|
||||
"HostMemPolicy",
|
||||
&err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
&error_abort);
|
||||
object_property_get_uint16List(obj, "host-nodes",
|
||||
&m->value->host_nodes, &err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
&m->value->host_nodes,
|
||||
&error_abort);
|
||||
|
||||
m->next = *list;
|
||||
*list = m;
|
||||
}
|
||||
|
||||
return 0;
|
||||
error:
|
||||
g_free(m->value);
|
||||
g_free(m);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
MemdevList *qmp_query_memdev(Error **errp)
|
||||
{
|
||||
Object *obj;
|
||||
Object *obj = object_get_objects_root();
|
||||
MemdevList *list = NULL;
|
||||
|
||||
obj = object_get_objects_root();
|
||||
if (obj == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (object_child_foreach(obj, query_memdev, &list) != 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
object_child_foreach(obj, query_memdev, &list);
|
||||
return list;
|
||||
|
||||
error:
|
||||
qapi_free_MemdevList(list);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue