Compare commits
143 Commits
pull-input
...
pull-vnc-2
Author | SHA1 | Date | |
---|---|---|---|
|
66668d197f | ||
|
3f7e51bca3 | ||
|
5a8be0f73d | ||
|
14c7d99333 | ||
|
79a9f323a8 | ||
|
2e1f05020b | ||
|
97c2ed5dbd | ||
|
2ddfa2817b | ||
|
fe84770528 | ||
|
541ef8c2e7 | ||
|
95eb49c8a3 | ||
|
c8efd802c4 | ||
|
7069532e3b | ||
|
56215da394 | ||
|
f58b39d2d5 | ||
|
1c8e93fb41 | ||
|
22e28174ae | ||
|
b2a575a1c6 | ||
|
190c93c982 | ||
|
f9a555e499 | ||
|
9358450e98 | ||
|
5bb2399f9b | ||
|
543d7a42ba | ||
|
42190dcc70 | ||
|
c4b48bfdc5 | ||
0c204cc810 | |||
3a1ee71190 | |||
|
435d5ee6cd | ||
|
ff356ee4da | ||
|
524089bce4 | ||
|
f14a39ccb9 | ||
|
c834cba905 | ||
|
a367467995 | ||
|
84c26520d3 | ||
|
bcf23482ae | ||
|
35fedb7b0e | ||
|
62ed9fa991 | ||
|
8c39825218 | ||
|
1e8fb7f1ee | ||
|
f6166a06ff | ||
|
2aece63c8a | ||
|
1454d33f05 | ||
|
aa5cb7f5e8 | ||
|
8caf911d33 | ||
|
f6c2e66ae8 | ||
|
9e32ff3299 | ||
|
8daea51095 | ||
|
0b8b8753e4 | ||
|
7e70cdba9f | ||
|
7d9c858137 | ||
|
5af7045bd0 | ||
|
761d1ddf25 | ||
|
6aae5be6a7 | ||
|
a5d5a3bdbd | ||
|
fd62c609ed | ||
|
2323322ed0 | ||
|
70559d499c | ||
|
71aa98678c | ||
|
7f0317cfc8 | ||
|
3ddf3efefa | ||
|
ffb1f10cd1 | ||
|
9df229c3ca | ||
|
29338003c9 | ||
|
d27ba624aa | ||
|
9ec3025660 | ||
|
fa3007e7ec | ||
|
f9c816c00c | ||
|
02c79d7885 | ||
|
ba2397d1ca | ||
|
7385aed20d | ||
|
f2fe396f0f | ||
|
ca5ce5723f | ||
|
7705091ca4 | ||
|
6850811e7c | ||
|
c095b83f98 | ||
|
e4dc0052a4 | ||
|
35e94905ce | ||
|
3f4288ebf6 | ||
|
f0913be04b | ||
|
0cc1f4bf76 | ||
|
1d854963ea | ||
|
68a03b8c88 | ||
|
1d65b0f5bb | ||
|
7ec1e5ea4b | ||
|
a6d567e523 | ||
|
22e700607a | ||
|
4fbe006790 | ||
|
99a230638a | ||
|
e86ceb0d65 | ||
|
be72f9fcca | ||
|
73f40c1895 | ||
|
1e13c01d2a | ||
|
a942d8fa01 | ||
|
28ba61e7ff | ||
|
540aecd099 | ||
|
6959e508c6 | ||
|
297b044a7f | ||
|
ca3d87d4c8 | ||
|
82751a32be | ||
|
175de52487 | ||
|
2a6a4076e1 | ||
|
965379b455 | ||
|
6031a51f1d | ||
|
121d07125b | ||
|
85aad98a0e | ||
|
20668fdebd | ||
|
14e54f8ecf | ||
|
1b3c4fdf30 | ||
|
59e96bcbf9 | ||
|
3500385697 | ||
|
9c93ae13a4 | ||
|
55c5063c61 | ||
|
3622634bc6 | ||
|
07f5a25875 | ||
|
2dbc4ebc17 | ||
|
a9c94277f0 | ||
|
7d820b766a | ||
|
cbe967f41d | ||
|
f76bde7029 | ||
|
43120576cb | ||
|
b442642da1 | ||
|
b35399bb4e | ||
|
74e1b782b3 | ||
|
c1ac514a04 | ||
|
494edbf0b4 | ||
|
910789c220 | ||
|
042ec47e68 | ||
|
b91e013982 | ||
|
a4055d8586 | ||
|
cdc46fab07 | ||
|
a0c8060841 | ||
|
2d72e7b047 | ||
|
6ec98bd7b6 | ||
|
8f95ad1c79 | ||
|
c09199fe73 | ||
|
dff94251f0 | ||
|
89777fd10f | ||
|
19494f811a | ||
|
e8bd336dd1 | ||
|
405140519f | ||
|
ea69744988 | ||
|
095497ffc6 | ||
|
5a693efda8 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -95,6 +95,10 @@
|
|||||||
/pc-bios/optionrom/linuxboot.bin
|
/pc-bios/optionrom/linuxboot.bin
|
||||||
/pc-bios/optionrom/linuxboot.raw
|
/pc-bios/optionrom/linuxboot.raw
|
||||||
/pc-bios/optionrom/linuxboot.img
|
/pc-bios/optionrom/linuxboot.img
|
||||||
|
/pc-bios/optionrom/linuxboot_dma.asm
|
||||||
|
/pc-bios/optionrom/linuxboot_dma.bin
|
||||||
|
/pc-bios/optionrom/linuxboot_dma.raw
|
||||||
|
/pc-bios/optionrom/linuxboot_dma.img
|
||||||
/pc-bios/optionrom/multiboot.asm
|
/pc-bios/optionrom/multiboot.asm
|
||||||
/pc-bios/optionrom/multiboot.bin
|
/pc-bios/optionrom/multiboot.bin
|
||||||
/pc-bios/optionrom/multiboot.raw
|
/pc-bios/optionrom/multiboot.raw
|
||||||
|
4
Makefile
4
Makefile
@@ -185,7 +185,7 @@ qemu-version.h: FORCE
|
|||||||
printf '""\n'; \
|
printf '""\n'; \
|
||||||
fi; \
|
fi; \
|
||||||
fi) > $@.tmp)
|
fi) > $@.tmp)
|
||||||
$(call quiet-command, cmp --quiet $@ $@.tmp || mv $@.tmp $@)
|
$(call quiet-command, cmp -s $@ $@.tmp || mv $@.tmp $@)
|
||||||
|
|
||||||
config-host.h: config-host.h-timestamp
|
config-host.h: config-host.h-timestamp
|
||||||
config-host.h-timestamp: config-host.mak
|
config-host.h-timestamp: config-host.mak
|
||||||
@@ -419,7 +419,7 @@ efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
|
|||||||
efi-e1000e.rom efi-vmxnet3.rom \
|
efi-e1000e.rom efi-vmxnet3.rom \
|
||||||
qemu-icon.bmp qemu_logo_no_text.svg \
|
qemu-icon.bmp qemu_logo_no_text.svg \
|
||||||
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
|
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
|
||||||
multiboot.bin linuxboot.bin kvmvapic.bin \
|
multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin \
|
||||||
s390-ccw.img \
|
s390-ccw.img \
|
||||||
spapr-rtas.bin slof.bin \
|
spapr-rtas.bin slof.bin \
|
||||||
palcode-clipper \
|
palcode-clipper \
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QEMU_AUDIO_H
|
#ifndef QEMU_AUDIO_H
|
||||||
#define QEMU_AUDIO_H
|
#define QEMU_AUDIO_H
|
||||||
|
|
||||||
@@ -162,4 +163,4 @@ static inline void *advance (void *p, int incr)
|
|||||||
int wav_start_capture (CaptureState *s, const char *path, int freq,
|
int wav_start_capture (CaptureState *s, const char *path, int freq,
|
||||||
int bits, int nchannels);
|
int bits, int nchannels);
|
||||||
|
|
||||||
#endif /* audio.h */
|
#endif /* QEMU_AUDIO_H */
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QEMU_AUDIO_INT_H
|
#ifndef QEMU_AUDIO_INT_H
|
||||||
#define QEMU_AUDIO_INT_H
|
#define QEMU_AUDIO_INT_H
|
||||||
|
|
||||||
@@ -257,4 +258,4 @@ static inline int audio_ring_dist (int dst, int src, int len)
|
|||||||
#define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__)
|
#define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* audio_int.h */
|
#endif /* QEMU_AUDIO_INT_H */
|
||||||
|
@@ -19,4 +19,4 @@ int audio_pt_wait (struct audio_pt *, const char *);
|
|||||||
int audio_pt_unlock_and_signal (struct audio_pt *, const char *);
|
int audio_pt_unlock_and_signal (struct audio_pt *, const char *);
|
||||||
int audio_pt_join (struct audio_pt *, void **, const char *);
|
int audio_pt_join (struct audio_pt *, void **, const char *);
|
||||||
|
|
||||||
#endif /* audio_pt_int.h */
|
#endif /* QEMU_AUDIO_PT_INT_H */
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QEMU_MIXENG_H
|
#ifndef QEMU_MIXENG_H
|
||||||
#define QEMU_MIXENG_H
|
#define QEMU_MIXENG_H
|
||||||
|
|
||||||
@@ -48,4 +49,4 @@ void st_rate_stop (void *opaque);
|
|||||||
void mixeng_clear (struct st_sample *buf, int len);
|
void mixeng_clear (struct st_sample *buf, int len);
|
||||||
void mixeng_volume (struct st_sample *buf, int len, struct mixeng_volume *vol);
|
void mixeng_volume (struct st_sample *buf, int len, struct mixeng_volume *vol);
|
||||||
|
|
||||||
#endif /* mixeng.h */
|
#endif /* QEMU_MIXENG_H */
|
||||||
|
@@ -64,6 +64,14 @@ out:
|
|||||||
error_propagate(errp, local_err);
|
error_propagate(errp, local_err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint16List **host_memory_append_node(uint16List **node,
|
||||||
|
unsigned long value)
|
||||||
|
{
|
||||||
|
*node = g_malloc0(sizeof(**node));
|
||||||
|
(*node)->value = value;
|
||||||
|
return &(*node)->next;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name,
|
host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name,
|
||||||
void *opaque, Error **errp)
|
void *opaque, Error **errp)
|
||||||
@@ -74,13 +82,12 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name,
|
|||||||
unsigned long value;
|
unsigned long value;
|
||||||
|
|
||||||
value = find_first_bit(backend->host_nodes, MAX_NODES);
|
value = find_first_bit(backend->host_nodes, MAX_NODES);
|
||||||
if (value == MAX_NODES) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
*node = g_malloc0(sizeof(**node));
|
node = host_memory_append_node(node, value);
|
||||||
(*node)->value = value;
|
|
||||||
node = &(*node)->next;
|
if (value == MAX_NODES) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
value = find_next_bit(backend->host_nodes, MAX_NODES, value + 1);
|
value = find_next_bit(backend->host_nodes, MAX_NODES, value + 1);
|
||||||
@@ -88,11 +95,10 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
*node = g_malloc0(sizeof(**node));
|
node = host_memory_append_node(node, value);
|
||||||
(*node)->value = value;
|
|
||||||
node = &(*node)->next;
|
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
|
out:
|
||||||
visit_type_uint16List(v, name, &host_nodes, errp);
|
visit_type_uint16List(v, name, &host_nodes, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,6 +264,16 @@ host_memory_backend_get_memory(HostMemoryBackend *backend, Error **errp)
|
|||||||
return memory_region_size(&backend->mr) ? &backend->mr : NULL;
|
return memory_region_size(&backend->mr) ? &backend->mr : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void host_memory_backend_set_mapped(HostMemoryBackend *backend, bool mapped)
|
||||||
|
{
|
||||||
|
backend->is_mapped = mapped;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool host_memory_backend_is_mapped(HostMemoryBackend *backend)
|
||||||
|
{
|
||||||
|
return backend->is_mapped;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
|
host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
|
||||||
{
|
{
|
||||||
@@ -335,10 +351,7 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
|
|||||||
static bool
|
static bool
|
||||||
host_memory_backend_can_be_deleted(UserCreatable *uc, Error **errp)
|
host_memory_backend_can_be_deleted(UserCreatable *uc, Error **errp)
|
||||||
{
|
{
|
||||||
MemoryRegion *mr;
|
if (host_memory_backend_is_mapped(MEMORY_BACKEND(uc))) {
|
||||||
|
|
||||||
mr = host_memory_backend_get_memory(MEMORY_BACKEND(uc), errp);
|
|
||||||
if (memory_region_is_mapped(mr)) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
4
block.c
4
block.c
@@ -329,8 +329,8 @@ int bdrv_create(BlockDriver *drv, const char* filename,
|
|||||||
/* Fast-path if already in coroutine context */
|
/* Fast-path if already in coroutine context */
|
||||||
bdrv_create_co_entry(&cco);
|
bdrv_create_co_entry(&cco);
|
||||||
} else {
|
} else {
|
||||||
co = qemu_coroutine_create(bdrv_create_co_entry);
|
co = qemu_coroutine_create(bdrv_create_co_entry, &cco);
|
||||||
qemu_coroutine_enter(co, &cco);
|
qemu_coroutine_enter(co);
|
||||||
while (cco.ret == NOT_DONE) {
|
while (cco.ret == NOT_DONE) {
|
||||||
aio_poll(qemu_get_aio_context(), true);
|
aio_poll(qemu_get_aio_context(), true);
|
||||||
}
|
}
|
||||||
|
@@ -474,9 +474,9 @@ static void coroutine_fn backup_run(void *opaque)
|
|||||||
block_job_defer_to_main_loop(&job->common, backup_complete, data);
|
block_job_defer_to_main_loop(&job->common, backup_complete, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void backup_start(BlockDriverState *bs, BlockDriverState *target,
|
void backup_start(const char *job_id, BlockDriverState *bs,
|
||||||
int64_t speed, MirrorSyncMode sync_mode,
|
BlockDriverState *target, int64_t speed,
|
||||||
BdrvDirtyBitmap *sync_bitmap,
|
MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap,
|
||||||
BlockdevOnError on_source_error,
|
BlockdevOnError on_source_error,
|
||||||
BlockdevOnError on_target_error,
|
BlockdevOnError on_target_error,
|
||||||
BlockCompletionFunc *cb, void *opaque,
|
BlockCompletionFunc *cb, void *opaque,
|
||||||
@@ -541,7 +541,8 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
job = block_job_create(&backup_job_driver, bs, speed, cb, opaque, errp);
|
job = block_job_create(job_id, &backup_job_driver, bs, speed,
|
||||||
|
cb, opaque, errp);
|
||||||
if (!job) {
|
if (!job) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@@ -575,9 +576,9 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
|
|
||||||
bdrv_op_block_all(target, job->common.blocker);
|
bdrv_op_block_all(target, job->common.blocker);
|
||||||
job->common.len = len;
|
job->common.len = len;
|
||||||
job->common.co = qemu_coroutine_create(backup_run);
|
job->common.co = qemu_coroutine_create(backup_run, job);
|
||||||
block_job_txn_add_job(txn, &job->common);
|
block_job_txn_add_job(txn, &job->common);
|
||||||
qemu_coroutine_enter(job->common.co, job);
|
qemu_coroutine_enter(job->common.co);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@@ -621,7 +621,7 @@ static int blkdebug_debug_resume(BlockDriverState *bs, const char *tag)
|
|||||||
|
|
||||||
QLIST_FOREACH_SAFE(r, &s->suspended_reqs, next, next) {
|
QLIST_FOREACH_SAFE(r, &s->suspended_reqs, next, next) {
|
||||||
if (!strcmp(r->tag, tag)) {
|
if (!strcmp(r->tag, tag)) {
|
||||||
qemu_coroutine_enter(r->co, NULL);
|
qemu_coroutine_enter(r->co);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -647,7 +647,7 @@ static int blkdebug_debug_remove_breakpoint(BlockDriverState *bs,
|
|||||||
}
|
}
|
||||||
QLIST_FOREACH_SAFE(r, &s->suspended_reqs, next, r_next) {
|
QLIST_FOREACH_SAFE(r, &s->suspended_reqs, next, r_next) {
|
||||||
if (!strcmp(r->tag, tag)) {
|
if (!strcmp(r->tag, tag)) {
|
||||||
qemu_coroutine_enter(r->co, NULL);
|
qemu_coroutine_enter(r->co);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ static int64_t blkreplay_getlength(BlockDriverState *bs)
|
|||||||
static void blkreplay_bh_cb(void *opaque)
|
static void blkreplay_bh_cb(void *opaque)
|
||||||
{
|
{
|
||||||
Request *req = opaque;
|
Request *req = opaque;
|
||||||
qemu_coroutine_enter(req->co, NULL);
|
qemu_coroutine_enter(req->co);
|
||||||
qemu_bh_delete(req->bh);
|
qemu_bh_delete(req->bh);
|
||||||
g_free(req);
|
g_free(req);
|
||||||
}
|
}
|
||||||
|
@@ -836,8 +836,8 @@ static int blk_prw(BlockBackend *blk, int64_t offset, uint8_t *buf,
|
|||||||
.ret = NOT_DONE,
|
.ret = NOT_DONE,
|
||||||
};
|
};
|
||||||
|
|
||||||
co = qemu_coroutine_create(co_entry);
|
co = qemu_coroutine_create(co_entry, &rwco);
|
||||||
qemu_coroutine_enter(co, &rwco);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
aio_context = blk_get_aio_context(blk);
|
aio_context = blk_get_aio_context(blk);
|
||||||
while (rwco.ret == NOT_DONE) {
|
while (rwco.ret == NOT_DONE) {
|
||||||
@@ -950,8 +950,8 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int bytes,
|
|||||||
acb->bh = NULL;
|
acb->bh = NULL;
|
||||||
acb->has_returned = false;
|
acb->has_returned = false;
|
||||||
|
|
||||||
co = qemu_coroutine_create(co_entry);
|
co = qemu_coroutine_create(co_entry, acb);
|
||||||
qemu_coroutine_enter(co, acb);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
acb->has_returned = true;
|
acb->has_returned = true;
|
||||||
if (acb->rwco.ret != NOT_DONE) {
|
if (acb->rwco.ret != NOT_DONE) {
|
||||||
@@ -1173,6 +1173,7 @@ BlockErrorAction blk_get_error_action(BlockBackend *blk, bool is_read,
|
|||||||
return BLOCK_ERROR_ACTION_REPORT;
|
return BLOCK_ERROR_ACTION_REPORT;
|
||||||
case BLOCKDEV_ON_ERROR_IGNORE:
|
case BLOCKDEV_ON_ERROR_IGNORE:
|
||||||
return BLOCK_ERROR_ACTION_IGNORE;
|
return BLOCK_ERROR_ACTION_IGNORE;
|
||||||
|
case BLOCKDEV_ON_ERROR_AUTO:
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@@ -113,6 +113,7 @@ static void coroutine_fn commit_run(void *opaque)
|
|||||||
CommitBlockJob *s = opaque;
|
CommitBlockJob *s = opaque;
|
||||||
CommitCompleteData *data;
|
CommitCompleteData *data;
|
||||||
int64_t sector_num, end;
|
int64_t sector_num, end;
|
||||||
|
uint64_t delay_ns = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
void *buf = NULL;
|
void *buf = NULL;
|
||||||
@@ -142,10 +143,8 @@ static void coroutine_fn commit_run(void *opaque)
|
|||||||
buf = blk_blockalign(s->top, COMMIT_BUFFER_SIZE);
|
buf = blk_blockalign(s->top, COMMIT_BUFFER_SIZE);
|
||||||
|
|
||||||
for (sector_num = 0; sector_num < end; sector_num += n) {
|
for (sector_num = 0; sector_num < end; sector_num += n) {
|
||||||
uint64_t delay_ns = 0;
|
|
||||||
bool copy;
|
bool copy;
|
||||||
|
|
||||||
wait:
|
|
||||||
/* Note that even when no rate limit is applied we need to yield
|
/* Note that even when no rate limit is applied we need to yield
|
||||||
* with no pending I/O here so that bdrv_drain_all() returns.
|
* with no pending I/O here so that bdrv_drain_all() returns.
|
||||||
*/
|
*/
|
||||||
@@ -161,19 +160,13 @@ wait:
|
|||||||
copy = (ret == 1);
|
copy = (ret == 1);
|
||||||
trace_commit_one_iteration(s, sector_num, n, ret);
|
trace_commit_one_iteration(s, sector_num, n, ret);
|
||||||
if (copy) {
|
if (copy) {
|
||||||
if (s->common.speed) {
|
|
||||||
delay_ns = ratelimit_calculate_delay(&s->limit, n);
|
|
||||||
if (delay_ns > 0) {
|
|
||||||
goto wait;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ret = commit_populate(s->top, s->base, sector_num, n, buf);
|
ret = commit_populate(s->top, s->base, sector_num, n, buf);
|
||||||
bytes_written += n * BDRV_SECTOR_SIZE;
|
bytes_written += n * BDRV_SECTOR_SIZE;
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (s->on_error == BLOCKDEV_ON_ERROR_STOP ||
|
BlockErrorAction action =
|
||||||
s->on_error == BLOCKDEV_ON_ERROR_REPORT||
|
block_job_error_action(&s->common, false, s->on_error, -ret);
|
||||||
(s->on_error == BLOCKDEV_ON_ERROR_ENOSPC && ret == -ENOSPC)) {
|
if (action == BLOCK_ERROR_ACTION_REPORT) {
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
n = 0;
|
n = 0;
|
||||||
@@ -182,6 +175,10 @@ wait:
|
|||||||
}
|
}
|
||||||
/* Publish progress */
|
/* Publish progress */
|
||||||
s->common.offset += n * BDRV_SECTOR_SIZE;
|
s->common.offset += n * BDRV_SECTOR_SIZE;
|
||||||
|
|
||||||
|
if (copy && s->common.speed) {
|
||||||
|
delay_ns = ratelimit_calculate_delay(&s->limit, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@@ -211,8 +208,8 @@ static const BlockJobDriver commit_job_driver = {
|
|||||||
.set_speed = commit_set_speed,
|
.set_speed = commit_set_speed,
|
||||||
};
|
};
|
||||||
|
|
||||||
void commit_start(BlockDriverState *bs, BlockDriverState *base,
|
void commit_start(const char *job_id, BlockDriverState *bs,
|
||||||
BlockDriverState *top, int64_t speed,
|
BlockDriverState *base, BlockDriverState *top, int64_t speed,
|
||||||
BlockdevOnError on_error, BlockCompletionFunc *cb,
|
BlockdevOnError on_error, BlockCompletionFunc *cb,
|
||||||
void *opaque, const char *backing_file_str, Error **errp)
|
void *opaque, const char *backing_file_str, Error **errp)
|
||||||
{
|
{
|
||||||
@@ -236,7 +233,8 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = block_job_create(&commit_job_driver, bs, speed, cb, opaque, errp);
|
s = block_job_create(job_id, &commit_job_driver, bs, speed,
|
||||||
|
cb, opaque, errp);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -277,10 +275,10 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
|
|||||||
s->backing_file_str = g_strdup(backing_file_str);
|
s->backing_file_str = g_strdup(backing_file_str);
|
||||||
|
|
||||||
s->on_error = on_error;
|
s->on_error = on_error;
|
||||||
s->common.co = qemu_coroutine_create(commit_run);
|
s->common.co = qemu_coroutine_create(commit_run, s);
|
||||||
|
|
||||||
trace_commit_start(bs, base, top, s, s->common.co, opaque);
|
trace_commit_start(bs, base, top, s, s->common.co, opaque);
|
||||||
qemu_coroutine_enter(s->common.co, s);
|
qemu_coroutine_enter(s->common.co);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -233,7 +233,7 @@ static void qemu_gluster_complete_aio(void *opaque)
|
|||||||
|
|
||||||
qemu_bh_delete(acb->bh);
|
qemu_bh_delete(acb->bh);
|
||||||
acb->bh = NULL;
|
acb->bh = NULL;
|
||||||
qemu_coroutine_enter(acb->coroutine, NULL);
|
qemu_coroutine_enter(acb->coroutine);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
45
block/io.c
45
block/io.c
@@ -195,7 +195,7 @@ static void bdrv_co_drain_bh_cb(void *opaque)
|
|||||||
qemu_bh_delete(data->bh);
|
qemu_bh_delete(data->bh);
|
||||||
bdrv_drain_poll(data->bs);
|
bdrv_drain_poll(data->bs);
|
||||||
data->done = true;
|
data->done = true;
|
||||||
qemu_coroutine_enter(co, NULL);
|
qemu_coroutine_enter(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs)
|
static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs)
|
||||||
@@ -599,8 +599,8 @@ static int bdrv_prwv_co(BdrvChild *child, int64_t offset,
|
|||||||
} else {
|
} else {
|
||||||
AioContext *aio_context = bdrv_get_aio_context(child->bs);
|
AioContext *aio_context = bdrv_get_aio_context(child->bs);
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_rw_co_entry);
|
co = qemu_coroutine_create(bdrv_rw_co_entry, &rwco);
|
||||||
qemu_coroutine_enter(co, &rwco);
|
qemu_coroutine_enter(co);
|
||||||
while (rwco.ret == NOT_DONE) {
|
while (rwco.ret == NOT_DONE) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
@@ -799,7 +799,7 @@ static void bdrv_co_io_em_complete(void *opaque, int ret)
|
|||||||
CoroutineIOCompletion *co = opaque;
|
CoroutineIOCompletion *co = opaque;
|
||||||
|
|
||||||
co->ret = ret;
|
co->ret = ret;
|
||||||
qemu_coroutine_enter(co->coroutine, NULL);
|
qemu_coroutine_enter(co->coroutine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
|
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
|
||||||
@@ -1752,8 +1752,9 @@ int64_t bdrv_get_block_status_above(BlockDriverState *bs,
|
|||||||
} else {
|
} else {
|
||||||
AioContext *aio_context = bdrv_get_aio_context(bs);
|
AioContext *aio_context = bdrv_get_aio_context(bs);
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_get_block_status_above_co_entry);
|
co = qemu_coroutine_create(bdrv_get_block_status_above_co_entry,
|
||||||
qemu_coroutine_enter(co, &data);
|
&data);
|
||||||
|
qemu_coroutine_enter(co);
|
||||||
while (!data.done) {
|
while (!data.done) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
@@ -1901,9 +1902,9 @@ bdrv_rw_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos,
|
|||||||
.is_read = is_read,
|
.is_read = is_read,
|
||||||
.ret = -EINPROGRESS,
|
.ret = -EINPROGRESS,
|
||||||
};
|
};
|
||||||
Coroutine *co = qemu_coroutine_create(bdrv_co_rw_vmstate_entry);
|
Coroutine *co = qemu_coroutine_create(bdrv_co_rw_vmstate_entry, &data);
|
||||||
|
|
||||||
qemu_coroutine_enter(co, &data);
|
qemu_coroutine_enter(co);
|
||||||
while (data.ret == -EINPROGRESS) {
|
while (data.ret == -EINPROGRESS) {
|
||||||
aio_poll(bdrv_get_aio_context(bs), true);
|
aio_poll(bdrv_get_aio_context(bs), true);
|
||||||
}
|
}
|
||||||
@@ -2113,8 +2114,8 @@ static BlockAIOCB *bdrv_co_aio_rw_vector(BdrvChild *child,
|
|||||||
acb->req.flags = flags;
|
acb->req.flags = flags;
|
||||||
acb->is_write = is_write;
|
acb->is_write = is_write;
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_co_do_rw);
|
co = qemu_coroutine_create(bdrv_co_do_rw, acb);
|
||||||
qemu_coroutine_enter(co, acb);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
bdrv_co_maybe_schedule_bh(acb);
|
bdrv_co_maybe_schedule_bh(acb);
|
||||||
return &acb->common;
|
return &acb->common;
|
||||||
@@ -2141,8 +2142,8 @@ BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,
|
|||||||
acb->need_bh = true;
|
acb->need_bh = true;
|
||||||
acb->req.error = -EINPROGRESS;
|
acb->req.error = -EINPROGRESS;
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_aio_flush_co_entry);
|
co = qemu_coroutine_create(bdrv_aio_flush_co_entry, acb);
|
||||||
qemu_coroutine_enter(co, acb);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
bdrv_co_maybe_schedule_bh(acb);
|
bdrv_co_maybe_schedule_bh(acb);
|
||||||
return &acb->common;
|
return &acb->common;
|
||||||
@@ -2171,8 +2172,8 @@ BlockAIOCB *bdrv_aio_discard(BlockDriverState *bs,
|
|||||||
acb->req.error = -EINPROGRESS;
|
acb->req.error = -EINPROGRESS;
|
||||||
acb->req.sector = sector_num;
|
acb->req.sector = sector_num;
|
||||||
acb->req.nb_sectors = nb_sectors;
|
acb->req.nb_sectors = nb_sectors;
|
||||||
co = qemu_coroutine_create(bdrv_aio_discard_co_entry);
|
co = qemu_coroutine_create(bdrv_aio_discard_co_entry, acb);
|
||||||
qemu_coroutine_enter(co, acb);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
bdrv_co_maybe_schedule_bh(acb);
|
bdrv_co_maybe_schedule_bh(acb);
|
||||||
return &acb->common;
|
return &acb->common;
|
||||||
@@ -2313,8 +2314,8 @@ int bdrv_flush(BlockDriverState *bs)
|
|||||||
} else {
|
} else {
|
||||||
AioContext *aio_context = bdrv_get_aio_context(bs);
|
AioContext *aio_context = bdrv_get_aio_context(bs);
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_flush_co_entry);
|
co = qemu_coroutine_create(bdrv_flush_co_entry, &flush_co);
|
||||||
qemu_coroutine_enter(co, &flush_co);
|
qemu_coroutine_enter(co);
|
||||||
while (flush_co.ret == NOT_DONE) {
|
while (flush_co.ret == NOT_DONE) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
@@ -2442,8 +2443,8 @@ int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors)
|
|||||||
} else {
|
} else {
|
||||||
AioContext *aio_context = bdrv_get_aio_context(bs);
|
AioContext *aio_context = bdrv_get_aio_context(bs);
|
||||||
|
|
||||||
co = qemu_coroutine_create(bdrv_discard_co_entry);
|
co = qemu_coroutine_create(bdrv_discard_co_entry, &rwco);
|
||||||
qemu_coroutine_enter(co, &rwco);
|
qemu_coroutine_enter(co);
|
||||||
while (rwco.ret == NOT_DONE) {
|
while (rwco.ret == NOT_DONE) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
@@ -2505,9 +2506,9 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
|
|||||||
/* Fast-path if already in coroutine context */
|
/* Fast-path if already in coroutine context */
|
||||||
bdrv_co_ioctl_entry(&data);
|
bdrv_co_ioctl_entry(&data);
|
||||||
} else {
|
} else {
|
||||||
Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry);
|
Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry, &data);
|
||||||
|
|
||||||
qemu_coroutine_enter(co, &data);
|
qemu_coroutine_enter(co);
|
||||||
while (data.ret == -EINPROGRESS) {
|
while (data.ret == -EINPROGRESS) {
|
||||||
aio_poll(bdrv_get_aio_context(bs), true);
|
aio_poll(bdrv_get_aio_context(bs), true);
|
||||||
}
|
}
|
||||||
@@ -2535,8 +2536,8 @@ BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
|
|||||||
acb->req.error = -EINPROGRESS;
|
acb->req.error = -EINPROGRESS;
|
||||||
acb->req.req = req;
|
acb->req.req = req;
|
||||||
acb->req.buf = buf;
|
acb->req.buf = buf;
|
||||||
co = qemu_coroutine_create(bdrv_co_aio_ioctl_entry);
|
co = qemu_coroutine_create(bdrv_co_aio_ioctl_entry, acb);
|
||||||
qemu_coroutine_enter(co, acb);
|
qemu_coroutine_enter(co);
|
||||||
|
|
||||||
bdrv_co_maybe_schedule_bh(acb);
|
bdrv_co_maybe_schedule_bh(acb);
|
||||||
return &acb->common;
|
return &acb->common;
|
||||||
|
@@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <scsi/sg.h>
|
#include <scsi/sg.h>
|
||||||
#include <block/scsi.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct IscsiLun {
|
typedef struct IscsiLun {
|
||||||
@@ -153,7 +152,7 @@ static void iscsi_co_generic_bh_cb(void *opaque)
|
|||||||
struct IscsiTask *iTask = opaque;
|
struct IscsiTask *iTask = opaque;
|
||||||
iTask->complete = 1;
|
iTask->complete = 1;
|
||||||
qemu_bh_delete(iTask->bh);
|
qemu_bh_delete(iTask->bh);
|
||||||
qemu_coroutine_enter(iTask->co, NULL);
|
qemu_coroutine_enter(iTask->co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iscsi_retry_timer_expired(void *opaque)
|
static void iscsi_retry_timer_expired(void *opaque)
|
||||||
@@ -161,7 +160,7 @@ static void iscsi_retry_timer_expired(void *opaque)
|
|||||||
struct IscsiTask *iTask = opaque;
|
struct IscsiTask *iTask = opaque;
|
||||||
iTask->complete = 1;
|
iTask->complete = 1;
|
||||||
if (iTask->co) {
|
if (iTask->co) {
|
||||||
qemu_coroutine_enter(iTask->co, NULL);
|
qemu_coroutine_enter(iTask->co);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)
|
|||||||
|
|
||||||
laiocb->ret = ret;
|
laiocb->ret = ret;
|
||||||
if (laiocb->co) {
|
if (laiocb->co) {
|
||||||
qemu_coroutine_enter(laiocb->co, NULL);
|
qemu_coroutine_enter(laiocb->co);
|
||||||
} else {
|
} else {
|
||||||
laiocb->common.cb(laiocb->common.opaque, ret);
|
laiocb->common.cb(laiocb->common.opaque, ret);
|
||||||
qemu_aio_unref(laiocb);
|
qemu_aio_unref(laiocb);
|
||||||
|
@@ -121,7 +121,7 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
|
|||||||
g_free(op);
|
g_free(op);
|
||||||
|
|
||||||
if (s->waiting_for_io) {
|
if (s->waiting_for_io) {
|
||||||
qemu_coroutine_enter(s->common.co, NULL);
|
qemu_coroutine_enter(s->common.co);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,7 +422,9 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
|||||||
assert(io_sectors);
|
assert(io_sectors);
|
||||||
sector_num += io_sectors;
|
sector_num += io_sectors;
|
||||||
nb_chunks -= DIV_ROUND_UP(io_sectors, sectors_per_chunk);
|
nb_chunks -= DIV_ROUND_UP(io_sectors, sectors_per_chunk);
|
||||||
delay_ns += ratelimit_calculate_delay(&s->limit, io_sectors);
|
if (s->common.speed) {
|
||||||
|
delay_ns = ratelimit_calculate_delay(&s->limit, io_sectors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return delay_ns;
|
return delay_ns;
|
||||||
}
|
}
|
||||||
@@ -761,7 +763,8 @@ static void mirror_complete(BlockJob *job, Error **errp)
|
|||||||
target = blk_bs(s->target);
|
target = blk_bs(s->target);
|
||||||
|
|
||||||
if (!s->synced) {
|
if (!s->synced) {
|
||||||
error_setg(errp, QERR_BLOCK_JOB_NOT_READY, job->id);
|
error_setg(errp, "The active block job '%s' cannot be completed",
|
||||||
|
job->id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -842,8 +845,8 @@ static const BlockJobDriver commit_active_job_driver = {
|
|||||||
.attached_aio_context = mirror_attached_aio_context,
|
.attached_aio_context = mirror_attached_aio_context,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
|
static void mirror_start_job(const char *job_id, BlockDriverState *bs,
|
||||||
const char *replaces,
|
BlockDriverState *target, const char *replaces,
|
||||||
int64_t speed, uint32_t granularity,
|
int64_t speed, uint32_t granularity,
|
||||||
int64_t buf_size,
|
int64_t buf_size,
|
||||||
BlockMirrorBackingMode backing_mode,
|
BlockMirrorBackingMode backing_mode,
|
||||||
@@ -872,7 +875,7 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
buf_size = DEFAULT_MIRROR_BUF_SIZE;
|
buf_size = DEFAULT_MIRROR_BUF_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = block_job_create(driver, bs, speed, cb, opaque, errp);
|
s = block_job_create(job_id, driver, bs, speed, cb, opaque, errp);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -900,13 +903,13 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
|
|
||||||
bdrv_op_block_all(target, s->common.blocker);
|
bdrv_op_block_all(target, s->common.blocker);
|
||||||
|
|
||||||
s->common.co = qemu_coroutine_create(mirror_run);
|
s->common.co = qemu_coroutine_create(mirror_run, s);
|
||||||
trace_mirror_start(bs, s, s->common.co, opaque);
|
trace_mirror_start(bs, s, s->common.co, opaque);
|
||||||
qemu_coroutine_enter(s->common.co, s);
|
qemu_coroutine_enter(s->common.co);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mirror_start(BlockDriverState *bs, BlockDriverState *target,
|
void mirror_start(const char *job_id, BlockDriverState *bs,
|
||||||
const char *replaces,
|
BlockDriverState *target, const char *replaces,
|
||||||
int64_t speed, uint32_t granularity, int64_t buf_size,
|
int64_t speed, uint32_t granularity, int64_t buf_size,
|
||||||
MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
|
MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
|
||||||
BlockdevOnError on_source_error,
|
BlockdevOnError on_source_error,
|
||||||
@@ -924,14 +927,14 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,
|
|||||||
}
|
}
|
||||||
is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
|
is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
|
||||||
base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
|
base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
|
||||||
mirror_start_job(bs, target, replaces,
|
mirror_start_job(job_id, bs, target, replaces,
|
||||||
speed, granularity, buf_size, backing_mode,
|
speed, granularity, buf_size, backing_mode,
|
||||||
on_source_error, on_target_error, unmap, cb, opaque, errp,
|
on_source_error, on_target_error, unmap, cb, opaque, errp,
|
||||||
&mirror_job_driver, is_none_mode, base);
|
&mirror_job_driver, is_none_mode, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void commit_active_start(BlockDriverState *bs, BlockDriverState *base,
|
void commit_active_start(const char *job_id, BlockDriverState *bs,
|
||||||
int64_t speed,
|
BlockDriverState *base, int64_t speed,
|
||||||
BlockdevOnError on_error,
|
BlockdevOnError on_error,
|
||||||
BlockCompletionFunc *cb,
|
BlockCompletionFunc *cb,
|
||||||
void *opaque, Error **errp)
|
void *opaque, Error **errp)
|
||||||
@@ -972,7 +975,8 @@ void commit_active_start(BlockDriverState *bs, BlockDriverState *base,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mirror_start_job(bs, base, NULL, speed, 0, 0, MIRROR_LEAVE_BACKING_CHAIN,
|
mirror_start_job(job_id, bs, base, NULL, speed, 0, 0,
|
||||||
|
MIRROR_LEAVE_BACKING_CHAIN,
|
||||||
on_error, on_error, false, cb, opaque, &local_err,
|
on_error, on_error, false, cb, opaque, &local_err,
|
||||||
&commit_active_job_driver, false, base);
|
&commit_active_job_driver, false, base);
|
||||||
if (local_err) {
|
if (local_err) {
|
||||||
|
@@ -38,7 +38,7 @@ static void nbd_recv_coroutines_enter_all(NbdClientSession *s)
|
|||||||
|
|
||||||
for (i = 0; i < MAX_NBD_REQUESTS; i++) {
|
for (i = 0; i < MAX_NBD_REQUESTS; i++) {
|
||||||
if (s->recv_coroutine[i]) {
|
if (s->recv_coroutine[i]) {
|
||||||
qemu_coroutine_enter(s->recv_coroutine[i], NULL);
|
qemu_coroutine_enter(s->recv_coroutine[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ static void nbd_reply_ready(void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s->recv_coroutine[i]) {
|
if (s->recv_coroutine[i]) {
|
||||||
qemu_coroutine_enter(s->recv_coroutine[i], NULL);
|
qemu_coroutine_enter(s->recv_coroutine[i]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ static void nbd_restart_write(void *opaque)
|
|||||||
{
|
{
|
||||||
BlockDriverState *bs = opaque;
|
BlockDriverState *bs = opaque;
|
||||||
|
|
||||||
qemu_coroutine_enter(nbd_get_client_session(bs)->send_coroutine, NULL);
|
qemu_coroutine_enter(nbd_get_client_session(bs)->send_coroutine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nbd_co_send_request(BlockDriverState *bs,
|
static int nbd_co_send_request(BlockDriverState *bs,
|
||||||
|
@@ -104,7 +104,7 @@ static void nfs_co_generic_bh_cb(void *opaque)
|
|||||||
NFSRPC *task = opaque;
|
NFSRPC *task = opaque;
|
||||||
task->complete = 1;
|
task->complete = 1;
|
||||||
qemu_bh_delete(task->bh);
|
qemu_bh_delete(task->bh);
|
||||||
qemu_coroutine_enter(task->co, NULL);
|
qemu_coroutine_enter(task->co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -948,8 +948,8 @@ static int qcow_write(BlockDriverState *bs, int64_t sector_num,
|
|||||||
.nb_sectors = nb_sectors,
|
.nb_sectors = nb_sectors,
|
||||||
.ret = -EINPROGRESS,
|
.ret = -EINPROGRESS,
|
||||||
};
|
};
|
||||||
co = qemu_coroutine_create(qcow_write_co_entry);
|
co = qemu_coroutine_create(qcow_write_co_entry, &data);
|
||||||
qemu_coroutine_enter(co, &data);
|
qemu_coroutine_enter(co);
|
||||||
while (data.ret == -EINPROGRESS) {
|
while (data.ret == -EINPROGRESS) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,8 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_l1_size > INT_MAX / sizeof(uint64_t)) {
|
QEMU_BUILD_BUG_ON(QCOW_MAX_L1_SIZE > INT_MAX);
|
||||||
|
if (new_l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) {
|
||||||
return -EFBIG;
|
return -EFBIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,8 +483,8 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
|||||||
unsigned int l2_index;
|
unsigned int l2_index;
|
||||||
uint64_t l1_index, l2_offset, *l2_table;
|
uint64_t l1_index, l2_offset, *l2_table;
|
||||||
int l1_bits, c;
|
int l1_bits, c;
|
||||||
unsigned int offset_in_cluster, nb_clusters;
|
unsigned int offset_in_cluster;
|
||||||
uint64_t bytes_available, bytes_needed;
|
uint64_t bytes_available, bytes_needed, nb_clusters;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
offset_in_cluster = offset_into_cluster(s, offset);
|
offset_in_cluster = offset_into_cluster(s, offset);
|
||||||
@@ -499,7 +500,6 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
|||||||
if (bytes_needed > bytes_available) {
|
if (bytes_needed > bytes_available) {
|
||||||
bytes_needed = bytes_available;
|
bytes_needed = bytes_available;
|
||||||
}
|
}
|
||||||
assert(bytes_needed <= INT_MAX);
|
|
||||||
|
|
||||||
*cluster_offset = 0;
|
*cluster_offset = 0;
|
||||||
|
|
||||||
@@ -536,8 +536,11 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
|||||||
l2_index = (offset >> s->cluster_bits) & (s->l2_size - 1);
|
l2_index = (offset >> s->cluster_bits) & (s->l2_size - 1);
|
||||||
*cluster_offset = be64_to_cpu(l2_table[l2_index]);
|
*cluster_offset = be64_to_cpu(l2_table[l2_index]);
|
||||||
|
|
||||||
/* nb_needed <= INT_MAX, thus nb_clusters <= INT_MAX, too */
|
|
||||||
nb_clusters = size_to_clusters(s, bytes_needed);
|
nb_clusters = size_to_clusters(s, bytes_needed);
|
||||||
|
/* bytes_needed <= *bytes + offset_in_cluster, both of which are unsigned
|
||||||
|
* integers; the minimum cluster size is 512, so this assertion is always
|
||||||
|
* true */
|
||||||
|
assert(nb_clusters <= INT_MAX);
|
||||||
|
|
||||||
ret = qcow2_get_cluster_type(*cluster_offset);
|
ret = qcow2_get_cluster_type(*cluster_offset);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
@@ -584,13 +587,17 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
|||||||
|
|
||||||
qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
|
qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
|
||||||
|
|
||||||
bytes_available = (c * s->cluster_size);
|
bytes_available = (int64_t)c * s->cluster_size;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (bytes_available > bytes_needed) {
|
if (bytes_available > bytes_needed) {
|
||||||
bytes_available = bytes_needed;
|
bytes_available = bytes_needed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* bytes_available <= bytes_needed <= *bytes + offset_in_cluster;
|
||||||
|
* subtracting offset_in_cluster will therefore definitely yield something
|
||||||
|
* not exceeding UINT_MAX */
|
||||||
|
assert(bytes_available - offset_in_cluster <= UINT_MAX);
|
||||||
*bytes = bytes_available - offset_in_cluster;
|
*bytes = bytes_available - offset_in_cluster;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -2570,8 +2570,8 @@ static int qcow2_write(BlockDriverState *bs, int64_t sector_num,
|
|||||||
.nb_sectors = nb_sectors,
|
.nb_sectors = nb_sectors,
|
||||||
.ret = -EINPROGRESS,
|
.ret = -EINPROGRESS,
|
||||||
};
|
};
|
||||||
co = qemu_coroutine_create(qcow2_write_co_entry);
|
co = qemu_coroutine_create(qcow2_write_co_entry, &data);
|
||||||
qemu_coroutine_enter(co, &data);
|
qemu_coroutine_enter(co);
|
||||||
while (data.ret == -EINPROGRESS) {
|
while (data.ret == -EINPROGRESS) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
|
@@ -708,7 +708,7 @@ static void qed_is_allocated_cb(void *opaque, int ret, uint64_t offset, size_t l
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cb->co) {
|
if (cb->co) {
|
||||||
qemu_coroutine_enter(cb->co, NULL);
|
qemu_coroutine_enter(cb->co);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1425,7 +1425,7 @@ static void coroutine_fn qed_co_pwrite_zeroes_cb(void *opaque, int ret)
|
|||||||
cb->done = true;
|
cb->done = true;
|
||||||
cb->ret = ret;
|
cb->ret = ret;
|
||||||
if (cb->co) {
|
if (cb->co) {
|
||||||
qemu_coroutine_enter(cb->co, NULL);
|
qemu_coroutine_enter(cb->co);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -639,15 +639,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
|
|||||||
|
|
||||||
if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
|
if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
|
||||||
/* dup the original fd */
|
/* dup the original fd */
|
||||||
/* TODO: use qemu fcntl wrapper */
|
raw_s->fd = qemu_dup(s->fd);
|
||||||
#ifdef F_DUPFD_CLOEXEC
|
|
||||||
raw_s->fd = fcntl(s->fd, F_DUPFD_CLOEXEC, 0);
|
|
||||||
#else
|
|
||||||
raw_s->fd = dup(s->fd);
|
|
||||||
if (raw_s->fd != -1) {
|
|
||||||
qemu_set_cloexec(raw_s->fd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (raw_s->fd >= 0) {
|
if (raw_s->fd >= 0) {
|
||||||
ret = fcntl_setfl(raw_s->fd, raw_s->open_flags);
|
ret = fcntl_setfl(raw_s->fd, raw_s->open_flags);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@@ -495,7 +495,7 @@ static inline void free_aio_req(BDRVSheepdogState *s, AIOReq *aio_req)
|
|||||||
|
|
||||||
static void coroutine_fn sd_finish_aiocb(SheepdogAIOCB *acb)
|
static void coroutine_fn sd_finish_aiocb(SheepdogAIOCB *acb)
|
||||||
{
|
{
|
||||||
qemu_coroutine_enter(acb->coroutine, NULL);
|
qemu_coroutine_enter(acb->coroutine);
|
||||||
qemu_aio_unref(acb);
|
qemu_aio_unref(acb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,7 +636,7 @@ static void restart_co_req(void *opaque)
|
|||||||
{
|
{
|
||||||
Coroutine *co = opaque;
|
Coroutine *co = opaque;
|
||||||
|
|
||||||
qemu_coroutine_enter(co, NULL);
|
qemu_coroutine_enter(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct SheepdogReqCo {
|
typedef struct SheepdogReqCo {
|
||||||
@@ -726,8 +726,8 @@ static int do_req(int sockfd, AioContext *aio_context, SheepdogReq *hdr,
|
|||||||
if (qemu_in_coroutine()) {
|
if (qemu_in_coroutine()) {
|
||||||
do_co_req(&srco);
|
do_co_req(&srco);
|
||||||
} else {
|
} else {
|
||||||
co = qemu_coroutine_create(do_co_req);
|
co = qemu_coroutine_create(do_co_req, &srco);
|
||||||
qemu_coroutine_enter(co, &srco);
|
qemu_coroutine_enter(co);
|
||||||
while (!srco.finished) {
|
while (!srco.finished) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
@@ -925,17 +925,17 @@ static void co_read_response(void *opaque)
|
|||||||
BDRVSheepdogState *s = opaque;
|
BDRVSheepdogState *s = opaque;
|
||||||
|
|
||||||
if (!s->co_recv) {
|
if (!s->co_recv) {
|
||||||
s->co_recv = qemu_coroutine_create(aio_read_response);
|
s->co_recv = qemu_coroutine_create(aio_read_response, opaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_coroutine_enter(s->co_recv, opaque);
|
qemu_coroutine_enter(s->co_recv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void co_write_request(void *opaque)
|
static void co_write_request(void *opaque)
|
||||||
{
|
{
|
||||||
BDRVSheepdogState *s = opaque;
|
BDRVSheepdogState *s = opaque;
|
||||||
|
|
||||||
qemu_coroutine_enter(s->co_send, NULL);
|
qemu_coroutine_enter(s->co_send);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -777,7 +777,7 @@ static void restart_coroutine(void *opaque)
|
|||||||
|
|
||||||
DPRINTF("co=%p", co);
|
DPRINTF("co=%p", co);
|
||||||
|
|
||||||
qemu_coroutine_enter(co, NULL);
|
qemu_coroutine_enter(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static coroutine_fn void set_fd_handler(BDRVSSHState *s, BlockDriverState *bs)
|
static coroutine_fn void set_fd_handler(BDRVSSHState *s, BlockDriverState *bs)
|
||||||
|
@@ -95,6 +95,7 @@ static void coroutine_fn stream_run(void *opaque)
|
|||||||
BlockDriverState *base = s->base;
|
BlockDriverState *base = s->base;
|
||||||
int64_t sector_num = 0;
|
int64_t sector_num = 0;
|
||||||
int64_t end = -1;
|
int64_t end = -1;
|
||||||
|
uint64_t delay_ns = 0;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
@@ -123,10 +124,8 @@ static void coroutine_fn stream_run(void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (sector_num = 0; sector_num < end; sector_num += n) {
|
for (sector_num = 0; sector_num < end; sector_num += n) {
|
||||||
uint64_t delay_ns = 0;
|
|
||||||
bool copy;
|
bool copy;
|
||||||
|
|
||||||
wait:
|
|
||||||
/* Note that even when no rate limit is applied we need to yield
|
/* Note that even when no rate limit is applied we need to yield
|
||||||
* with no pending I/O here so that bdrv_drain_all() returns.
|
* with no pending I/O here so that bdrv_drain_all() returns.
|
||||||
*/
|
*/
|
||||||
@@ -156,12 +155,6 @@ wait:
|
|||||||
}
|
}
|
||||||
trace_stream_one_iteration(s, sector_num, n, ret);
|
trace_stream_one_iteration(s, sector_num, n, ret);
|
||||||
if (copy) {
|
if (copy) {
|
||||||
if (s->common.speed) {
|
|
||||||
delay_ns = ratelimit_calculate_delay(&s->limit, n);
|
|
||||||
if (delay_ns > 0) {
|
|
||||||
goto wait;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ret = stream_populate(blk, sector_num, n, buf);
|
ret = stream_populate(blk, sector_num, n, buf);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@@ -182,6 +175,9 @@ wait:
|
|||||||
|
|
||||||
/* Publish progress */
|
/* Publish progress */
|
||||||
s->common.offset += n * BDRV_SECTOR_SIZE;
|
s->common.offset += n * BDRV_SECTOR_SIZE;
|
||||||
|
if (copy && s->common.speed) {
|
||||||
|
delay_ns = ratelimit_calculate_delay(&s->limit, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!base) {
|
if (!base) {
|
||||||
@@ -218,15 +214,15 @@ static const BlockJobDriver stream_job_driver = {
|
|||||||
.set_speed = stream_set_speed,
|
.set_speed = stream_set_speed,
|
||||||
};
|
};
|
||||||
|
|
||||||
void stream_start(BlockDriverState *bs, BlockDriverState *base,
|
void stream_start(const char *job_id, BlockDriverState *bs,
|
||||||
const char *backing_file_str, int64_t speed,
|
BlockDriverState *base, const char *backing_file_str,
|
||||||
BlockdevOnError on_error,
|
int64_t speed, BlockdevOnError on_error,
|
||||||
BlockCompletionFunc *cb,
|
BlockCompletionFunc *cb, void *opaque, Error **errp)
|
||||||
void *opaque, Error **errp)
|
|
||||||
{
|
{
|
||||||
StreamBlockJob *s;
|
StreamBlockJob *s;
|
||||||
|
|
||||||
s = block_job_create(&stream_job_driver, bs, speed, cb, opaque, errp);
|
s = block_job_create(job_id, &stream_job_driver, bs, speed,
|
||||||
|
cb, opaque, errp);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -235,7 +231,7 @@ void stream_start(BlockDriverState *bs, BlockDriverState *base,
|
|||||||
s->backing_file_str = g_strdup(backing_file_str);
|
s->backing_file_str = g_strdup(backing_file_str);
|
||||||
|
|
||||||
s->on_error = on_error;
|
s->on_error = on_error;
|
||||||
s->common.co = qemu_coroutine_create(stream_run);
|
s->common.co = qemu_coroutine_create(stream_run, s);
|
||||||
trace_stream_start(bs, base, s, s->common.co, opaque);
|
trace_stream_start(bs, base, s, s->common.co, opaque);
|
||||||
qemu_coroutine_enter(s->common.co, s);
|
qemu_coroutine_enter(s->common.co);
|
||||||
}
|
}
|
||||||
|
18
block/vmdk.c
18
block/vmdk.c
@@ -1202,13 +1202,6 @@ static int get_cluster_offset(BlockDriverState *bs,
|
|||||||
l2_index = ((offset >> 9) / extent->cluster_sectors) % extent->l2_size;
|
l2_index = ((offset >> 9) / extent->cluster_sectors) % extent->l2_size;
|
||||||
cluster_sector = le32_to_cpu(l2_table[l2_index]);
|
cluster_sector = le32_to_cpu(l2_table[l2_index]);
|
||||||
|
|
||||||
if (m_data) {
|
|
||||||
m_data->valid = 1;
|
|
||||||
m_data->l1_index = l1_index;
|
|
||||||
m_data->l2_index = l2_index;
|
|
||||||
m_data->l2_offset = l2_offset;
|
|
||||||
m_data->l2_cache_entry = &l2_table[l2_index];
|
|
||||||
}
|
|
||||||
if (extent->has_zero_grain && cluster_sector == VMDK_GTE_ZEROED) {
|
if (extent->has_zero_grain && cluster_sector == VMDK_GTE_ZEROED) {
|
||||||
zeroed = true;
|
zeroed = true;
|
||||||
}
|
}
|
||||||
@@ -1231,6 +1224,13 @@ static int get_cluster_offset(BlockDriverState *bs,
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (m_data) {
|
||||||
|
m_data->valid = 1;
|
||||||
|
m_data->l1_index = l1_index;
|
||||||
|
m_data->l2_index = l2_index;
|
||||||
|
m_data->l2_offset = l2_offset;
|
||||||
|
m_data->l2_cache_entry = &l2_table[l2_index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*cluster_offset = cluster_sector << BDRV_SECTOR_BITS;
|
*cluster_offset = cluster_sector << BDRV_SECTOR_BITS;
|
||||||
return VMDK_OK;
|
return VMDK_OK;
|
||||||
@@ -1686,8 +1686,8 @@ static int vmdk_write_compressed(BlockDriverState *bs,
|
|||||||
.nb_sectors = nb_sectors,
|
.nb_sectors = nb_sectors,
|
||||||
.ret = -EINPROGRESS,
|
.ret = -EINPROGRESS,
|
||||||
};
|
};
|
||||||
co = qemu_coroutine_create(vmdk_co_write_compressed);
|
co = qemu_coroutine_create(vmdk_co_write_compressed, &data);
|
||||||
qemu_coroutine_enter(co, &data);
|
qemu_coroutine_enter(co);
|
||||||
while (data.ret == -EINPROGRESS) {
|
while (data.ret == -EINPROGRESS) {
|
||||||
aio_poll(aio_context, true);
|
aio_poll(aio_context, true);
|
||||||
}
|
}
|
||||||
|
@@ -3018,9 +3018,10 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
options = qdict_new();
|
options = qdict_new();
|
||||||
qdict_put(options, "driver", qstring_from_str("qcow"));
|
qdict_put(options, "write-target.driver", qstring_from_str("qcow"));
|
||||||
s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
|
s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
|
||||||
&child_vvfat_qcow, false, errp);
|
&child_vvfat_qcow, false, errp);
|
||||||
|
QDECREF(options);
|
||||||
if (!s->qcow) {
|
if (!s->qcow) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
|
119
blockdev.c
119
blockdev.c
@@ -512,6 +512,8 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
|
|||||||
|
|
||||||
writethrough = !qemu_opt_get_bool(opts, BDRV_OPT_CACHE_WB, true);
|
writethrough = !qemu_opt_get_bool(opts, BDRV_OPT_CACHE_WB, true);
|
||||||
|
|
||||||
|
id = qemu_opts_id(opts);
|
||||||
|
|
||||||
qdict_extract_subqdict(bs_opts, &interval_dict, "stats-intervals.");
|
qdict_extract_subqdict(bs_opts, &interval_dict, "stats-intervals.");
|
||||||
qdict_array_split(interval_dict, &interval_list);
|
qdict_array_split(interval_dict, &interval_list);
|
||||||
|
|
||||||
@@ -616,7 +618,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
|
|||||||
/* disk I/O throttling */
|
/* disk I/O throttling */
|
||||||
if (throttle_enabled(&cfg)) {
|
if (throttle_enabled(&cfg)) {
|
||||||
if (!throttling_group) {
|
if (!throttling_group) {
|
||||||
throttling_group = blk_name(blk);
|
throttling_group = id;
|
||||||
}
|
}
|
||||||
blk_io_limits_enable(blk, throttling_group);
|
blk_io_limits_enable(blk, throttling_group);
|
||||||
blk_set_io_limits(blk, &cfg);
|
blk_set_io_limits(blk, &cfg);
|
||||||
@@ -625,7 +627,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
|
|||||||
blk_set_enable_write_cache(blk, !writethrough);
|
blk_set_enable_write_cache(blk, !writethrough);
|
||||||
blk_set_on_error(blk, on_read_error, on_write_error);
|
blk_set_on_error(blk, on_read_error, on_write_error);
|
||||||
|
|
||||||
if (!monitor_add_blk(blk, qemu_opts_id(opts), errp)) {
|
if (!monitor_add_blk(blk, id, errp)) {
|
||||||
blk_unref(blk);
|
blk_unref(blk);
|
||||||
blk = NULL;
|
blk = NULL;
|
||||||
goto err_no_bs_opts;
|
goto err_no_bs_opts;
|
||||||
@@ -1836,9 +1838,9 @@ typedef struct DriveBackupState {
|
|||||||
BlockJob *job;
|
BlockJob *job;
|
||||||
} DriveBackupState;
|
} DriveBackupState;
|
||||||
|
|
||||||
static void do_drive_backup(const char *device, const char *target,
|
static void do_drive_backup(const char *job_id, const char *device,
|
||||||
bool has_format, const char *format,
|
const char *target, bool has_format,
|
||||||
enum MirrorSyncMode sync,
|
const char *format, enum MirrorSyncMode sync,
|
||||||
bool has_mode, enum NewImageMode mode,
|
bool has_mode, enum NewImageMode mode,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
bool has_bitmap, const char *bitmap,
|
bool has_bitmap, const char *bitmap,
|
||||||
@@ -1876,7 +1878,8 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp)
|
|||||||
bdrv_drained_begin(blk_bs(blk));
|
bdrv_drained_begin(blk_bs(blk));
|
||||||
state->bs = blk_bs(blk);
|
state->bs = blk_bs(blk);
|
||||||
|
|
||||||
do_drive_backup(backup->device, backup->target,
|
do_drive_backup(backup->has_job_id ? backup->job_id : NULL,
|
||||||
|
backup->device, backup->target,
|
||||||
backup->has_format, backup->format,
|
backup->has_format, backup->format,
|
||||||
backup->sync,
|
backup->sync,
|
||||||
backup->has_mode, backup->mode,
|
backup->has_mode, backup->mode,
|
||||||
@@ -1921,8 +1924,8 @@ typedef struct BlockdevBackupState {
|
|||||||
AioContext *aio_context;
|
AioContext *aio_context;
|
||||||
} BlockdevBackupState;
|
} BlockdevBackupState;
|
||||||
|
|
||||||
static void do_blockdev_backup(const char *device, const char *target,
|
static void do_blockdev_backup(const char *job_id, const char *device,
|
||||||
enum MirrorSyncMode sync,
|
const char *target, enum MirrorSyncMode sync,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
bool has_on_source_error,
|
bool has_on_source_error,
|
||||||
BlockdevOnError on_source_error,
|
BlockdevOnError on_source_error,
|
||||||
@@ -1968,8 +1971,8 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp)
|
|||||||
state->bs = blk_bs(blk);
|
state->bs = blk_bs(blk);
|
||||||
bdrv_drained_begin(state->bs);
|
bdrv_drained_begin(state->bs);
|
||||||
|
|
||||||
do_blockdev_backup(backup->device, backup->target,
|
do_blockdev_backup(backup->has_job_id ? backup->job_id : NULL,
|
||||||
backup->sync,
|
backup->device, backup->target, backup->sync,
|
||||||
backup->has_speed, backup->speed,
|
backup->has_speed, backup->speed,
|
||||||
backup->has_on_source_error, backup->on_source_error,
|
backup->has_on_source_error, backup->on_source_error,
|
||||||
backup->has_on_target_error, backup->on_target_error,
|
backup->has_on_target_error, backup->on_target_error,
|
||||||
@@ -3004,7 +3007,7 @@ static void block_job_cb(void *opaque, int ret)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_block_stream(const char *device,
|
void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
|
||||||
bool has_base, const char *base,
|
bool has_base, const char *base,
|
||||||
bool has_backing_file, const char *backing_file,
|
bool has_backing_file, const char *backing_file,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
@@ -3063,8 +3066,8 @@ void qmp_block_stream(const char *device,
|
|||||||
/* backing_file string overrides base bs filename */
|
/* backing_file string overrides base bs filename */
|
||||||
base_name = has_backing_file ? backing_file : base_name;
|
base_name = has_backing_file ? backing_file : base_name;
|
||||||
|
|
||||||
stream_start(bs, base_bs, base_name, has_speed ? speed : 0,
|
stream_start(has_job_id ? job_id : NULL, bs, base_bs, base_name,
|
||||||
on_error, block_job_cb, bs, &local_err);
|
has_speed ? speed : 0, on_error, block_job_cb, bs, &local_err);
|
||||||
if (local_err) {
|
if (local_err) {
|
||||||
error_propagate(errp, local_err);
|
error_propagate(errp, local_err);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -3076,7 +3079,7 @@ out:
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_block_commit(const char *device,
|
void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
|
||||||
bool has_base, const char *base,
|
bool has_base, const char *base,
|
||||||
bool has_top, const char *top,
|
bool has_top, const char *top,
|
||||||
bool has_backing_file, const char *backing_file,
|
bool has_backing_file, const char *backing_file,
|
||||||
@@ -3167,10 +3170,11 @@ void qmp_block_commit(const char *device,
|
|||||||
" but 'top' is the active layer");
|
" but 'top' is the active layer");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
commit_active_start(bs, base_bs, speed, on_error, block_job_cb,
|
commit_active_start(has_job_id ? job_id : NULL, bs, base_bs, speed,
|
||||||
bs, &local_err);
|
on_error, block_job_cb, bs, &local_err);
|
||||||
} else {
|
} else {
|
||||||
commit_start(bs, base_bs, top_bs, speed, on_error, block_job_cb, bs,
|
commit_start(has_job_id ? job_id : NULL, bs, base_bs, top_bs, speed,
|
||||||
|
on_error, block_job_cb, bs,
|
||||||
has_backing_file ? backing_file : NULL, &local_err);
|
has_backing_file ? backing_file : NULL, &local_err);
|
||||||
}
|
}
|
||||||
if (local_err != NULL) {
|
if (local_err != NULL) {
|
||||||
@@ -3182,9 +3186,9 @@ out:
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_drive_backup(const char *device, const char *target,
|
static void do_drive_backup(const char *job_id, const char *device,
|
||||||
bool has_format, const char *format,
|
const char *target, bool has_format,
|
||||||
enum MirrorSyncMode sync,
|
const char *format, enum MirrorSyncMode sync,
|
||||||
bool has_mode, enum NewImageMode mode,
|
bool has_mode, enum NewImageMode mode,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
bool has_bitmap, const char *bitmap,
|
bool has_bitmap, const char *bitmap,
|
||||||
@@ -3303,7 +3307,7 @@ static void do_drive_backup(const char *device, const char *target,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
backup_start(bs, target_bs, speed, sync, bmap,
|
backup_start(job_id, bs, target_bs, speed, sync, bmap,
|
||||||
on_source_error, on_target_error,
|
on_source_error, on_target_error,
|
||||||
block_job_cb, bs, txn, &local_err);
|
block_job_cb, bs, txn, &local_err);
|
||||||
bdrv_unref(target_bs);
|
bdrv_unref(target_bs);
|
||||||
@@ -3316,7 +3320,8 @@ out:
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_drive_backup(const char *device, const char *target,
|
void qmp_drive_backup(bool has_job_id, const char *job_id,
|
||||||
|
const char *device, const char *target,
|
||||||
bool has_format, const char *format,
|
bool has_format, const char *format,
|
||||||
enum MirrorSyncMode sync,
|
enum MirrorSyncMode sync,
|
||||||
bool has_mode, enum NewImageMode mode,
|
bool has_mode, enum NewImageMode mode,
|
||||||
@@ -3326,7 +3331,8 @@ void qmp_drive_backup(const char *device, const char *target,
|
|||||||
bool has_on_target_error, BlockdevOnError on_target_error,
|
bool has_on_target_error, BlockdevOnError on_target_error,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
return do_drive_backup(device, target, has_format, format, sync,
|
return do_drive_backup(has_job_id ? job_id : NULL, device, target,
|
||||||
|
has_format, format, sync,
|
||||||
has_mode, mode, has_speed, speed,
|
has_mode, mode, has_speed, speed,
|
||||||
has_bitmap, bitmap,
|
has_bitmap, bitmap,
|
||||||
has_on_source_error, on_source_error,
|
has_on_source_error, on_source_error,
|
||||||
@@ -3339,8 +3345,8 @@ BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)
|
|||||||
return bdrv_named_nodes_list(errp);
|
return bdrv_named_nodes_list(errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_blockdev_backup(const char *device, const char *target,
|
void do_blockdev_backup(const char *job_id, const char *device,
|
||||||
enum MirrorSyncMode sync,
|
const char *target, enum MirrorSyncMode sync,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
bool has_on_source_error,
|
bool has_on_source_error,
|
||||||
BlockdevOnError on_source_error,
|
BlockdevOnError on_source_error,
|
||||||
@@ -3395,7 +3401,7 @@ void do_blockdev_backup(const char *device, const char *target,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
backup_start(bs, target_bs, speed, sync, NULL, on_source_error,
|
backup_start(job_id, bs, target_bs, speed, sync, NULL, on_source_error,
|
||||||
on_target_error, block_job_cb, bs, txn, &local_err);
|
on_target_error, block_job_cb, bs, txn, &local_err);
|
||||||
if (local_err != NULL) {
|
if (local_err != NULL) {
|
||||||
error_propagate(errp, local_err);
|
error_propagate(errp, local_err);
|
||||||
@@ -3404,7 +3410,8 @@ out:
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_blockdev_backup(const char *device, const char *target,
|
void qmp_blockdev_backup(bool has_job_id, const char *job_id,
|
||||||
|
const char *device, const char *target,
|
||||||
enum MirrorSyncMode sync,
|
enum MirrorSyncMode sync,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
bool has_on_source_error,
|
bool has_on_source_error,
|
||||||
@@ -3413,7 +3420,8 @@ void qmp_blockdev_backup(const char *device, const char *target,
|
|||||||
BlockdevOnError on_target_error,
|
BlockdevOnError on_target_error,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
do_blockdev_backup(device, target, sync, has_speed, speed,
|
do_blockdev_backup(has_job_id ? job_id : NULL, device, target,
|
||||||
|
sync, has_speed, speed,
|
||||||
has_on_source_error, on_source_error,
|
has_on_source_error, on_source_error,
|
||||||
has_on_target_error, on_target_error,
|
has_on_target_error, on_target_error,
|
||||||
NULL, errp);
|
NULL, errp);
|
||||||
@@ -3422,7 +3430,7 @@ void qmp_blockdev_backup(const char *device, const char *target,
|
|||||||
/* Parameter check and block job starting for drive mirroring.
|
/* Parameter check and block job starting for drive mirroring.
|
||||||
* Caller should hold @device and @target's aio context (must be the same).
|
* Caller should hold @device and @target's aio context (must be the same).
|
||||||
**/
|
**/
|
||||||
static void blockdev_mirror_common(BlockDriverState *bs,
|
static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
|
||||||
BlockDriverState *target,
|
BlockDriverState *target,
|
||||||
bool has_replaces, const char *replaces,
|
bool has_replaces, const char *replaces,
|
||||||
enum MirrorSyncMode sync,
|
enum MirrorSyncMode sync,
|
||||||
@@ -3482,15 +3490,15 @@ static void blockdev_mirror_common(BlockDriverState *bs,
|
|||||||
/* pass the node name to replace to mirror start since it's loose coupling
|
/* pass the node name to replace to mirror start since it's loose coupling
|
||||||
* and will allow to check whether the node still exist at mirror completion
|
* and will allow to check whether the node still exist at mirror completion
|
||||||
*/
|
*/
|
||||||
mirror_start(bs, target,
|
mirror_start(job_id, bs, target,
|
||||||
has_replaces ? replaces : NULL,
|
has_replaces ? replaces : NULL,
|
||||||
speed, granularity, buf_size, sync, backing_mode,
|
speed, granularity, buf_size, sync, backing_mode,
|
||||||
on_source_error, on_target_error, unmap,
|
on_source_error, on_target_error, unmap,
|
||||||
block_job_cb, bs, errp);
|
block_job_cb, bs, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_drive_mirror(const char *device, const char *target,
|
void qmp_drive_mirror(bool has_job_id, const char *job_id, const char *device,
|
||||||
bool has_format, const char *format,
|
const char *target, bool has_format, const char *format,
|
||||||
bool has_node_name, const char *node_name,
|
bool has_node_name, const char *node_name,
|
||||||
bool has_replaces, const char *replaces,
|
bool has_replaces, const char *replaces,
|
||||||
enum MirrorSyncMode sync,
|
enum MirrorSyncMode sync,
|
||||||
@@ -3634,7 +3642,7 @@ void qmp_drive_mirror(const char *device, const char *target,
|
|||||||
|
|
||||||
bdrv_set_aio_context(target_bs, aio_context);
|
bdrv_set_aio_context(target_bs, aio_context);
|
||||||
|
|
||||||
blockdev_mirror_common(bs, target_bs,
|
blockdev_mirror_common(has_job_id ? job_id : NULL, bs, target_bs,
|
||||||
has_replaces, replaces, sync, backing_mode,
|
has_replaces, replaces, sync, backing_mode,
|
||||||
has_speed, speed,
|
has_speed, speed,
|
||||||
has_granularity, granularity,
|
has_granularity, granularity,
|
||||||
@@ -3649,7 +3657,8 @@ out:
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_blockdev_mirror(const char *device, const char *target,
|
void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
|
||||||
|
const char *device, const char *target,
|
||||||
bool has_replaces, const char *replaces,
|
bool has_replaces, const char *replaces,
|
||||||
MirrorSyncMode sync,
|
MirrorSyncMode sync,
|
||||||
bool has_speed, int64_t speed,
|
bool has_speed, int64_t speed,
|
||||||
@@ -3690,7 +3699,7 @@ void qmp_blockdev_mirror(const char *device, const char *target,
|
|||||||
|
|
||||||
bdrv_set_aio_context(target_bs, aio_context);
|
bdrv_set_aio_context(target_bs, aio_context);
|
||||||
|
|
||||||
blockdev_mirror_common(bs, target_bs,
|
blockdev_mirror_common(has_job_id ? job_id : NULL, bs, target_bs,
|
||||||
has_replaces, replaces, sync, backing_mode,
|
has_replaces, replaces, sync, backing_mode,
|
||||||
has_speed, speed,
|
has_speed, speed,
|
||||||
has_granularity, granularity,
|
has_granularity, granularity,
|
||||||
@@ -3704,42 +3713,28 @@ void qmp_blockdev_mirror(const char *device, const char *target,
|
|||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the block job for a given device name and acquire its AioContext */
|
/* Get a block job using its ID and acquire its AioContext */
|
||||||
static BlockJob *find_block_job(const char *device, AioContext **aio_context,
|
static BlockJob *find_block_job(const char *id, AioContext **aio_context,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
BlockBackend *blk;
|
BlockJob *job;
|
||||||
BlockDriverState *bs;
|
|
||||||
|
assert(id != NULL);
|
||||||
|
|
||||||
*aio_context = NULL;
|
*aio_context = NULL;
|
||||||
|
|
||||||
blk = blk_by_name(device);
|
job = block_job_get(id);
|
||||||
if (!blk) {
|
|
||||||
goto notfound;
|
if (!job) {
|
||||||
|
error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
|
||||||
|
"Block job '%s' not found", id);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aio_context = blk_get_aio_context(blk);
|
*aio_context = blk_get_aio_context(job->blk);
|
||||||
aio_context_acquire(*aio_context);
|
aio_context_acquire(*aio_context);
|
||||||
|
|
||||||
if (!blk_is_available(blk)) {
|
return job;
|
||||||
goto notfound;
|
|
||||||
}
|
|
||||||
bs = blk_bs(blk);
|
|
||||||
|
|
||||||
if (!bs->job) {
|
|
||||||
goto notfound;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bs->job;
|
|
||||||
|
|
||||||
notfound:
|
|
||||||
error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
|
|
||||||
"No active block job on device '%s'", device);
|
|
||||||
if (*aio_context) {
|
|
||||||
aio_context_release(*aio_context);
|
|
||||||
*aio_context = NULL;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_block_job_set_speed(const char *device, int64_t speed, Error **errp)
|
void qmp_block_job_set_speed(const char *device, int64_t speed, Error **errp)
|
||||||
|
42
blockjob.c
42
blockjob.c
@@ -33,6 +33,7 @@
|
|||||||
#include "qapi/qmp/qerror.h"
|
#include "qapi/qmp/qerror.h"
|
||||||
#include "qapi/qmp/qjson.h"
|
#include "qapi/qmp/qjson.h"
|
||||||
#include "qemu/coroutine.h"
|
#include "qemu/coroutine.h"
|
||||||
|
#include "qemu/id.h"
|
||||||
#include "qmp-commands.h"
|
#include "qmp-commands.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "qapi-event.h"
|
#include "qapi-event.h"
|
||||||
@@ -60,6 +61,19 @@ BlockJob *block_job_next(BlockJob *job)
|
|||||||
return QLIST_NEXT(job, job_list);
|
return QLIST_NEXT(job, job_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlockJob *block_job_get(const char *id)
|
||||||
|
{
|
||||||
|
BlockJob *job;
|
||||||
|
|
||||||
|
QLIST_FOREACH(job, &block_jobs, job_list) {
|
||||||
|
if (!strcmp(id, job->id)) {
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Normally the job runs in its BlockBackend's AioContext. The exception is
|
/* Normally the job runs in its BlockBackend's AioContext. The exception is
|
||||||
* block_job_defer_to_main_loop() where it runs in the QEMU main loop. Code
|
* block_job_defer_to_main_loop() where it runs in the QEMU main loop. Code
|
||||||
* that supports both cases uses this helper function.
|
* that supports both cases uses this helper function.
|
||||||
@@ -103,9 +117,9 @@ static void block_job_detach_aio_context(void *opaque)
|
|||||||
block_job_unref(job);
|
block_job_unref(job);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
|
void *block_job_create(const char *job_id, const BlockJobDriver *driver,
|
||||||
int64_t speed, BlockCompletionFunc *cb,
|
BlockDriverState *bs, int64_t speed,
|
||||||
void *opaque, Error **errp)
|
BlockCompletionFunc *cb, void *opaque, Error **errp)
|
||||||
{
|
{
|
||||||
BlockBackend *blk;
|
BlockBackend *blk;
|
||||||
BlockJob *job;
|
BlockJob *job;
|
||||||
@@ -116,6 +130,20 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (job_id == NULL) {
|
||||||
|
job_id = bdrv_get_device_name(bs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!id_wellformed(job_id)) {
|
||||||
|
error_setg(errp, "Invalid job ID '%s'", job_id);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block_job_get(job_id)) {
|
||||||
|
error_setg(errp, "Job ID '%s' already in use", job_id);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
blk = blk_new();
|
blk = blk_new();
|
||||||
blk_insert_bs(blk, bs);
|
blk_insert_bs(blk, bs);
|
||||||
|
|
||||||
@@ -126,7 +154,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
|
|||||||
bdrv_op_unblock(bs, BLOCK_OP_TYPE_DATAPLANE, job->blocker);
|
bdrv_op_unblock(bs, BLOCK_OP_TYPE_DATAPLANE, job->blocker);
|
||||||
|
|
||||||
job->driver = driver;
|
job->driver = driver;
|
||||||
job->id = g_strdup(bdrv_get_device_name(bs));
|
job->id = g_strdup(job_id);
|
||||||
job->blk = blk;
|
job->blk = blk;
|
||||||
job->cb = cb;
|
job->cb = cb;
|
||||||
job->opaque = opaque;
|
job->opaque = opaque;
|
||||||
@@ -290,7 +318,8 @@ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
|
|||||||
void block_job_complete(BlockJob *job, Error **errp)
|
void block_job_complete(BlockJob *job, Error **errp)
|
||||||
{
|
{
|
||||||
if (job->pause_count || job->cancelled || !job->driver->complete) {
|
if (job->pause_count || job->cancelled || !job->driver->complete) {
|
||||||
error_setg(errp, QERR_BLOCK_JOB_NOT_READY, job->id);
|
error_setg(errp, "The active block job '%s' cannot be completed",
|
||||||
|
job->id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +375,7 @@ void block_job_resume(BlockJob *job)
|
|||||||
void block_job_enter(BlockJob *job)
|
void block_job_enter(BlockJob *job)
|
||||||
{
|
{
|
||||||
if (job->co && !job->busy) {
|
if (job->co && !job->busy) {
|
||||||
qemu_coroutine_enter(job->co, NULL);
|
qemu_coroutine_enter(job->co);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,6 +553,7 @@ BlockErrorAction block_job_error_action(BlockJob *job, BlockdevOnError on_err,
|
|||||||
|
|
||||||
switch (on_err) {
|
switch (on_err) {
|
||||||
case BLOCKDEV_ON_ERROR_ENOSPC:
|
case BLOCKDEV_ON_ERROR_ENOSPC:
|
||||||
|
case BLOCKDEV_ON_ERROR_AUTO:
|
||||||
action = (error == ENOSPC) ?
|
action = (error == ENOSPC) ?
|
||||||
BLOCK_ERROR_ACTION_STOP : BLOCK_ERROR_ACTION_REPORT;
|
BLOCK_ERROR_ACTION_STOP : BLOCK_ERROR_ACTION_REPORT;
|
||||||
break;
|
break;
|
||||||
|
@@ -162,4 +162,4 @@ struct target_vm86plus_struct {
|
|||||||
|
|
||||||
#define UNAME_MACHINE "i386"
|
#define UNAME_MACHINE "i386"
|
||||||
|
|
||||||
#endif /* TARGET_SYSCALL_H */
|
#endif /* TARGET_SYSCALL_H */
|
||||||
|
@@ -11,4 +11,4 @@ struct target_pt_regs {
|
|||||||
|
|
||||||
#define UNAME_MACHINE "sun4"
|
#define UNAME_MACHINE "sun4"
|
||||||
|
|
||||||
#endif /* TARGET_SYSCALL_H */
|
#endif /* TARGET_SYSCALL_H */
|
||||||
|
@@ -12,4 +12,4 @@ struct target_pt_regs {
|
|||||||
|
|
||||||
#define UNAME_MACHINE "sun4u"
|
#define UNAME_MACHINE "sun4u"
|
||||||
|
|
||||||
#endif /* TARGET_SYSCALL_H */
|
#endif /* TARGET_SYSCALL_H */
|
||||||
|
@@ -118,4 +118,4 @@ struct target_msqid64_ds {
|
|||||||
#define TARGET_ARCH_GET_FS 0x1003
|
#define TARGET_ARCH_GET_FS 0x1003
|
||||||
#define TARGET_ARCH_GET_GS 0x1004
|
#define TARGET_ARCH_GET_GS 0x1004
|
||||||
|
|
||||||
#endif /* TARGET_SYSCALL_H */
|
#endif /* TARGET_SYSCALL_H */
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
* top-level directory.
|
* top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IVSHMEM_CLIENT_H_
|
#ifndef IVSHMEM_CLIENT_H
|
||||||
#define _IVSHMEM_CLIENT_H_
|
#define IVSHMEM_CLIENT_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file provides helper to implement an ivshmem client. It is used
|
* This file provides helper to implement an ivshmem client. It is used
|
||||||
@@ -209,4 +209,4 @@ ivshmem_client_search_peer(IvshmemClient *client, int64_t peer_id);
|
|||||||
*/
|
*/
|
||||||
void ivshmem_client_dump(const IvshmemClient *client);
|
void ivshmem_client_dump(const IvshmemClient *client);
|
||||||
|
|
||||||
#endif /* _IVSHMEM_CLIENT_H_ */
|
#endif /* IVSHMEM_CLIENT_H */
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
* top-level directory.
|
* top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IVSHMEM_SERVER_H_
|
#ifndef IVSHMEM_SERVER_H
|
||||||
#define _IVSHMEM_SERVER_H_
|
#define IVSHMEM_SERVER_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ivshmem server is a daemon that creates a unix socket in listen
|
* The ivshmem server is a daemon that creates a unix socket in listen
|
||||||
@@ -163,4 +163,4 @@ ivshmem_server_search_peer(IvshmemServer *server, int64_t peer_id);
|
|||||||
*/
|
*/
|
||||||
void ivshmem_server_dump(const IvshmemServer *server);
|
void ivshmem_server_dump(const IvshmemServer *server);
|
||||||
|
|
||||||
#endif /* _IVSHMEM_SERVER_H_ */
|
#endif /* IVSHMEM_SERVER_H */
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QCRYPTO_BLOCK_LUKS_H__
|
#ifndef QCRYPTO_BLOCK_LUKS_H
|
||||||
#define QCRYPTO_BLOCK_LUKS_H__
|
#define QCRYPTO_BLOCK_LUKS_H
|
||||||
|
|
||||||
#include "crypto/blockpriv.h"
|
#include "crypto/blockpriv.h"
|
||||||
|
|
||||||
extern const QCryptoBlockDriver qcrypto_block_driver_luks;
|
extern const QCryptoBlockDriver qcrypto_block_driver_luks;
|
||||||
|
|
||||||
#endif /* QCRYPTO_BLOCK_LUKS_H__ */
|
#endif /* QCRYPTO_BLOCK_LUKS_H */
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QCRYPTO_BLOCK_QCOW_H__
|
#ifndef QCRYPTO_BLOCK_QCOW_H
|
||||||
#define QCRYPTO_BLOCK_QCOW_H__
|
#define QCRYPTO_BLOCK_QCOW_H
|
||||||
|
|
||||||
#include "crypto/blockpriv.h"
|
#include "crypto/blockpriv.h"
|
||||||
|
|
||||||
extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
|
extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
|
||||||
|
|
||||||
#endif /* QCRYPTO_BLOCK_QCOW_H__ */
|
#endif /* QCRYPTO_BLOCK_QCOW_H */
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QCRYPTO_BLOCK_PRIV_H__
|
#ifndef QCRYPTO_BLOCKPRIV_H
|
||||||
#define QCRYPTO_BLOCK_PRIV_H__
|
#define QCRYPTO_BLOCKPRIV_H
|
||||||
|
|
||||||
#include "crypto/block.h"
|
#include "crypto/block.h"
|
||||||
|
|
||||||
@@ -89,4 +89,4 @@ int qcrypto_block_encrypt_helper(QCryptoCipher *cipher,
|
|||||||
size_t len,
|
size_t len,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
||||||
#endif /* QCRYPTO_BLOCK_PRIV_H__ */
|
#endif /* QCRYPTO_BLOCKPRIV_H */
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include <gcrypt.h>
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "crypto/hash.h"
|
#include "crypto/hash.h"
|
||||||
#include "gcrypt.h"
|
|
||||||
|
|
||||||
|
|
||||||
static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG__MAX] = {
|
static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG__MAX] = {
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QCRYPTO_IVGEN_PRIV_H__
|
#ifndef QCRYPTO_IVGENPRIV_H
|
||||||
#define QCRYPTO_IVGEN_PRIV_H__
|
#define QCRYPTO_IVGENPRIV_H
|
||||||
|
|
||||||
#include "crypto/ivgen.h"
|
#include "crypto/ivgen.h"
|
||||||
|
|
||||||
@@ -46,4 +46,4 @@ struct QCryptoIVGen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* QCRYPTO_IVGEN_PRIV_H__ */
|
#endif /* QCRYPTO_IVGENPRIV_H */
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include <gcrypt.h>
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "crypto/pbkdf.h"
|
#include "crypto/pbkdf.h"
|
||||||
#include "gcrypt.h"
|
|
||||||
|
|
||||||
bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
||||||
{
|
{
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include <nettle/pbkdf2.h>
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "crypto/pbkdf.h"
|
#include "crypto/pbkdf.h"
|
||||||
#include "nettle/pbkdf2.h"
|
|
||||||
|
|
||||||
|
|
||||||
bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QCRYPTO_TLSCRED_PRIV_H__
|
#ifndef QCRYPTO_TLSCREDSPRIV_H
|
||||||
#define QCRYPTO_TLSCRED_PRIV_H__
|
#define QCRYPTO_TLSCREDSPRIV_H
|
||||||
|
|
||||||
#include "crypto/tlscreds.h"
|
#include "crypto/tlscreds.h"
|
||||||
|
|
||||||
@@ -38,5 +38,4 @@ int qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds *creds,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* QCRYPTO_TLSCRED_PRIV_H__ */
|
#endif /* QCRYPTO_TLSCREDSPRIV_H */
|
||||||
|
|
||||||
|
@@ -92,7 +92,8 @@ Data:
|
|||||||
|
|
||||||
- "type": Job type (json-string; "stream" for image streaming
|
- "type": Job type (json-string; "stream" for image streaming
|
||||||
"commit" for block commit)
|
"commit" for block commit)
|
||||||
- "device": Device name (json-string)
|
- "device": Job identifier. Originally the device name but other
|
||||||
|
values are allowed since QEMU 2.7 (json-string)
|
||||||
- "len": Maximum progress value (json-int)
|
- "len": Maximum progress value (json-int)
|
||||||
- "offset": Current progress value (json-int)
|
- "offset": Current progress value (json-int)
|
||||||
On success this is equal to len.
|
On success this is equal to len.
|
||||||
@@ -116,7 +117,8 @@ Data:
|
|||||||
|
|
||||||
- "type": Job type (json-string; "stream" for image streaming
|
- "type": Job type (json-string; "stream" for image streaming
|
||||||
"commit" for block commit)
|
"commit" for block commit)
|
||||||
- "device": Device name (json-string)
|
- "device": Job identifier. Originally the device name but other
|
||||||
|
values are allowed since QEMU 2.7 (json-string)
|
||||||
- "len": Maximum progress value (json-int)
|
- "len": Maximum progress value (json-int)
|
||||||
- "offset": Current progress value (json-int)
|
- "offset": Current progress value (json-int)
|
||||||
On success this is equal to len.
|
On success this is equal to len.
|
||||||
@@ -143,7 +145,8 @@ Emitted when a block job encounters an error.
|
|||||||
|
|
||||||
Data:
|
Data:
|
||||||
|
|
||||||
- "device": device name (json-string)
|
- "device": Job identifier. Originally the device name but other
|
||||||
|
values are allowed since QEMU 2.7 (json-string)
|
||||||
- "operation": I/O operation (json-string, "read" or "write")
|
- "operation": I/O operation (json-string, "read" or "write")
|
||||||
- "action": action that has been taken, it's one of the following (json-string):
|
- "action": action that has been taken, it's one of the following (json-string):
|
||||||
"ignore": error has been ignored, the job may fail later
|
"ignore": error has been ignored, the job may fail later
|
||||||
@@ -167,7 +170,8 @@ Data:
|
|||||||
|
|
||||||
- "type": Job type (json-string; "stream" for image streaming
|
- "type": Job type (json-string; "stream" for image streaming
|
||||||
"commit" for block commit)
|
"commit" for block commit)
|
||||||
- "device": Device name (json-string)
|
- "device": Job identifier. Originally the device name but other
|
||||||
|
values are allowed since QEMU 2.7 (json-string)
|
||||||
- "len": Maximum progress value (json-int)
|
- "len": Maximum progress value (json-int)
|
||||||
- "offset": Current progress value (json-int)
|
- "offset": Current progress value (json-int)
|
||||||
On success this is equal to len.
|
On success this is equal to len.
|
||||||
|
@@ -40,6 +40,18 @@ numbers must be continuous, i.e. for three devices you must use 0+1+2.
|
|||||||
The 0+1+5 numbering from the "usb-uas" example isn't going to work
|
The 0+1+5 numbering from the "usb-uas" example isn't going to work
|
||||||
with "usb-bot".
|
with "usb-bot".
|
||||||
|
|
||||||
|
Starting with qemu version 2.7 usb-bot and usb-uas devices can be
|
||||||
|
hotplugged. In the hotplug case they are added with "attached =
|
||||||
|
false" so the guest will not see the device until the "attached"
|
||||||
|
property is explicitly set to true. That allows to attach one or more
|
||||||
|
scsi devices before making the device visible to the guest, i.e. the
|
||||||
|
workflow looks like this:
|
||||||
|
|
||||||
|
(1) device-add usb-bot,id=foo
|
||||||
|
(2) device-add scsi-{hd,cd},bus=foo.0,lun=0
|
||||||
|
(2b) optionally add more devices (luns 1 ... 15).
|
||||||
|
(3) scripts/qmp/qom-set foo.attached = true
|
||||||
|
|
||||||
enjoy,
|
enjoy,
|
||||||
Gerd
|
Gerd
|
||||||
|
|
||||||
|
2
exec.c
2
exec.c
@@ -36,7 +36,7 @@
|
|||||||
#include "qemu/config-file.h"
|
#include "qemu/config-file.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if defined(CONFIG_USER_ONLY)
|
||||||
#include <qemu.h>
|
#include "qemu.h"
|
||||||
#else /* !CONFIG_USER_ONLY */
|
#else /* !CONFIG_USER_ONLY */
|
||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
|
@@ -207,31 +207,25 @@ ssize_t v9fs_iov_vmarshal(struct iovec *in_sg, int in_num, size_t offset,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'w': {
|
case 'w': {
|
||||||
uint16_t val;
|
uint16_t val = va_arg(ap, int);
|
||||||
if (bswap) {
|
if (bswap) {
|
||||||
cpu_to_le16w(&val, va_arg(ap, int));
|
val = cpu_to_le16(val);
|
||||||
} else {
|
|
||||||
val = va_arg(ap, int);
|
|
||||||
}
|
}
|
||||||
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'd': {
|
case 'd': {
|
||||||
uint32_t val;
|
uint32_t val = va_arg(ap, uint32_t);
|
||||||
if (bswap) {
|
if (bswap) {
|
||||||
cpu_to_le32w(&val, va_arg(ap, uint32_t));
|
val = cpu_to_le32(val);
|
||||||
} else {
|
|
||||||
val = va_arg(ap, uint32_t);
|
|
||||||
}
|
}
|
||||||
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'q': {
|
case 'q': {
|
||||||
uint64_t val;
|
uint64_t val = va_arg(ap, uint64_t);
|
||||||
if (bswap) {
|
if (bswap) {
|
||||||
cpu_to_le64w(&val, va_arg(ap, uint64_t));
|
val = cpu_to_le64(val);
|
||||||
} else {
|
|
||||||
val = va_arg(ap, uint64_t);
|
|
||||||
}
|
}
|
||||||
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
|
||||||
break;
|
break;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _QEMU_9P_IOV_MARSHAL_H
|
#ifndef QEMU_9P_IOV_MARSHAL_H
|
||||||
#define _QEMU_9P_IOV_MARSHAL_H
|
#define QEMU_9P_IOV_MARSHAL_H
|
||||||
|
|
||||||
#include "9p-marshal.h"
|
#include "9p-marshal.h"
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _QEMU_9P_MARSHAL_H
|
#ifndef QEMU_9P_MARSHAL_H
|
||||||
#define _QEMU_9P_MARSHAL_H
|
#define QEMU_9P_MARSHAL_H
|
||||||
|
|
||||||
typedef struct V9fsString
|
typedef struct V9fsString
|
||||||
{
|
{
|
||||||
|
@@ -10,8 +10,10 @@
|
|||||||
* the COPYING file in the top-level directory.
|
* the COPYING file in the top-level directory.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _FILEOP_H
|
|
||||||
#define _FILEOP_H
|
#ifndef FILE_OP_9P_H
|
||||||
|
#define FILE_OP_9P_H
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <sys/vfs.h>
|
#include <sys/vfs.h>
|
||||||
|
6
hmp.c
6
hmp.c
@@ -1097,7 +1097,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
|
|||||||
mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
|
mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmp_drive_mirror(device, filename, !!format, format,
|
qmp_drive_mirror(false, NULL, device, filename, !!format, format,
|
||||||
false, NULL, false, NULL,
|
false, NULL, false, NULL,
|
||||||
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
|
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
|
||||||
true, mode, false, 0, false, 0, false, 0,
|
true, mode, false, 0, false, 0, false, 0,
|
||||||
@@ -1127,7 +1127,7 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
|
|||||||
mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
|
mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
|
||||||
}
|
}
|
||||||
|
|
||||||
qmp_drive_backup(device, filename, !!format, format,
|
qmp_drive_backup(false, NULL, device, filename, !!format, format,
|
||||||
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
|
full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
|
||||||
true, mode, false, 0, false, NULL,
|
true, mode, false, 0, false, NULL,
|
||||||
false, 0, false, 0, &err);
|
false, 0, false, 0, &err);
|
||||||
@@ -1485,7 +1485,7 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
|
|||||||
const char *base = qdict_get_try_str(qdict, "base");
|
const char *base = qdict_get_try_str(qdict, "base");
|
||||||
int64_t speed = qdict_get_try_int(qdict, "speed", 0);
|
int64_t speed = qdict_get_try_int(qdict, "speed", 0);
|
||||||
|
|
||||||
qmp_block_stream(device, base != NULL, base, false, NULL,
|
qmp_block_stream(false, NULL, device, base != NULL, base, false, NULL,
|
||||||
qdict_haskey(qdict, "speed"), speed,
|
qdict_haskey(qdict, "speed"), speed,
|
||||||
true, BLOCKDEV_ON_ERROR_REPORT, &error);
|
true, BLOCKDEV_ON_ERROR_REPORT, &error);
|
||||||
|
|
||||||
|
@@ -9,8 +9,9 @@
|
|||||||
* This work is licensed under the terms of the GNU GPL, version 2. See
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
||||||
* the COPYING file in the top-level directory.
|
* the COPYING file in the top-level directory.
|
||||||
*/
|
*/
|
||||||
#ifndef _QEMU_9P_PROXY_H
|
|
||||||
#define _QEMU_9P_PROXY_H
|
#ifndef QEMU_9P_PROXY_H
|
||||||
|
#define QEMU_9P_PROXY_H
|
||||||
|
|
||||||
#define PROXY_MAX_IO_SZ (64 * 1024)
|
#define PROXY_MAX_IO_SZ (64 * 1024)
|
||||||
#define V9FS_FD_VALID INT_MAX
|
#define V9FS_FD_VALID INT_MAX
|
||||||
|
@@ -10,9 +10,9 @@
|
|||||||
* the COPYING file in the top-level directory.
|
* the COPYING file in the top-level directory.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef HW_9PFS_SYNTH_H
|
|
||||||
#define HW_9PFS_SYNTH_H 1
|
|
||||||
|
|
||||||
|
#ifndef QEMU_9P_SYNTH_H
|
||||||
|
#define QEMU_9P_SYNTH_H
|
||||||
|
|
||||||
typedef struct V9fsSynthNode V9fsSynthNode;
|
typedef struct V9fsSynthNode V9fsSynthNode;
|
||||||
typedef ssize_t (*v9fs_synth_read)(void *buf, int len, off_t offset,
|
typedef ssize_t (*v9fs_synth_read)(void *buf, int len, off_t offset,
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
* the COPYING file in the top-level directory.
|
* the COPYING file in the top-level directory.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _QEMU_9P_XATTR_H
|
|
||||||
#define _QEMU_9P_XATTR_H
|
#ifndef QEMU_9P_XATTR_H
|
||||||
|
#define QEMU_9P_XATTR_H
|
||||||
|
|
||||||
#include "qemu/xattr.h"
|
#include "qemu/xattr.h"
|
||||||
|
|
||||||
|
@@ -3278,8 +3278,8 @@ void pdu_submit(V9fsPDU *pdu)
|
|||||||
if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) {
|
if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) {
|
||||||
handler = v9fs_fs_ro;
|
handler = v9fs_fs_ro;
|
||||||
}
|
}
|
||||||
co = qemu_coroutine_create(handler);
|
co = qemu_coroutine_create(handler, pdu);
|
||||||
qemu_coroutine_enter(co, pdu);
|
qemu_coroutine_enter(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 0 on success, 1 on failure. */
|
/* Returns 0 on success, 1 on failure. */
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _QEMU_9P_H
|
#ifndef QEMU_9P_H
|
||||||
#define _QEMU_9P_H
|
#define QEMU_9P_H
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
|
@@ -22,14 +22,14 @@
|
|||||||
static void coroutine_enter_cb(void *opaque, int ret)
|
static void coroutine_enter_cb(void *opaque, int ret)
|
||||||
{
|
{
|
||||||
Coroutine *co = opaque;
|
Coroutine *co = opaque;
|
||||||
qemu_coroutine_enter(co, NULL);
|
qemu_coroutine_enter(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called from worker thread. */
|
/* Called from worker thread. */
|
||||||
static int coroutine_enter_func(void *arg)
|
static int coroutine_enter_func(void *arg)
|
||||||
{
|
{
|
||||||
Coroutine *co = arg;
|
Coroutine *co = arg;
|
||||||
qemu_coroutine_enter(co, NULL);
|
qemu_coroutine_enter(co);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _QEMU_9P_COTH_H
|
#ifndef QEMU_9P_COTH_H
|
||||||
#define _QEMU_9P_COTH_H
|
#define QEMU_9P_COTH_H
|
||||||
|
|
||||||
#include "qemu/thread.h"
|
#include "qemu/thread.h"
|
||||||
#include "qemu/coroutine.h"
|
#include "qemu/coroutine.h"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _QEMU_VIRTIO_9P_H
|
#ifndef QEMU_VIRTIO_9P_H
|
||||||
#define _QEMU_VIRTIO_9P_H
|
#define QEMU_VIRTIO_9P_H
|
||||||
|
|
||||||
#include "standard-headers/linux/virtio_9p.h"
|
#include "standard-headers/linux/virtio_9p.h"
|
||||||
#include "hw/virtio/virtio.h"
|
#include "hw/virtio/virtio.h"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/* Alpha cores and system support chips. */
|
/* Alpha cores and system support chips. */
|
||||||
|
|
||||||
#ifndef HW_ALPHA_H
|
#ifndef HW_ALPHA_SYS_H
|
||||||
#define HW_ALPHA_H 1
|
#define HW_ALPHA_SYS_H
|
||||||
|
|
||||||
#include "target-alpha/cpu-qom.h"
|
#include "target-alpha/cpu-qom.h"
|
||||||
#include "hw/pci/pci.h"
|
#include "hw/pci/pci.h"
|
||||||
|
@@ -34,8 +34,6 @@
|
|||||||
#define AST2400_FMC_FLASH_BASE 0x20000000
|
#define AST2400_FMC_FLASH_BASE 0x20000000
|
||||||
#define AST2400_SPI_FLASH_BASE 0x30000000
|
#define AST2400_SPI_FLASH_BASE 0x30000000
|
||||||
|
|
||||||
#define AST2400_A0_SILICON_REV 0x02000303
|
|
||||||
|
|
||||||
static const int uart_irqs[] = { 9, 32, 33, 34, 10 };
|
static const int uart_irqs[] = { 9, 32, 33, 34, 10 };
|
||||||
static const int timer_irqs[] = { 16, 17, 18, 35, 36, 37, 38, 39, };
|
static const int timer_irqs[] = { 16, 17, 18, 35, 36, 37, 38, 39, };
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _STRONGARM_H
|
#ifndef STRONGARM_H
|
||||||
#define _STRONGARM_H
|
#define STRONGARM_H
|
||||||
|
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
#include "target-arm/cpu-qom.h"
|
#include "target-arm/cpu-qom.h"
|
||||||
|
@@ -52,7 +52,8 @@
|
|||||||
#include "hw/arm/sysbus-fdt.h"
|
#include "hw/arm/sysbus-fdt.h"
|
||||||
#include "hw/platform-bus.h"
|
#include "hw/platform-bus.h"
|
||||||
#include "hw/arm/fdt.h"
|
#include "hw/arm/fdt.h"
|
||||||
#include "hw/intc/arm_gic_common.h"
|
#include "hw/intc/arm_gic.h"
|
||||||
|
#include "hw/intc/arm_gicv3_common.h"
|
||||||
#include "kvm_arm.h"
|
#include "kvm_arm.h"
|
||||||
#include "hw/smbios/smbios.h"
|
#include "hw/smbios/smbios.h"
|
||||||
#include "qapi/visitor.h"
|
#include "qapi/visitor.h"
|
||||||
@@ -82,6 +83,7 @@ typedef struct VirtBoardInfo {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
MachineClass parent;
|
MachineClass parent;
|
||||||
VirtBoardInfo *daughterboard;
|
VirtBoardInfo *daughterboard;
|
||||||
|
bool disallow_affinity_adjustment;
|
||||||
} VirtMachineClass;
|
} VirtMachineClass;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -1165,6 +1167,7 @@ void virt_guest_info_machine_done(Notifier *notifier, void *data)
|
|||||||
static void machvirt_init(MachineState *machine)
|
static void machvirt_init(MachineState *machine)
|
||||||
{
|
{
|
||||||
VirtMachineState *vms = VIRT_MACHINE(machine);
|
VirtMachineState *vms = VIRT_MACHINE(machine);
|
||||||
|
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(machine);
|
||||||
qemu_irq pic[NUM_IRQS];
|
qemu_irq pic[NUM_IRQS];
|
||||||
MemoryRegion *sysmem = get_system_memory();
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
MemoryRegion *secure_sysmem = NULL;
|
MemoryRegion *secure_sysmem = NULL;
|
||||||
@@ -1181,6 +1184,7 @@ static void machvirt_init(MachineState *machine)
|
|||||||
CPUClass *cc;
|
CPUClass *cc;
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0);
|
bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0);
|
||||||
|
uint8_t clustersz;
|
||||||
|
|
||||||
if (!cpu_model) {
|
if (!cpu_model) {
|
||||||
cpu_model = "cortex-a15";
|
cpu_model = "cortex-a15";
|
||||||
@@ -1226,8 +1230,10 @@ static void machvirt_init(MachineState *machine)
|
|||||||
*/
|
*/
|
||||||
if (gic_version == 3) {
|
if (gic_version == 3) {
|
||||||
virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
|
virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
|
||||||
|
clustersz = GICV3_TARGETLIST_BITS;
|
||||||
} else {
|
} else {
|
||||||
virt_max_cpus = GIC_NCPU;
|
virt_max_cpus = GIC_NCPU;
|
||||||
|
clustersz = GIC_TARGETLIST_BITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_cpus > virt_max_cpus) {
|
if (max_cpus > virt_max_cpus) {
|
||||||
@@ -1281,6 +1287,20 @@ static void machvirt_init(MachineState *machine)
|
|||||||
|
|
||||||
for (n = 0; n < smp_cpus; n++) {
|
for (n = 0; n < smp_cpus; n++) {
|
||||||
Object *cpuobj = object_new(typename);
|
Object *cpuobj = object_new(typename);
|
||||||
|
if (!vmc->disallow_affinity_adjustment) {
|
||||||
|
/* Adjust MPIDR like 64-bit KVM hosts, which incorporate the
|
||||||
|
* GIC's target-list limitations. 32-bit KVM hosts currently
|
||||||
|
* always create clusters of 4 CPUs, but that is expected to
|
||||||
|
* change when they gain support for gicv3. When KVM is enabled
|
||||||
|
* it will override the changes we make here, therefore our
|
||||||
|
* purposes are to make TCG consistent (with 64-bit KVM hosts)
|
||||||
|
* and to improve SGI efficiency.
|
||||||
|
*/
|
||||||
|
uint8_t aff1 = n / clustersz;
|
||||||
|
uint8_t aff0 = n % clustersz;
|
||||||
|
object_property_set_int(cpuobj, (aff1 << ARM_AFF1_SHIFT) | aff0,
|
||||||
|
"mp-affinity", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (!vms->secure) {
|
if (!vms->secure) {
|
||||||
object_property_set_bool(cpuobj, false, "has_el3", NULL);
|
object_property_set_bool(cpuobj, false, "has_el3", NULL);
|
||||||
@@ -1507,7 +1527,10 @@ static void virt_2_6_instance_init(Object *obj)
|
|||||||
|
|
||||||
static void virt_machine_2_6_options(MachineClass *mc)
|
static void virt_machine_2_6_options(MachineClass *mc)
|
||||||
{
|
{
|
||||||
|
VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
|
||||||
|
|
||||||
virt_machine_2_7_options(mc);
|
virt_machine_2_7_options(mc);
|
||||||
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6);
|
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6);
|
||||||
|
vmc->disallow_affinity_adjustment = true;
|
||||||
}
|
}
|
||||||
DEFINE_VIRT_MACHINE(2, 6)
|
DEFINE_VIRT_MACHINE(2, 6)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef __FMOPL_H_
|
#ifndef FMOPL_H
|
||||||
#define __FMOPL_H_
|
#define FMOPL_H
|
||||||
|
|
||||||
/* --- select emulation chips --- */
|
/* --- select emulation chips --- */
|
||||||
#define BUILD_YM3812 (HAS_YM3812)
|
#define BUILD_YM3812 (HAS_YM3812)
|
||||||
|
@@ -101,4 +101,4 @@ void gus_irqgen(GUSEmuState *state, unsigned int elapsed_time);
|
|||||||
/* lower values won´t provide any benefit at all, higher values can cause audible timing delays */
|
/* lower values won´t provide any benefit at all, higher values can cause audible timing delays */
|
||||||
/* note: masked timers are also calculated by this function, thus it might be needed even without any IRQs in use! */
|
/* note: masked timers are also calculated by this function, thus it might be needed even without any IRQs in use! */
|
||||||
|
|
||||||
#endif /* gusemu.h */
|
#endif /* GUSEMU_H */
|
||||||
|
@@ -129,4 +129,4 @@
|
|||||||
|
|
||||||
#define gusdataend (VSRegsEnd+4)
|
#define gusdataend (VSRegsEnd+4)
|
||||||
|
|
||||||
#endif /* gustate.h */
|
#endif /* GUSTATE_H */
|
||||||
|
@@ -40,4 +40,4 @@ uint32_t lm4549_read(lm4549_state *s, hwaddr offset);
|
|||||||
void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value);
|
void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value);
|
||||||
uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right);
|
uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right);
|
||||||
|
|
||||||
#endif /* #ifndef HW_LM4549_H */
|
#endif /* HW_LM4549_H */
|
||||||
|
@@ -132,4 +132,4 @@ enum {
|
|||||||
#define RXTOFEC3 (1 << 11)
|
#define RXTOFEC3 (1 << 11)
|
||||||
#define RXTOFEC4 (1 << 12)
|
#define RXTOFEC4 (1 << 12)
|
||||||
|
|
||||||
#endif /* #ifndef HW_PL041_H */
|
#endif /* HW_PL041_H */
|
||||||
|
@@ -51,6 +51,34 @@ void blkconf_blocksizes(BlockConf *conf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void blkconf_apply_backend_options(BlockConf *conf)
|
||||||
|
{
|
||||||
|
BlockBackend *blk = conf->blk;
|
||||||
|
BlockdevOnError rerror, werror;
|
||||||
|
bool wce;
|
||||||
|
|
||||||
|
switch (conf->wce) {
|
||||||
|
case ON_OFF_AUTO_ON: wce = true; break;
|
||||||
|
case ON_OFF_AUTO_OFF: wce = false; break;
|
||||||
|
case ON_OFF_AUTO_AUTO: wce = blk_enable_write_cache(blk); break;
|
||||||
|
default:
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
rerror = conf->rerror;
|
||||||
|
if (rerror == BLOCKDEV_ON_ERROR_AUTO) {
|
||||||
|
rerror = blk_get_on_error(blk, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
werror = conf->werror;
|
||||||
|
if (werror == BLOCKDEV_ON_ERROR_AUTO) {
|
||||||
|
werror = blk_get_on_error(blk, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
blk_set_enable_write_cache(blk, wce);
|
||||||
|
blk_set_on_error(blk, rerror, werror);
|
||||||
|
}
|
||||||
|
|
||||||
void blkconf_geometry(BlockConf *conf, int *ptrans,
|
void blkconf_geometry(BlockConf *conf, int *ptrans,
|
||||||
unsigned cyls_max, unsigned heads_max, unsigned secs_max,
|
unsigned cyls_max, unsigned heads_max, unsigned secs_max,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
|
@@ -149,6 +149,7 @@ typedef struct FlashPartInfo {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define SPANSION_CONTINUOUS_READ_MODE_CMD_LEN 1
|
#define SPANSION_CONTINUOUS_READ_MODE_CMD_LEN 1
|
||||||
|
#define WINBOND_CONTINUOUS_READ_MODE_CMD_LEN 1
|
||||||
|
|
||||||
static const FlashPartInfo known_devices[] = {
|
static const FlashPartInfo known_devices[] = {
|
||||||
/* Atmel -- some are (confusingly) marketed as "DataFlash" */
|
/* Atmel -- some are (confusingly) marketed as "DataFlash" */
|
||||||
@@ -777,7 +778,7 @@ static void decode_dio_read_cmd(Flash *s)
|
|||||||
/* Dummy cycles modeled with bytes writes instead of bits */
|
/* Dummy cycles modeled with bytes writes instead of bits */
|
||||||
switch (get_man(s)) {
|
switch (get_man(s)) {
|
||||||
case MAN_WINBOND:
|
case MAN_WINBOND:
|
||||||
s->needed_bytes += 8;
|
s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN;
|
||||||
break;
|
break;
|
||||||
case MAN_SPANSION:
|
case MAN_SPANSION:
|
||||||
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
|
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
|
||||||
@@ -816,7 +817,8 @@ static void decode_qio_read_cmd(Flash *s)
|
|||||||
/* Dummy cycles modeled with bytes writes instead of bits */
|
/* Dummy cycles modeled with bytes writes instead of bits */
|
||||||
switch (get_man(s)) {
|
switch (get_man(s)) {
|
||||||
case MAN_WINBOND:
|
case MAN_WINBOND:
|
||||||
s->needed_bytes += 8;
|
s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN;
|
||||||
|
s->needed_bytes += 4;
|
||||||
break;
|
break;
|
||||||
case MAN_SPANSION:
|
case MAN_SPANSION:
|
||||||
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
|
s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;
|
||||||
|
@@ -21,10 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/block/block.h>
|
#include "hw/block/block.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/pci/msix.h>
|
#include "hw/pci/msix.h"
|
||||||
#include <hw/pci/pci.h>
|
#include "hw/pci/pci.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qapi/visitor.h"
|
#include "qapi/visitor.h"
|
||||||
@@ -803,6 +803,7 @@ static int nvme_init(PCIDevice *pci_dev)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
blkconf_blocksizes(&n->conf);
|
blkconf_blocksizes(&n->conf);
|
||||||
|
blkconf_apply_backend_options(&n->conf);
|
||||||
|
|
||||||
pci_conf = pci_dev->config;
|
pci_conf = pci_dev->config;
|
||||||
pci_conf[PCI_INTERRUPT_PIN] = 1;
|
pci_conf[PCI_INTERRUPT_PIN] = 1;
|
||||||
|
@@ -897,6 +897,7 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
blkconf_serial(&conf->conf, &conf->serial);
|
blkconf_serial(&conf->conf, &conf->serial);
|
||||||
|
blkconf_apply_backend_options(&conf->conf);
|
||||||
s->original_wce = blk_enable_write_cache(conf->conf.blk);
|
s->original_wce = blk_enable_write_cache(conf->conf.blk);
|
||||||
blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, &err);
|
blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -959,6 +960,7 @@ static void virtio_blk_instance_init(Object *obj)
|
|||||||
|
|
||||||
static Property virtio_blk_properties[] = {
|
static Property virtio_blk_properties[] = {
|
||||||
DEFINE_BLOCK_PROPERTIES(VirtIOBlock, conf.conf),
|
DEFINE_BLOCK_PROPERTIES(VirtIOBlock, conf.conf),
|
||||||
|
DEFINE_BLOCK_ERROR_PROPERTIES(VirtIOBlock, conf.conf),
|
||||||
DEFINE_BLOCK_CHS_PROPERTIES(VirtIOBlock, conf.conf),
|
DEFINE_BLOCK_CHS_PROPERTIES(VirtIOBlock, conf.conf),
|
||||||
DEFINE_PROP_STRING("serial", VirtIOBlock, conf.serial),
|
DEFINE_PROP_STRING("serial", VirtIOBlock, conf.serial),
|
||||||
DEFINE_PROP_BIT("config-wce", VirtIOBlock, conf.config_wce, 0, true),
|
DEFINE_PROP_BIT("config-wce", VirtIOBlock, conf.config_wce, 0, true),
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef __XEN_BLKIF_H__
|
#ifndef XEN_BLKIF_H
|
||||||
#define __XEN_BLKIF_H__
|
#define XEN_BLKIF_H
|
||||||
|
|
||||||
#include <xen/io/ring.h>
|
#include <xen/io/ring.h>
|
||||||
#include <xen/io/blkif.h>
|
#include <xen/io/blkif.h>
|
||||||
@@ -143,4 +143,4 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __XEN_BLKIF_H__ */
|
#endif /* XEN_BLKIF_H */
|
||||||
|
10
hw/bt/hci.c
10
hw/bt/hci.c
@@ -426,11 +426,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat
|
|||||||
* be continuously allocated. We do it though, to preserve similar
|
* be continuously allocated. We do it though, to preserve similar
|
||||||
* behaviour between hosts. Some things, like the BD_ADDR cannot be
|
* behaviour between hosts. Some things, like the BD_ADDR cannot be
|
||||||
* preserved though (for example if a real hci is used). */
|
* preserved though (for example if a real hci is used). */
|
||||||
#ifdef HOST_WORDS_BIGENDIAN
|
#define HNDL(raw) cpu_to_le16(raw)
|
||||||
# define HNDL(raw) bswap16(raw)
|
|
||||||
#else
|
|
||||||
# define HNDL(raw) (raw)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const uint8_t bt_event_reserved_mask[8] = {
|
static const uint8_t bt_event_reserved_mask[8] = {
|
||||||
0xff, 0x9f, 0xfb, 0xff, 0x07, 0x18, 0x00, 0x00,
|
0xff, 0x9f, 0xfb, 0xff, 0x07, 0x18, 0x00, 0x00,
|
||||||
@@ -1504,8 +1500,8 @@ static void bt_submit_hci(struct HCIInfo *info,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#define PARAM(cmd, param) (((cmd##_cp *) data)->param)
|
#define PARAM(cmd, param) (((cmd##_cp *) data)->param)
|
||||||
#define PARAM16(cmd, param) le16_to_cpup(&PARAM(cmd, param))
|
#define PARAM16(cmd, param) lduw_le_p(&PARAM(cmd, param))
|
||||||
#define PARAMHANDLE(cmd) HNDL(PARAM(cmd, handle))
|
#define PARAMHANDLE(cmd) PARAM16(cmd, handle)
|
||||||
#define LENGTH_CHECK(cmd) if (length < sizeof(cmd##_cp)) goto short_hci
|
#define LENGTH_CHECK(cmd) if (length < sizeof(cmd##_cp)) goto short_hci
|
||||||
/* Note: the supported commands bitmask in bt_hci_read_local_commands_rp
|
/* Note: the supported commands bitmask in bt_hci_read_local_commands_rp
|
||||||
* needs to be updated every time a command is implemented here! */
|
* needs to be updated every time a command is implemented here! */
|
||||||
|
@@ -526,9 +526,9 @@ static int l2cap_channel_config(struct l2cap_instance_s *l2cap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MTU */
|
/* MTU */
|
||||||
val = le16_to_cpup((void *) opt->val);
|
val = lduw_le_p(opt->val);
|
||||||
if (val < ch->min_mtu) {
|
if (val < ch->min_mtu) {
|
||||||
cpu_to_le16w((void *) opt->val, ch->min_mtu);
|
stw_le_p(opt->val, ch->min_mtu);
|
||||||
result = L2CAP_CONF_UNACCEPT;
|
result = L2CAP_CONF_UNACCEPT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -543,7 +543,7 @@ static int l2cap_channel_config(struct l2cap_instance_s *l2cap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Flush Timeout */
|
/* Flush Timeout */
|
||||||
val = le16_to_cpup((void *) opt->val);
|
val = lduw_le_p(opt->val);
|
||||||
if (val < 0x0001) {
|
if (val < 0x0001) {
|
||||||
opt->val[0] = 0xff;
|
opt->val[0] = 0xff;
|
||||||
opt->val[1] = 0xff;
|
opt->val[1] = 0xff;
|
||||||
@@ -987,7 +987,7 @@ static void l2cap_bframe_in(struct l2cap_chan_s *ch, uint16_t cid,
|
|||||||
static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
|
static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
|
||||||
const l2cap_hdr *hdr, int len)
|
const l2cap_hdr *hdr, int len)
|
||||||
{
|
{
|
||||||
uint16_t fcs = le16_to_cpup((void *) (hdr->data + len - 2));
|
uint16_t fcs = lduw_le_p(hdr->data + len - 2);
|
||||||
|
|
||||||
if (len < 4)
|
if (len < 4)
|
||||||
goto len_error;
|
goto len_error;
|
||||||
@@ -1002,7 +1002,7 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
|
|||||||
/* TODO: Signal an error? */
|
/* TODO: Signal an error? */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
l2cap_sframe_in(ch, le16_to_cpup((void *) hdr->data));
|
l2cap_sframe_in(ch, lduw_le_p(hdr->data));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1022,7 +1022,7 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
|
|||||||
if (len - 6 > ch->mps)
|
if (len - 6 > ch->mps)
|
||||||
goto len_error;
|
goto len_error;
|
||||||
|
|
||||||
ch->len_total = le16_to_cpup((void *) (hdr->data + 2));
|
ch->len_total = lduw_le_p(hdr->data + 2);
|
||||||
if (len >= 6 + ch->len_total)
|
if (len >= 6 + ch->len_total)
|
||||||
goto seg_error;
|
goto seg_error;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/qdev.h>
|
#include "hw/qdev.h"
|
||||||
#include "qemu/thread.h"
|
#include "qemu/thread.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ uint64_t ptimer_get_count(ptimer_state *s)
|
|||||||
bool oneshot = (s->enabled == 2);
|
bool oneshot = (s->enabled == 2);
|
||||||
|
|
||||||
/* Figure out the current counter value. */
|
/* Figure out the current counter value. */
|
||||||
if (s->period == 0 || (expired && (oneshot || use_icount))) {
|
if (expired) {
|
||||||
/* Prevent timer underflowing if it should already have
|
/* Prevent timer underflowing if it should already have
|
||||||
triggered. */
|
triggered. */
|
||||||
counter = 0;
|
counter = 0;
|
||||||
@@ -120,7 +120,7 @@ uint64_t ptimer_get_count(ptimer_state *s)
|
|||||||
backwards.
|
backwards.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rem = expired ? now - next : next - now;
|
rem = next - now;
|
||||||
div = period;
|
div = period;
|
||||||
|
|
||||||
clz1 = clz64(rem);
|
clz1 = clz64(rem);
|
||||||
@@ -140,11 +140,6 @@ uint64_t ptimer_get_count(ptimer_state *s)
|
|||||||
div += 1;
|
div += 1;
|
||||||
}
|
}
|
||||||
counter = rem / div;
|
counter = rem / div;
|
||||||
|
|
||||||
if (expired && counter != 0) {
|
|
||||||
/* Wrap around periodic counter. */
|
|
||||||
counter = s->limit - (counter - 1) % s->limit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
counter = s->delta;
|
counter = s->delta;
|
||||||
|
@@ -72,12 +72,21 @@ static void parse_drive(DeviceState *dev, const char *str, void **ptr,
|
|||||||
const char *propname, Error **errp)
|
const char *propname, Error **errp)
|
||||||
{
|
{
|
||||||
BlockBackend *blk;
|
BlockBackend *blk;
|
||||||
|
bool blk_created = false;
|
||||||
|
|
||||||
blk = blk_by_name(str);
|
blk = blk_by_name(str);
|
||||||
|
if (!blk) {
|
||||||
|
BlockDriverState *bs = bdrv_lookup_bs(NULL, str, NULL);
|
||||||
|
if (bs) {
|
||||||
|
blk = blk_new();
|
||||||
|
blk_insert_bs(blk, bs);
|
||||||
|
blk_created = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!blk) {
|
if (!blk) {
|
||||||
error_setg(errp, "Property '%s.%s' can't find value '%s'",
|
error_setg(errp, "Property '%s.%s' can't find value '%s'",
|
||||||
object_get_typename(OBJECT(dev)), propname, str);
|
object_get_typename(OBJECT(dev)), propname, str);
|
||||||
return;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (blk_attach_dev(blk, dev) < 0) {
|
if (blk_attach_dev(blk, dev) < 0) {
|
||||||
DriveInfo *dinfo = blk_legacy_dinfo(blk);
|
DriveInfo *dinfo = blk_legacy_dinfo(blk);
|
||||||
@@ -91,9 +100,16 @@ static void parse_drive(DeviceState *dev, const char *str, void **ptr,
|
|||||||
error_setg(errp, "Drive '%s' is already in use by another device",
|
error_setg(errp, "Drive '%s' is already in use by another device",
|
||||||
str);
|
str);
|
||||||
}
|
}
|
||||||
return;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ptr = blk;
|
*ptr = blk;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
if (blk_created) {
|
||||||
|
/* If we need to keep a reference, blk_attach_dev() took it */
|
||||||
|
blk_unref(blk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void release_drive(Object *obj, const char *name, void *opaque)
|
static void release_drive(Object *obj, const char *name, void *opaque)
|
||||||
@@ -103,8 +119,8 @@ static void release_drive(Object *obj, const char *name, void *opaque)
|
|||||||
BlockBackend **ptr = qdev_get_prop_ptr(dev, prop);
|
BlockBackend **ptr = qdev_get_prop_ptr(dev, prop);
|
||||||
|
|
||||||
if (*ptr) {
|
if (*ptr) {
|
||||||
blk_detach_dev(*ptr, dev);
|
|
||||||
blockdev_auto_del(*ptr);
|
blockdev_auto_del(*ptr);
|
||||||
|
blk_detach_dev(*ptr, dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +143,7 @@ static void set_drive(Object *obj, Visitor *v, const char *name, void *opaque,
|
|||||||
|
|
||||||
PropertyInfo qdev_prop_drive = {
|
PropertyInfo qdev_prop_drive = {
|
||||||
.name = "str",
|
.name = "str",
|
||||||
.description = "ID of a drive to use as a backend",
|
.description = "Node name or ID of a block device to use as a backend",
|
||||||
.get = get_drive,
|
.get = get_drive,
|
||||||
.set = set_drive,
|
.set = set_drive,
|
||||||
.release = release_drive,
|
.release = release_drive,
|
||||||
@@ -362,8 +378,19 @@ PropertyInfo qdev_prop_vlan = {
|
|||||||
void qdev_prop_set_drive(DeviceState *dev, const char *name,
|
void qdev_prop_set_drive(DeviceState *dev, const char *name,
|
||||||
BlockBackend *value, Error **errp)
|
BlockBackend *value, Error **errp)
|
||||||
{
|
{
|
||||||
object_property_set_str(OBJECT(dev), value ? blk_name(value) : "",
|
const char *ref = "";
|
||||||
name, errp);
|
|
||||||
|
if (value) {
|
||||||
|
ref = blk_name(value);
|
||||||
|
if (!*ref) {
|
||||||
|
BlockDriverState *bs = blk_bs(value);
|
||||||
|
if (bs) {
|
||||||
|
ref = bdrv_get_node_name(bs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object_property_set_str(OBJECT(dev), ref, name, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qdev_prop_set_chr(DeviceState *dev, const char *name,
|
void qdev_prop_set_chr(DeviceState *dev, const char *name,
|
||||||
|
@@ -539,6 +539,19 @@ PropertyInfo qdev_prop_losttickpolicy = {
|
|||||||
.set = set_enum,
|
.set = set_enum,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* --- Block device error handling policy --- */
|
||||||
|
|
||||||
|
QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) != sizeof(int));
|
||||||
|
|
||||||
|
PropertyInfo qdev_prop_blockdev_on_error = {
|
||||||
|
.name = "BlockdevOnError",
|
||||||
|
.description = "Error handling policy, "
|
||||||
|
"report/ignore/enospc/stop/auto",
|
||||||
|
.enum_table = BlockdevOnError_lookup,
|
||||||
|
.get = get_enum,
|
||||||
|
.set = set_enum,
|
||||||
|
};
|
||||||
|
|
||||||
/* --- BIOS CHS translation */
|
/* --- BIOS CHS translation */
|
||||||
|
|
||||||
QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int));
|
QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int));
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
********************************************************************
|
********************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __UBOOT_IMAGE_H__
|
#ifndef UBOOT_IMAGE_H
|
||||||
#define __UBOOT_IMAGE_H__
|
#define UBOOT_IMAGE_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Operating System Codes
|
* Operating System Codes
|
||||||
@@ -155,4 +155,4 @@ typedef struct uboot_image_header {
|
|||||||
} uboot_image_header_t;
|
} uboot_image_header_t;
|
||||||
|
|
||||||
|
|
||||||
#endif /* __IMAGE_H__ */
|
#endif /* UBOOT_IMAGE_H */
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _CRIS_BOOT_H
|
#ifndef HW_CRIS_BOOT_H
|
||||||
#define HW_CRIS_BOOT_H 1
|
#define HW_CRIS_BOOT_H
|
||||||
|
|
||||||
struct cris_load_info
|
struct cris_load_info
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef HW_QXL_H
|
#ifndef HW_QXL_H
|
||||||
#define HW_QXL_H 1
|
#define HW_QXL_H
|
||||||
|
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
|
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __linux_video_vga_h__
|
#ifndef LINUX_VIDEO_VGA_H
|
||||||
#define __linux_video_vga_h__
|
#define LINUX_VIDEO_VGA_H
|
||||||
|
|
||||||
/* Some of the code below is taken from SVGAlib. The original,
|
/* Some of the code below is taken from SVGAlib. The original,
|
||||||
unmodified copyright notice for that code is below. */
|
unmodified copyright notice for that code is below. */
|
||||||
@@ -156,4 +156,4 @@
|
|||||||
/* VGA graphics controller bit masks */
|
/* VGA graphics controller bit masks */
|
||||||
#define VGA_GR06_GRAPHICS_MODE 0x01
|
#define VGA_GR06_GRAPHICS_MODE 0x01
|
||||||
|
|
||||||
#endif /* __linux_video_vga_h__ */
|
#endif /* LINUX_VIDEO_VGA_H */
|
||||||
|
@@ -21,10 +21,11 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#ifndef HW_VGA_INT_H
|
|
||||||
#define HW_VGA_INT_H 1
|
|
||||||
|
|
||||||
#include <hw/hw.h>
|
#ifndef HW_VGA_INT_H
|
||||||
|
#define HW_VGA_INT_H
|
||||||
|
|
||||||
|
#include "hw/hw.h"
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
|
|
||||||
#define ST01_V_RETRACE 0x08
|
#define ST01_V_RETRACE 0x08
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_VIRGL
|
#ifdef CONFIG_VIRGL
|
||||||
|
|
||||||
#include "virglrenderer.h"
|
#include <virglrenderer.h>
|
||||||
|
|
||||||
static struct virgl_renderer_callbacks virtio_gpu_3d_cbs;
|
static struct virgl_renderer_callbacks virtio_gpu_3d_cbs;
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ static struct virtio_gpu_simple_resource*
|
|||||||
virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);
|
virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);
|
||||||
|
|
||||||
#ifdef CONFIG_VIRGL
|
#ifdef CONFIG_VIRGL
|
||||||
#include "virglrenderer.h"
|
#include <virglrenderer.h>
|
||||||
#define VIRGL(_g, _virgl, _simple, ...) \
|
#define VIRGL(_g, _virgl, _simple, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (_g->use_virgl_renderer) { \
|
if (_g->use_virgl_renderer) { \
|
||||||
|
@@ -22,14 +22,15 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include <linux/kvm.h>
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
#include "hw/timer/i8254_internal.h"
|
#include "hw/timer/i8254_internal.h"
|
||||||
#include "sysemu/kvm.h"
|
#include "sysemu/kvm.h"
|
||||||
#include "linux/kvm.h"
|
|
||||||
|
|
||||||
#define KVM_PIT_REINJECT_BIT 0
|
#define KVM_PIT_REINJECT_BIT 0
|
||||||
|
|
||||||
|
@@ -20,7 +20,9 @@
|
|||||||
* Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com)
|
* Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com)
|
||||||
* Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com)
|
* Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include <linux/kvm.h>
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "hw/i386/pc.h"
|
#include "hw/i386/pc.h"
|
||||||
@@ -32,7 +34,6 @@
|
|||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "hw/pci/pci.h"
|
#include "hw/pci/pci.h"
|
||||||
#include "hw/pci/msi.h"
|
#include "hw/pci/msi.h"
|
||||||
#include "linux/kvm.h"
|
|
||||||
#include "kvm_i386.h"
|
#include "kvm_i386.h"
|
||||||
#include "hw/pci/pci-assign.h"
|
#include "hw/pci/pci-assign.h"
|
||||||
|
|
||||||
|
10
hw/i386/pc.c
10
hw/i386/pc.c
@@ -998,8 +998,13 @@ static void load_linux(PCMachineState *pcms,
|
|||||||
fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_SIZE, setup_size);
|
fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_SIZE, setup_size);
|
||||||
fw_cfg_add_bytes(fw_cfg, FW_CFG_SETUP_DATA, setup, setup_size);
|
fw_cfg_add_bytes(fw_cfg, FW_CFG_SETUP_DATA, setup, setup_size);
|
||||||
|
|
||||||
option_rom[nb_option_roms].name = "linuxboot.bin";
|
if (fw_cfg_dma_enabled(fw_cfg)) {
|
||||||
option_rom[nb_option_roms].bootindex = 0;
|
option_rom[nb_option_roms].name = "linuxboot_dma.bin";
|
||||||
|
option_rom[nb_option_roms].bootindex = 0;
|
||||||
|
} else {
|
||||||
|
option_rom[nb_option_roms].name = "linuxboot.bin";
|
||||||
|
option_rom[nb_option_roms].bootindex = 0;
|
||||||
|
}
|
||||||
nb_option_roms++;
|
nb_option_roms++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1291,6 +1296,7 @@ void xen_load_linux(PCMachineState *pcms)
|
|||||||
load_linux(pcms, fw_cfg);
|
load_linux(pcms, fw_cfg);
|
||||||
for (i = 0; i < nb_option_roms; i++) {
|
for (i = 0; i < nb_option_roms; i++) {
|
||||||
assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
|
assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
|
||||||
|
!strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
|
||||||
!strcmp(option_rom[i].name, "multiboot.bin"));
|
!strcmp(option_rom[i].name, "multiboot.bin"));
|
||||||
rom_add_option(option_rom[i].name, option_rom[i].bootindex);
|
rom_add_option(option_rom[i].name, option_rom[i].bootindex);
|
||||||
}
|
}
|
||||||
|
@@ -22,17 +22,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/pci/msi.h>
|
#include "hw/pci/msi.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/pci/pci.h>
|
#include "hw/pci/pci.h"
|
||||||
|
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
#include <hw/ide/pci.h>
|
#include "hw/ide/pci.h"
|
||||||
#include <hw/ide/ahci.h>
|
#include "hw/ide/ahci.h"
|
||||||
|
|
||||||
#define DEBUG_AHCI 0
|
#define DEBUG_AHCI 0
|
||||||
|
|
||||||
|
@@ -23,15 +23,15 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/pci/pci.h>
|
#include "hw/pci/pci.h"
|
||||||
#include <hw/isa/isa.h>
|
#include "hw/isa/isa.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
|
|
||||||
#include <hw/ide/pci.h>
|
#include "hw/ide/pci.h"
|
||||||
|
|
||||||
/* CMD646 specific */
|
/* CMD646 specific */
|
||||||
#define CFR 0x50
|
#define CFR 0x50
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/pci/pci.h>
|
#include "hw/pci/pci.h"
|
||||||
#include <hw/isa/isa.h>
|
#include "hw/isa/isa.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "qemu/cutils.h"
|
#include "qemu/cutils.h"
|
||||||
|
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
|
|
||||||
/* These values were based on a Seagate ST3500418AS but have been modified
|
/* These values were based on a Seagate ST3500418AS but have been modified
|
||||||
to make more sense in QEMU */
|
to make more sense in QEMU */
|
||||||
|
14
hw/ide/ich.c
14
hw/ide/ich.c
@@ -61,15 +61,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/pci/msi.h>
|
#include "hw/pci/msi.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/pci/pci.h>
|
#include "hw/pci/pci.h"
|
||||||
#include <hw/isa/isa.h>
|
#include "hw/isa/isa.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
#include <hw/ide/pci.h>
|
#include "hw/ide/pci.h"
|
||||||
#include <hw/ide/ahci.h>
|
#include "hw/ide/ahci.h"
|
||||||
|
|
||||||
#define ICH9_MSI_CAP_OFFSET 0x80
|
#define ICH9_MSI_CAP_OFFSET 0x80
|
||||||
#define ICH9_SATA_CAP_OFFSET 0xA8
|
#define ICH9_SATA_CAP_OFFSET 0xA8
|
||||||
|
@@ -23,13 +23,13 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/isa/isa.h>
|
#include "hw/isa/isa.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
|
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
/* ISA IDE definitions */
|
/* ISA IDE definitions */
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
|
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
|
|
||||||
/* debug MACIO */
|
/* debug MACIO */
|
||||||
// #define DEBUG_MACIO
|
// #define DEBUG_MACIO
|
||||||
|
@@ -23,13 +23,13 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <hw/hw.h>
|
#include "hw/hw.h"
|
||||||
#include <hw/i386/pc.h>
|
#include "hw/i386/pc.h"
|
||||||
#include <hw/pcmcia.h>
|
#include "hw/pcmcia.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
|
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
|
|
||||||
#define TYPE_MICRODRIVE "microdrive"
|
#define TYPE_MICRODRIVE "microdrive"
|
||||||
#define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRIVE)
|
#define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRIVE)
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
|
|
||||||
#include <hw/ide/internal.h>
|
#include "hw/ide/internal.h"
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
/* MMIO based ide port
|
/* MMIO based ide port
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user