block.c (caa9cbd566877b34e9abcc04d936116fc5e0ab28) | block.c (774c726ceb2a3aa039dc20f0b51c9d36a2c6760d) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2020 Virtuozzo International GmbH. 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 --- 7968 unchanged lines hidden (view full) --- 7977{ 7978 GLOBAL_STATE_CODE(); 7979 if (!parent_bs->drv || !parent_bs->drv->bdrv_add_child) { 7980 error_setg(errp, "The node %s does not support adding a child", 7981 bdrv_get_device_or_node_name(parent_bs)); 7982 return; 7983 } 7984 | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2020 Virtuozzo International GmbH. 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 --- 7968 unchanged lines hidden (view full) --- 7977{ 7978 GLOBAL_STATE_CODE(); 7979 if (!parent_bs->drv || !parent_bs->drv->bdrv_add_child) { 7980 error_setg(errp, "The node %s does not support adding a child", 7981 bdrv_get_device_or_node_name(parent_bs)); 7982 return; 7983 } 7984 |
7985 /* 7986 * Non-zoned block drivers do not follow zoned storage constraints 7987 * (i.e. sequential writes to zones). Refuse mixing zoned and non-zoned 7988 * drivers in a graph. 7989 */ 7990 if (!parent_bs->drv->supports_zoned_children && 7991 child_bs->bl.zoned == BLK_Z_HM) { 7992 /* 7993 * The host-aware model allows zoned storage constraints and random 7994 * write. Allow mixing host-aware and non-zoned drivers. Using 7995 * host-aware device as a regular device. 7996 */ 7997 error_setg(errp, "Cannot add a %s child to a %s parent", 7998 child_bs->bl.zoned == BLK_Z_HM ? "zoned" : "non-zoned", 7999 parent_bs->drv->supports_zoned_children ? 8000 "support zoned children" : "not support zoned children"); 8001 return; 8002 } 8003 |
|
7985 if (!QLIST_EMPTY(&child_bs->parents)) { 7986 error_setg(errp, "The node %s already has a parent", 7987 child_bs->node_name); 7988 return; 7989 } 7990 7991 parent_bs->drv->bdrv_add_child(parent_bs, child_bs, errp); 7992} --- 287 unchanged lines hidden --- | 8004 if (!QLIST_EMPTY(&child_bs->parents)) { 8005 error_setg(errp, "The node %s already has a parent", 8006 child_bs->node_name); 8007 return; 8008 } 8009 8010 parent_bs->drv->bdrv_add_child(parent_bs, child_bs, errp); 8011} --- 287 unchanged lines hidden --- |