Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
43ae691e
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看板
提交
43ae691e
编写于
11月 16, 2010
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'spice/bugfix.2' into staging
上级
2834c3e0
7466bc49
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
17 deletion
+17
-17
ui/spice-core.c
ui/spice-core.c
+3
-3
ui/spice-display.c
ui/spice-display.c
+14
-13
ui/spice-display.h
ui/spice-display.h
+0
-1
未找到文件。
ui/spice-core.c
浏览文件 @
43ae691e
...
...
@@ -95,7 +95,7 @@ static void watch_update_mask(SpiceWatch *watch, int event_mask)
on_read
=
watch_read
;
}
if
(
watch
->
event_mask
&
SPICE_WATCH_EVENT_WRITE
)
{
on_
read
=
watch_write
;
on_
write
=
watch_write
;
}
qemu_set_fd_handler
(
watch
->
fd
,
on_read
,
on_write
,
watch
);
}
...
...
@@ -240,7 +240,7 @@ void qemu_spice_init(void)
char
*
x509_key_file
=
NULL
,
*
x509_cert_file
=
NULL
,
*
x509_cacert_file
=
NULL
;
int
port
,
tls_port
,
len
,
addr_flags
,
streaming_video
;
int
port
,
tls_port
,
len
,
addr_flags
;
spice_image_compression_t
compression
;
spice_wan_compression_t
wan_compr
;
...
...
@@ -344,7 +344,7 @@ void qemu_spice_init(void)
str
=
qemu_opt_get
(
opts
,
"streaming-video"
);
if
(
str
)
{
streaming_video
=
parse_stream_video
(
str
);
int
streaming_video
=
parse_stream_video
(
str
);
spice_server_set_streaming_video
(
spice_server
,
streaming_video
);
}
...
...
ui/spice-display.c
浏览文件 @
43ae691e
...
...
@@ -64,10 +64,10 @@ void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r)
/*
* Called from spice server thread context (via interface_get_command).
*
We do *not* hold the global qemu mutex here, so extra care is needed
*
when calling qemu functions. Qemu interfaces used:
*
- pflib (is re-entrant).
*
- qemu_malloc (underlying glibc malloc is re-entrant)
.
*
*
We must aquire the global qemu mutex here to make sure the
*
DisplayState (+DisplaySurface) we are accessing doesn't change
*
underneath us
.
*/
SimpleSpiceUpdate
*
qemu_spice_create_update
(
SimpleSpiceDisplay
*
ssd
)
{
...
...
@@ -78,11 +78,12 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
uint8_t
*
src
,
*
dst
;
int
by
,
bw
,
bh
;
qemu_mutex_lock_iothread
();
if
(
qemu_spice_rect_is_empty
(
&
ssd
->
dirty
))
{
qemu_mutex_unlock_iothread
();
return
NULL
;
};
pthread_mutex_lock
(
&
ssd
->
lock
);
dprint
(
2
,
"%s: lr %d -> %d, tb -> %d -> %d
\n
"
,
__FUNCTION__
,
ssd
->
dirty
.
left
,
ssd
->
dirty
.
right
,
ssd
->
dirty
.
top
,
ssd
->
dirty
.
bottom
);
...
...
@@ -140,7 +141,7 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
cmd
->
data
=
(
intptr_t
)
drawable
;
memset
(
&
ssd
->
dirty
,
0
,
sizeof
(
ssd
->
dirty
));
pthread_mutex_unlock
(
&
ssd
->
lock
);
qemu_mutex_unlock_iothread
(
);
return
update
;
}
...
...
@@ -184,14 +185,19 @@ void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
surface
.
type
=
0
;
surface
.
mem
=
(
intptr_t
)
ssd
->
buf
;
surface
.
group_id
=
MEMSLOT_GROUP_HOST
;
qemu_mutex_unlock_iothread
();
ssd
->
worker
->
create_primary_surface
(
ssd
->
worker
,
0
,
&
surface
);
qemu_mutex_lock_iothread
();
}
void
qemu_spice_destroy_host_primary
(
SimpleSpiceDisplay
*
ssd
)
{
dprint
(
1
,
"%s:
\n
"
,
__FUNCTION__
);
qemu_mutex_unlock_iothread
();
ssd
->
worker
->
destroy_primary_surface
(
ssd
->
worker
,
0
);
qemu_mutex_lock_iothread
();
}
void
qemu_spice_vm_change_state_handler
(
void
*
opaque
,
int
running
,
int
reason
)
...
...
@@ -201,7 +207,9 @@ void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)
if
(
running
)
{
ssd
->
worker
->
start
(
ssd
->
worker
);
}
else
{
qemu_mutex_unlock_iothread
();
ssd
->
worker
->
stop
(
ssd
->
worker
);
qemu_mutex_lock_iothread
();
}
ssd
->
running
=
running
;
}
...
...
@@ -219,31 +227,25 @@ void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
update_area
.
top
=
y
;
update_area
.
bottom
=
y
+
h
;
pthread_mutex_lock
(
&
ssd
->
lock
);
if
(
qemu_spice_rect_is_empty
(
&
ssd
->
dirty
))
{
ssd
->
notify
++
;
}
qemu_spice_rect_union
(
&
ssd
->
dirty
,
&
update_area
);
pthread_mutex_unlock
(
&
ssd
->
lock
);
}
void
qemu_spice_display_resize
(
SimpleSpiceDisplay
*
ssd
)
{
dprint
(
1
,
"%s:
\n
"
,
__FUNCTION__
);
pthread_mutex_lock
(
&
ssd
->
lock
);
memset
(
&
ssd
->
dirty
,
0
,
sizeof
(
ssd
->
dirty
));
qemu_pf_conv_put
(
ssd
->
conv
);
ssd
->
conv
=
NULL
;
pthread_mutex_unlock
(
&
ssd
->
lock
);
qemu_spice_destroy_host_primary
(
ssd
);
qemu_spice_create_host_primary
(
ssd
);
pthread_mutex_lock
(
&
ssd
->
lock
);
memset
(
&
ssd
->
dirty
,
0
,
sizeof
(
ssd
->
dirty
));
ssd
->
notify
++
;
pthread_mutex_unlock
(
&
ssd
->
lock
);
}
void
qemu_spice_display_refresh
(
SimpleSpiceDisplay
*
ssd
)
...
...
@@ -398,7 +400,6 @@ void qemu_spice_display_init(DisplayState *ds)
sdpy
.
ds
=
ds
;
sdpy
.
bufsize
=
(
16
*
1024
*
1024
);
sdpy
.
buf
=
qemu_malloc
(
sdpy
.
bufsize
);
pthread_mutex_init
(
&
sdpy
.
lock
,
NULL
);
register_displaychangelistener
(
ds
,
&
display_listener
);
sdpy
.
qxl
.
base
.
sif
=
&
dpy_interface
.
base
;
...
...
ui/spice-display.h
浏览文件 @
43ae691e
...
...
@@ -40,7 +40,6 @@ typedef struct SimpleSpiceDisplay {
uint32_t
unique
;
QemuPfConv
*
conv
;
pthread_mutex_t
lock
;
QXLRect
dirty
;
int
notify
;
int
running
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录