curl.c (6265eb26a375179f193f792e4f0d49036d2cf052) | curl.c (66f82ceed6781261c09e65fb440ca76842fd0500) |
---|---|
1/* 2 * QEMU Block driver for CURL images 3 * 4 * Copyright (c) 2009 Alexander Graf <agraf@suse.de> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 481 unchanged lines hidden (view full) --- 490 return s->len; 491} 492 493static BlockDriver bdrv_http = { 494 .format_name = "http", 495 .protocol_name = "http", 496 497 .instance_size = sizeof(BDRVCURLState), | 1/* 2 * QEMU Block driver for CURL images 3 * 4 * Copyright (c) 2009 Alexander Graf <agraf@suse.de> 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 481 unchanged lines hidden (view full) --- 490 return s->len; 491} 492 493static BlockDriver bdrv_http = { 494 .format_name = "http", 495 .protocol_name = "http", 496 497 .instance_size = sizeof(BDRVCURLState), |
498 .bdrv_open = curl_open, | 498 .bdrv_file_open = curl_open, |
499 .bdrv_close = curl_close, 500 .bdrv_getlength = curl_getlength, 501 502 .bdrv_aio_readv = curl_aio_readv, 503}; 504 505static BlockDriver bdrv_https = { 506 .format_name = "https", 507 .protocol_name = "https", 508 509 .instance_size = sizeof(BDRVCURLState), | 499 .bdrv_close = curl_close, 500 .bdrv_getlength = curl_getlength, 501 502 .bdrv_aio_readv = curl_aio_readv, 503}; 504 505static BlockDriver bdrv_https = { 506 .format_name = "https", 507 .protocol_name = "https", 508 509 .instance_size = sizeof(BDRVCURLState), |
510 .bdrv_open = curl_open, | 510 .bdrv_file_open = curl_open, |
511 .bdrv_close = curl_close, 512 .bdrv_getlength = curl_getlength, 513 514 .bdrv_aio_readv = curl_aio_readv, 515}; 516 517static BlockDriver bdrv_ftp = { 518 .format_name = "ftp", 519 .protocol_name = "ftp", 520 521 .instance_size = sizeof(BDRVCURLState), | 511 .bdrv_close = curl_close, 512 .bdrv_getlength = curl_getlength, 513 514 .bdrv_aio_readv = curl_aio_readv, 515}; 516 517static BlockDriver bdrv_ftp = { 518 .format_name = "ftp", 519 .protocol_name = "ftp", 520 521 .instance_size = sizeof(BDRVCURLState), |
522 .bdrv_open = curl_open, | 522 .bdrv_file_open = curl_open, |
523 .bdrv_close = curl_close, 524 .bdrv_getlength = curl_getlength, 525 526 .bdrv_aio_readv = curl_aio_readv, 527}; 528 529static BlockDriver bdrv_ftps = { 530 .format_name = "ftps", 531 .protocol_name = "ftps", 532 533 .instance_size = sizeof(BDRVCURLState), | 523 .bdrv_close = curl_close, 524 .bdrv_getlength = curl_getlength, 525 526 .bdrv_aio_readv = curl_aio_readv, 527}; 528 529static BlockDriver bdrv_ftps = { 530 .format_name = "ftps", 531 .protocol_name = "ftps", 532 533 .instance_size = sizeof(BDRVCURLState), |
534 .bdrv_open = curl_open, | 534 .bdrv_file_open = curl_open, |
535 .bdrv_close = curl_close, 536 .bdrv_getlength = curl_getlength, 537 538 .bdrv_aio_readv = curl_aio_readv, 539}; 540 541static BlockDriver bdrv_tftp = { 542 .format_name = "tftp", 543 .protocol_name = "tftp", 544 545 .instance_size = sizeof(BDRVCURLState), | 535 .bdrv_close = curl_close, 536 .bdrv_getlength = curl_getlength, 537 538 .bdrv_aio_readv = curl_aio_readv, 539}; 540 541static BlockDriver bdrv_tftp = { 542 .format_name = "tftp", 543 .protocol_name = "tftp", 544 545 .instance_size = sizeof(BDRVCURLState), |
546 .bdrv_open = curl_open, | 546 .bdrv_file_open = curl_open, |
547 .bdrv_close = curl_close, 548 .bdrv_getlength = curl_getlength, 549 550 .bdrv_aio_readv = curl_aio_readv, 551}; 552 553static void curl_block_init(void) 554{ 555 bdrv_register(&bdrv_http); 556 bdrv_register(&bdrv_https); 557 bdrv_register(&bdrv_ftp); 558 bdrv_register(&bdrv_ftps); 559 bdrv_register(&bdrv_tftp); 560} 561 562block_init(curl_block_init); | 547 .bdrv_close = curl_close, 548 .bdrv_getlength = curl_getlength, 549 550 .bdrv_aio_readv = curl_aio_readv, 551}; 552 553static void curl_block_init(void) 554{ 555 bdrv_register(&bdrv_http); 556 bdrv_register(&bdrv_https); 557 bdrv_register(&bdrv_ftp); 558 bdrv_register(&bdrv_ftps); 559 bdrv_register(&bdrv_tftp); 560} 561 562block_init(curl_block_init); |