Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
3853528a
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3853528a
编写于
5月 24, 2010
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'qmp/for-anthony' into staging
上级
16f04416
41836a9f
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
143 addition
and
117 deletion
+143
-117
QMP/qmp-spec.txt
QMP/qmp-spec.txt
+55
-0
check-qdict.c
check-qdict.c
+3
-0
check-qfloat.c
check-qfloat.c
+0
-5
check-qint.c
check-qint.c
+3
-0
check-qlist.c
check-qlist.c
+2
-2
check-qstring.c
check-qstring.c
+3
-0
hw/pci-hotplug.c
hw/pci-hotplug.c
+7
-44
monitor.c
monitor.c
+3
-1
qbool.c
qbool.c
+0
-8
qdict.c
qdict.c
+3
-3
qdict.h
qdict.h
+12
-0
qemu-monitor.hx
qemu-monitor.hx
+2
-4
qemu-objects.h
qemu-objects.h
+3
-2
qerror.c
qerror.c
+1
-1
qerror.h
qerror.h
+1
-1
qfloat.c
qfloat.c
+0
-8
qint.c
qint.c
+4
-3
qint.h
qint.h
+12
-0
qlist.c
qlist.c
+4
-3
qlist.h
qlist.h
+4
-3
qobject.h
qobject.h
+2
-2
qstring.c
qstring.c
+4
-3
qstring.h
qstring.h
+12
-0
sysemu.h
sysemu.h
+3
-6
vl.c
vl.c
+0
-18
未找到文件。
QMP/qmp-spec.txt
浏览文件 @
3853528a
...
...
@@ -215,3 +215,58 @@ Additionally, Clients must not assume any particular:
- Order of json-object members or json-array elements
- Amount of errors generated by a command, that is, new errors can be added
to any existing command in newer versions of the Server
6. Downstream extension of QMP
------------------------------
We recommend that downstream consumers of QEMU do *not* modify QMP.
Management tools should be able to support both upstream and downstream
versions of QMP without special logic, and downstream extensions are
inherently at odds with that.
However, we recognize that it is sometimes impossible for downstreams to
avoid modifying QMP. Both upstream and downstream need to take care to
preserve long-term compatibility and interoperability.
To help with that, QMP reserves JSON object member names beginning with
'__' (double underscore) for downstream use ("downstream names"). This
means upstream will never use any downstream names for its commands,
arguments, errors, asynchronous events, and so forth.
Any new names downstream wishes to add must begin with '__'. To
ensure compatibility with other downstreams, it is strongly
recommended that you prefix your downstram names with '__RFQDN_' where
RFQDN is a valid, reverse fully qualified domain name which you
control. For example, a qemu-kvm specific monitor command would be:
(qemu) __org.linux-kvm_enable_irqchip
Downstream must not change the server greeting (section 2.2) other than
to offer additional capabilities. But see below for why even that is
discouraged.
Section '5 Compatibility Considerations' applies to downstream as well
as to upstream, obviously. It follows that downstream must behave
exactly like upstream for any input not containing members with
downstream names ("downstream members"), except it may add members
with downstream names to its output.
Thus, a client should not be able to distinguish downstream from
upstream as long as it doesn't send input with downstream members, and
properly ignores any downstream members in the output it receives.
Advice on downstream modifications:
1. Introducing new commands is okay. If you want to extend an existing
command, consider introducing a new one with the new behaviour
instead.
2. Introducing new asynchronous messages is okay. If you want to extend
an existing message, consider adding a new one instead.
3. Introducing new errors for use in new commands is okay. Adding new
errors to existing commands counts as extension, so 1. applies.
4. New capabilities are strongly discouraged. Capabilities are for
evolving the basic protocol, and multiple diverging basic protocol
dialects are most undesirable.
check-qdict.c
浏览文件 @
3853528a
...
...
@@ -5,6 +5,9 @@
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#include <check.h>
...
...
check-qfloat.c
浏览文件 @
3853528a
/*
* QFloat unit-tests.
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* Copyright IBM, Corp. 2009
*
* Authors:
...
...
check-qint.c
浏览文件 @
3853528a
...
...
@@ -5,6 +5,9 @@
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#include <check.h>
...
...
check-qlist.c
浏览文件 @
3853528a
...
...
@@ -6,8 +6,8 @@
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#include <check.h>
...
...
check-qstring.c
浏览文件 @
3853528a
...
...
@@ -5,6 +5,9 @@
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#include <check.h>
...
...
hw/pci-hotplug.c
浏览文件 @
3853528a
...
...
@@ -33,7 +33,6 @@
#include "scsi.h"
#include "virtio-blk.h"
#include "qemu-config.h"
#include "qemu-objects.h"
#if defined(TARGET_I386)
static
PCIDevice
*
qemu_pci_hot_add_nic
(
Monitor
*
mon
,
...
...
@@ -224,36 +223,7 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
return
dev
;
}
void
pci_device_hot_add_print
(
Monitor
*
mon
,
const
QObject
*
data
)
{
QDict
*
qdict
;
assert
(
qobject_type
(
data
)
==
QTYPE_QDICT
);
qdict
=
qobject_to_qdict
(
data
);
monitor_printf
(
mon
,
"OK domain %d, bus %d, slot %d, function %d
\n
"
,
(
int
)
qdict_get_int
(
qdict
,
"domain"
),
(
int
)
qdict_get_int
(
qdict
,
"bus"
),
(
int
)
qdict_get_int
(
qdict
,
"slot"
),
(
int
)
qdict_get_int
(
qdict
,
"function"
));
}
/**
* pci_device_hot_add(): Hot add a PCI device
*
* Return a QDict with the following device information:
*
* - "domain": domain number
* - "bus": bus number
* - "slot": slot number
* - "function": function number
*
* Example:
*
* { "domain": 0, "bus": 0, "slot": 5, "function": 0 }
*/
int
pci_device_hot_add
(
Monitor
*
mon
,
const
QDict
*
qdict
,
QObject
**
ret_data
)
void
pci_device_hot_add
(
Monitor
*
mon
,
const
QDict
*
qdict
)
{
PCIDevice
*
dev
=
NULL
;
const
char
*
pci_addr
=
qdict_get_str
(
qdict
,
"pci_addr"
);
...
...
@@ -278,20 +248,14 @@ int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
dev
=
qemu_pci_hot_add_storage
(
mon
,
pci_addr
,
opts
);
}
else
{
monitor_printf
(
mon
,
"invalid type: %s
\n
"
,
type
);
return
-
1
;
}
if
(
dev
)
{
*
ret_data
=
qobject_from_jsonf
(
"{ 'domain': 0, 'bus': %d, 'slot': %d, "
"'function': %d }"
,
pci_bus_num
(
dev
->
bus
),
PCI_SLOT
(
dev
->
devfn
),
PCI_FUNC
(
dev
->
devfn
));
}
else
{
monitor_printf
(
mon
,
"OK domain %d, bus %d, slot %d, function %d
\n
"
,
0
,
pci_bus_num
(
dev
->
bus
),
PCI_SLOT
(
dev
->
devfn
),
PCI_FUNC
(
dev
->
devfn
));
}
else
monitor_printf
(
mon
,
"failed to add %s
\n
"
,
opts
);
return
-
1
;
}
return
0
;
}
#endif
...
...
@@ -313,8 +277,7 @@ int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
return
qdev_unplug
(
&
d
->
qdev
);
}
int
do_pci_device_hot_remove
(
Monitor
*
mon
,
const
QDict
*
qdict
,
QObject
**
ret_data
)
void
do_pci_device_hot_remove
(
Monitor
*
mon
,
const
QDict
*
qdict
)
{
return
pci_device_hot_remove
(
mon
,
qdict_get_str
(
qdict
,
"pci_addr"
));
pci_device_hot_remove
(
mon
,
qdict_get_str
(
qdict
,
"pci_addr"
));
}
monitor.c
浏览文件 @
3853528a
...
...
@@ -1021,7 +1021,9 @@ static void do_info_cpu_stats(Monitor *mon)
static
int
do_quit
(
Monitor
*
mon
,
const
QDict
*
qdict
,
QObject
**
ret_data
)
{
monitor_suspend
(
mon
);
qemu_system_exit_request
();
no_shutdown
=
0
;
qemu_system_shutdown_request
();
return
0
;
}
...
...
qbool.c
浏览文件 @
3853528a
/*
* QBool Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*
* Copyright IBM, Corp. 2009
*
* Authors:
...
...
qdict.c
浏览文件 @
3853528a
/*
* QDict
data type.
* QDict
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#include "qint.h"
...
...
qdict.h
浏览文件 @
3853528a
/*
* QDict Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#ifndef QDICT_H
#define QDICT_H
...
...
qemu-monitor.hx
浏览文件 @
3853528a
...
...
@@ -858,8 +858,7 @@ ETEXI
.args_type = "pci_addr:s,type:s,opts:s?",
.params = "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
.help = "hot-add PCI device",
.user_print = pci_device_hot_add_print,
.mhandler.cmd_new = pci_device_hot_add,
.mhandler.cmd = pci_device_hot_add,
},
#endif
...
...
@@ -875,8 +874,7 @@ ETEXI
.args_type = "pci_addr:s",
.params = "[[<domain>:]<bus>:]<slot>",
.help = "hot remove PCI device",
.user_print = monitor_user_noop,
.mhandler.cmd_new = do_pci_device_hot_remove,
.mhandler.cmd = do_pci_device_hot_remove,
},
#endif
...
...
qemu-objects.h
浏览文件 @
3853528a
...
...
@@ -6,9 +6,10 @@
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#ifndef QEMU_OBJECTS_H
#define QEMU_OBJECTS_H
...
...
qerror.c
浏览文件 @
3853528a
/*
* QError
: QEMU Error data-type.
* QError
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
...
...
qerror.h
浏览文件 @
3853528a
/*
* QError
header file.
* QError
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
...
...
qfloat.c
浏览文件 @
3853528a
/*
* QFloat Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*
* Copyright IBM, Corp. 2009
*
* Authors:
...
...
qint.c
浏览文件 @
3853528a
/*
* QInt
data type.
* QInt
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#include "qint.h"
#include "qobject.h"
#include "qemu-common.h"
...
...
qint.h
浏览文件 @
3853528a
/*
* QInt Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#ifndef QINT_H
#define QINT_H
...
...
qlist.c
浏览文件 @
3853528a
/*
* QList
data type.
* QList
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#include "qlist.h"
#include "qobject.h"
#include "qemu-queue.h"
...
...
qlist.h
浏览文件 @
3853528a
/*
* QList
data type header.
* QList
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#ifndef QLIST_H
#define QLIST_H
...
...
qobject.h
浏览文件 @
3853528a
...
...
@@ -8,8 +8,8 @@
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*
* QObject Reference Counts Terminology
* ------------------------------------
...
...
qstring.c
浏览文件 @
3853528a
/*
* QString
data type.
* QString
Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU
GPL, version 2. See
*
the COPYING
file in the top-level directory.
* This work is licensed under the terms of the GNU
LGPL, version 2.1 or later.
*
See the COPYING.LIB
file in the top-level directory.
*/
#include "qobject.h"
#include "qstring.h"
#include "qemu-common.h"
...
...
qstring.h
浏览文件 @
3853528a
/*
* QString Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#ifndef QSTRING_H
#define QSTRING_H
...
...
sysemu.h
浏览文件 @
3853528a
...
...
@@ -45,11 +45,9 @@ void cpu_disable_ticks(void);
void
qemu_system_reset_request
(
void
);
void
qemu_system_shutdown_request
(
void
);
void
qemu_system_powerdown_request
(
void
);
void
qemu_system_exit_request
(
void
);
int
qemu_shutdown_requested
(
void
);
int
qemu_reset_requested
(
void
);
int
qemu_powerdown_requested
(
void
);
int
qemu_exit_requested
(
void
);
extern
qemu_irq
qemu_system_powerdown
;
void
qemu_system_reset
(
void
);
...
...
@@ -130,6 +128,7 @@ extern int max_cpus;
extern
int
cursor_hide
;
extern
int
graphic_rotate
;
extern
int
no_quit
;
extern
int
no_shutdown
;
extern
int
semihosting_enabled
;
extern
int
old_param
;
extern
int
boot_menu
;
...
...
@@ -201,12 +200,10 @@ extern DriveInfo *drive_init(QemuOpts *arg, void *machine, int *fatal_error);
DriveInfo
*
add_init_drive
(
const
char
*
opts
);
/* pci-hotplug */
void
pci_device_hot_add_print
(
Monitor
*
mon
,
const
QObject
*
data
);
int
pci_device_hot_add
(
Monitor
*
mon
,
const
QDict
*
qdict
,
QObject
**
ret_data
);
void
pci_device_hot_add
(
Monitor
*
mon
,
const
QDict
*
qdict
);
void
drive_hot_add
(
Monitor
*
mon
,
const
QDict
*
qdict
);
int
pci_device_hot_remove
(
Monitor
*
mon
,
const
char
*
pci_addr
);
int
do_pci_device_hot_remove
(
Monitor
*
mon
,
const
QDict
*
qdict
,
QObject
**
ret_data
);
void
do_pci_device_hot_remove
(
Monitor
*
mon
,
const
QDict
*
qdict
);
/* serial ports */
...
...
vl.c
浏览文件 @
3853528a
...
...
@@ -1708,7 +1708,6 @@ static int shutdown_requested;
static
int
powerdown_requested
;
int
debug_requested
;
int
vmstop_requested
;
static
int
exit_requested
;
int
qemu_shutdown_requested
(
void
)
{
...
...
@@ -1731,12 +1730,6 @@ int qemu_powerdown_requested(void)
return
r
;
}
int
qemu_exit_requested
(
void
)
{
/* just return it, we'll exit() anyway */
return
exit_requested
;
}
static
int
qemu_debug_requested
(
void
)
{
int
r
=
debug_requested
;
...
...
@@ -1807,12 +1800,6 @@ void qemu_system_powerdown_request(void)
qemu_notify_event
();
}
void
qemu_system_exit_request
(
void
)
{
exit_requested
=
1
;
qemu_notify_event
();
}
#ifdef _WIN32
static
void
host_main_loop_wait
(
int
*
timeout
)
{
...
...
@@ -1949,8 +1936,6 @@ static int vm_can_run(void)
return
0
;
if
(
debug_requested
)
return
0
;
if
(
exit_requested
)
return
0
;
return
1
;
}
...
...
@@ -2003,9 +1988,6 @@ static void main_loop(void)
if
((
r
=
qemu_vmstop_requested
()))
{
vm_stop
(
r
);
}
if
(
qemu_exit_requested
())
{
exit
(
0
);
}
}
pause_all_vcpus
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录