blockjob.c (2259637b95bef3116cc262459271de08e038cc66) | blockjob.c (b441dc71c0b7e8f488a6ebc2aa781b08a3a05038) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2011 IBM Corp. 5 * Copyright (c) 2012 Red Hat, Inc. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 190 unchanged lines hidden (view full) --- 199 job->nodes = NULL; 200} 201 202int block_job_add_bdrv(BlockJob *job, const char *name, BlockDriverState *bs, 203 uint64_t perm, uint64_t shared_perm, Error **errp) 204{ 205 BdrvChild *c; 206 | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2011 IBM Corp. 5 * Copyright (c) 2012 Red Hat, Inc. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 190 unchanged lines hidden (view full) --- 199 job->nodes = NULL; 200} 201 202int block_job_add_bdrv(BlockJob *job, const char *name, BlockDriverState *bs, 203 uint64_t perm, uint64_t shared_perm, Error **errp) 204{ 205 BdrvChild *c; 206 |
207 bdrv_ref(bs); |
|
207 c = bdrv_root_attach_child(bs, name, &child_job, perm, shared_perm, 208 job, errp); 209 if (c == NULL) { 210 return -EPERM; 211 } 212 213 job->nodes = g_slist_prepend(job->nodes, c); | 208 c = bdrv_root_attach_child(bs, name, &child_job, perm, shared_perm, 209 job, errp); 210 if (c == NULL) { 211 return -EPERM; 212 } 213 214 job->nodes = g_slist_prepend(job->nodes, c); |
214 bdrv_ref(bs); | |
215 bdrv_op_block_all(bs, job->blocker); 216 217 return 0; 218} 219 220static void block_job_on_idle(Notifier *n, void *opaque) 221{ 222 aio_wait_kick(); --- 285 unchanged lines hidden --- | 215 bdrv_op_block_all(bs, job->blocker); 216 217 return 0; 218} 219 220static void block_job_on_idle(Notifier *n, void *opaque) 221{ 222 aio_wait_kick(); --- 285 unchanged lines hidden --- |