Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
9f51c1c7
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
9f51c1c7
编写于
5月 09, 2016
作者:
P
Pavel Hrdina
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
graphics: generate fake ports also for tests
Signed-off-by:
N
Pavel Hrdina
<
phrdina@redhat.com
>
上级
446aebbc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
33 deletion
+15
-33
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+0
-12
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+12
-10
src/qemu/qemu_process.h
src/qemu/qemu_process.h
+0
-8
tests/qemuxml2argvdata/qemuxml2argv-controller-order.args
tests/qemuxml2argvdata/qemuxml2argv-controller-order.args
+1
-1
tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
+1
-1
tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args
...l2argvdata/qemuxml2argv-video-device-pciaddr-default.args
+1
-1
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
9f51c1c7
...
@@ -7060,18 +7060,6 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
...
@@ -7060,18 +7060,6 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
net->mac = mac;
net->mac = mac;
}
}
/* do fake auto-alloc of graphics ports, if such config is used */
for (i = 0; i < vm->def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
if (qemuProcessVNCAllocatePorts(driver, graphics, false) < 0)
goto cleanup;
} else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
if (qemuProcessSPICEAllocatePorts(driver, cfg, graphics, false) < 0)
goto cleanup;
}
}
if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL,
if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL,
qemuCheckFips(), true,
qemuCheckFips(), true,
VIR_QEMU_PROCESS_START_COLD)))
VIR_QEMU_PROCESS_START_COLD)))
...
...
src/qemu/qemu_process.c
浏览文件 @
9f51c1c7
...
@@ -3856,7 +3856,7 @@ qemuProcessReconnectAll(virConnectPtr conn, virQEMUDriverPtr driver)
...
@@ -3856,7 +3856,7 @@ qemuProcessReconnectAll(virConnectPtr conn, virQEMUDriverPtr driver)
virDomainObjListForEach
(
driver
->
domains
,
qemuProcessReconnectHelper
,
&
data
);
virDomainObjListForEach
(
driver
->
domains
,
qemuProcessReconnectHelper
,
&
data
);
}
}
int
static
int
qemuProcessVNCAllocatePorts
(
virQEMUDriverPtr
driver
,
qemuProcessVNCAllocatePorts
(
virQEMUDriverPtr
driver
,
virDomainGraphicsDefPtr
graphics
,
virDomainGraphicsDefPtr
graphics
,
bool
allocate
)
bool
allocate
)
...
@@ -3888,7 +3888,7 @@ qemuProcessVNCAllocatePorts(virQEMUDriverPtr driver,
...
@@ -3888,7 +3888,7 @@ qemuProcessVNCAllocatePorts(virQEMUDriverPtr driver,
return
0
;
return
0
;
}
}
int
static
int
qemuProcessSPICEAllocatePorts
(
virQEMUDriverPtr
driver
,
qemuProcessSPICEAllocatePorts
(
virQEMUDriverPtr
driver
,
virQEMUDriverConfigPtr
cfg
,
virQEMUDriverConfigPtr
cfg
,
virDomainGraphicsDefPtr
graphics
,
virDomainGraphicsDefPtr
graphics
,
...
@@ -4389,13 +4389,15 @@ qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
...
@@ -4389,13 +4389,15 @@ qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
static
int
static
int
qemuProcessSetupGraphics
(
virQEMUDriverPtr
driver
,
qemuProcessSetupGraphics
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
)
virDomainObjPtr
vm
,
unsigned
int
flags
)
{
{
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
bool
allocate
=
!
(
flags
&
VIR_QEMU_PROCESS_START_PRETEND
);
size_t
i
;
size_t
i
;
int
ret
=
-
1
;
int
ret
=
-
1
;
if
(
qemuProcessGraphicsReservePorts
(
driver
,
vm
)
<
0
)
if
(
allocate
&&
qemuProcessGraphicsReservePorts
(
driver
,
vm
)
<
0
)
goto
cleanup
;
goto
cleanup
;
for
(
i
=
0
;
i
<
vm
->
def
->
ngraphics
;
++
i
)
{
for
(
i
=
0
;
i
<
vm
->
def
->
ngraphics
;
++
i
)
{
...
@@ -4403,12 +4405,12 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
...
@@ -4403,12 +4405,12 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
switch
(
graphics
->
type
)
{
switch
(
graphics
->
type
)
{
case
VIR_DOMAIN_GRAPHICS_TYPE_VNC
:
case
VIR_DOMAIN_GRAPHICS_TYPE_VNC
:
if
(
qemuProcessVNCAllocatePorts
(
driver
,
graphics
,
tru
e
)
<
0
)
if
(
qemuProcessVNCAllocatePorts
(
driver
,
graphics
,
allocat
e
)
<
0
)
goto
cleanup
;
goto
cleanup
;
break
;
break
;
case
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
:
case
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
:
if
(
qemuProcessSPICEAllocatePorts
(
driver
,
cfg
,
graphics
,
tru
e
)
<
0
)
if
(
qemuProcessSPICEAllocatePorts
(
driver
,
cfg
,
graphics
,
allocat
e
)
<
0
)
goto
cleanup
;
goto
cleanup
;
break
;
break
;
...
@@ -5175,6 +5177,10 @@ qemuProcessPrepareDomain(virConnectPtr conn,
...
@@ -5175,6 +5177,10 @@ qemuProcessPrepareDomain(virConnectPtr conn,
if
(
qemuAssignDeviceAliases
(
vm
->
def
,
priv
->
qemuCaps
)
<
0
)
if
(
qemuAssignDeviceAliases
(
vm
->
def
,
priv
->
qemuCaps
)
<
0
)
goto
cleanup
;
goto
cleanup
;
VIR_DEBUG
(
"Setting up ports for graphics"
);
if
(
qemuProcessSetupGraphics
(
driver
,
vm
,
flags
)
<
0
)
goto
cleanup
;
/* Fill in run-time values for graphics devices. */
/* Fill in run-time values for graphics devices. */
for
(
i
=
0
;
i
<
vm
->
def
->
ngraphics
;
i
++
)
{
for
(
i
=
0
;
i
<
vm
->
def
->
ngraphics
;
i
++
)
{
virDomainGraphicsDefPtr
graphics
=
vm
->
def
->
graphics
[
i
];
virDomainGraphicsDefPtr
graphics
=
vm
->
def
->
graphics
[
i
];
...
@@ -5313,10 +5319,6 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver,
...
@@ -5313,10 +5319,6 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver,
VIR_DEBUG
(
"Ensuring no historical cgroup is lying around"
);
VIR_DEBUG
(
"Ensuring no historical cgroup is lying around"
);
qemuRemoveCgroup
(
vm
);
qemuRemoveCgroup
(
vm
);
VIR_DEBUG
(
"Setting up ports for graphics"
);
if
(
qemuProcessSetupGraphics
(
driver
,
vm
)
<
0
)
goto
cleanup
;
if
(
virFileMakePath
(
cfg
->
logDir
)
<
0
)
{
if
(
virFileMakePath
(
cfg
->
logDir
)
<
0
)
{
virReportSystemError
(
errno
,
virReportSystemError
(
errno
,
_
(
"cannot create log directory %s"
),
_
(
"cannot create log directory %s"
),
...
...
src/qemu/qemu_process.h
浏览文件 @
9f51c1c7
...
@@ -175,14 +175,6 @@ bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver,
...
@@ -175,14 +175,6 @@ bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver,
int
qemuProcessSetSchedParams
(
int
id
,
pid_t
pid
,
size_t
nsp
,
int
qemuProcessSetSchedParams
(
int
id
,
pid_t
pid
,
size_t
nsp
,
virDomainThreadSchedParamPtr
sp
);
virDomainThreadSchedParamPtr
sp
);
int
qemuProcessVNCAllocatePorts
(
virQEMUDriverPtr
driver
,
virDomainGraphicsDefPtr
graphics
,
bool
allocate
);
int
qemuProcessSPICEAllocatePorts
(
virQEMUDriverPtr
driver
,
virQEMUDriverConfigPtr
cfg
,
virDomainGraphicsDefPtr
graphics
,
bool
allocate
);
virDomainDiskDefPtr
qemuProcessFindDomainDiskByAlias
(
virDomainObjPtr
vm
,
virDomainDiskDefPtr
qemuProcessFindDomainDiskByAlias
(
virDomainObjPtr
vm
,
const
char
*
alias
);
const
char
*
alias
);
...
...
tests/qemuxml2argvdata/qemuxml2argv-controller-order.args
浏览文件 @
9f51c1c7
...
@@ -37,7 +37,7 @@ media=cdrom,id=drive-ide0-1-0 \
...
@@ -37,7 +37,7 @@ media=cdrom,id=drive-ide0-1-0 \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,\
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,\
id=channel0,name=com.redhat.spice.0 \
id=channel0,name=com.redhat.spice.0 \
-device usb-tablet,id=input0 \
-device usb-tablet,id=input0 \
-spice port=
0
\
-spice port=
5901,tls-port=5902,addr=0.0.0.0,x509-dir=/etc/pki/libvirt-spice
\
-vga cirrus \
-vga cirrus \
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
...
...
tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
浏览文件 @
9f51c1c7
...
@@ -47,7 +47,7 @@ id=channel0,name=org.qemu.guest_agent.0 \
...
@@ -47,7 +47,7 @@ id=channel0,name=org.qemu.guest_agent.0 \
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,\
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,\
id=channel1,name=com.redhat.spice.0 \
id=channel1,name=com.redhat.spice.0 \
-device usb-tablet,id=input0 \
-device usb-tablet,id=input0 \
-spice port=
0
\
-spice port=
5901,tls-port=5902,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice
\
-vga qxl \
-vga qxl \
-global qxl-vga.ram_size=67108864 \
-global qxl-vga.ram_size=67108864 \
-global qxl-vga.vram_size=67108864 \
-global qxl-vga.vram_size=67108864 \
...
...
tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args
浏览文件 @
9f51c1c7
...
@@ -19,7 +19,7 @@ QEMU_AUDIO_DRV=none \
...
@@ -19,7 +19,7 @@ QEMU_AUDIO_DRV=none \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,\
id=drive-ide0-0-0,cache=none \
id=drive-ide0-0-0,cache=none \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-vnc 127.0.0.1:
-590
0 \
-vnc 127.0.0.1:0 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,\
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,\
addr=0x3 \
addr=0x3 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录