xen-block.c (38a6de80b917b2a822cff0e38d83563ab401c890) | xen-block.c (fb2575f95411644abe7f0606594035b63a5132ad) |
---|---|
1/* 2 * Copyright (c) 2018 Citrix Systems Inc. 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8#include "qemu/osdep.h" --- 355 unchanged lines hidden (view full) --- 364 switch (vdev->type) { 365 case XEN_BLOCK_VDEV_TYPE_DP: 366 str = g_strdup_printf("d%lup%lu", vdev->disk, vdev->partition); 367 break; 368 369 case XEN_BLOCK_VDEV_TYPE_XVD: 370 case XEN_BLOCK_VDEV_TYPE_HD: 371 case XEN_BLOCK_VDEV_TYPE_SD: { | 1/* 2 * Copyright (c) 2018 Citrix Systems Inc. 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8#include "qemu/osdep.h" --- 355 unchanged lines hidden (view full) --- 364 switch (vdev->type) { 365 case XEN_BLOCK_VDEV_TYPE_DP: 366 str = g_strdup_printf("d%lup%lu", vdev->disk, vdev->partition); 367 break; 368 369 case XEN_BLOCK_VDEV_TYPE_XVD: 370 case XEN_BLOCK_VDEV_TYPE_HD: 371 case XEN_BLOCK_VDEV_TYPE_SD: { |
372 char *name = disk_to_vbd_name(vdev->disk); | 372 char *vbd_name = disk_to_vbd_name(vdev->disk); |
373 374 str = g_strdup_printf("%s%s%lu", 375 (vdev->type == XEN_BLOCK_VDEV_TYPE_XVD) ? 376 "xvd" : 377 (vdev->type == XEN_BLOCK_VDEV_TYPE_HD) ? 378 "hd" : 379 "sd", | 373 374 str = g_strdup_printf("%s%s%lu", 375 (vdev->type == XEN_BLOCK_VDEV_TYPE_XVD) ? 376 "xvd" : 377 (vdev->type == XEN_BLOCK_VDEV_TYPE_HD) ? 378 "hd" : 379 "sd", |
380 name, vdev->partition); 381 g_free(name); | 380 vbd_name, vdev->partition); 381 g_free(vbd_name); |
382 break; 383 } 384 default: 385 error_setg(errp, "invalid vdev type"); 386 return; 387 } 388 389 visit_type_str(v, name, &str, errp); --- 657 unchanged lines hidden --- | 382 break; 383 } 384 default: 385 error_setg(errp, "invalid vdev type"); 386 return; 387 } 388 389 visit_type_str(v, name, &str, errp); --- 657 unchanged lines hidden --- |