stream.c (4513eafe928ff47486f4167c28d364c72b5ff7e3) stream.c (fa4478d5c8b74a5f0c8b93cc00590ec007be5016)
1/*
2 * Image streaming
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
8 *

--- 256 unchanged lines hidden (view full) ---

265};
266
267void stream_start(BlockDriverState *bs, BlockDriverState *base,
268 const char *base_id, int64_t speed,
269 BlockDriverCompletionFunc *cb,
270 void *opaque, Error **errp)
271{
272 StreamBlockJob *s;
1/*
2 * Image streaming
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
8 *

--- 256 unchanged lines hidden (view full) ---

265};
266
267void stream_start(BlockDriverState *bs, BlockDriverState *base,
268 const char *base_id, int64_t speed,
269 BlockDriverCompletionFunc *cb,
270 void *opaque, Error **errp)
271{
272 StreamBlockJob *s;
273 Coroutine *co;
274
275 s = block_job_create(&stream_job_type, bs, speed, cb, opaque, errp);
276 if (!s) {
277 return;
278 }
279
280 s->base = base;
281 if (base_id) {
282 pstrcpy(s->backing_file_id, sizeof(s->backing_file_id), base_id);
283 }
284
273
274 s = block_job_create(&stream_job_type, bs, speed, cb, opaque, errp);
275 if (!s) {
276 return;
277 }
278
279 s->base = base;
280 if (base_id) {
281 pstrcpy(s->backing_file_id, sizeof(s->backing_file_id), base_id);
282 }
283
285 co = qemu_coroutine_create(stream_run);
286 trace_stream_start(bs, base, s, co, opaque);
287 qemu_coroutine_enter(co, s);
284 s->common.co = qemu_coroutine_create(stream_run);
285 trace_stream_start(bs, base, s, s->common.co, opaque);
286 qemu_coroutine_enter(s->common.co, s);
288}
287}