|
@@ -20,7 +20,6 @@
|
20
|
20
|
FILE_LICENCE ( GPL2_OR_LATER );
|
21
|
21
|
|
22
|
22
|
#include <stdlib.h>
|
23
|
|
-#include <stdarg.h>
|
24
|
23
|
#include <errno.h>
|
25
|
24
|
#include <syslog.h>
|
26
|
25
|
#include <ipxe/iobuf.h>
|
|
@@ -229,17 +228,13 @@ static struct interface_descriptor downloader_job_desc =
|
229
|
228
|
*
|
230
|
229
|
* @v job Job control interface
|
231
|
230
|
* @v image Image to fill with downloaded file
|
232
|
|
- * @v type Location type to pass to xfer_open()
|
233
|
|
- * @v ... Remaining arguments to pass to xfer_open()
|
234
|
231
|
* @ret rc Return status code
|
235
|
232
|
*
|
236
|
|
- * Instantiates a downloader object to download the specified URI into
|
237
|
|
- * the specified image object.
|
|
233
|
+ * Instantiates a downloader object to download the content of the
|
|
234
|
+ * specified image from its URI.
|
238
|
235
|
*/
|
239
|
|
-int create_downloader ( struct interface *job, struct image *image,
|
240
|
|
- int type, ... ) {
|
|
236
|
+int create_downloader ( struct interface *job, struct image *image ) {
|
241
|
237
|
struct downloader *downloader;
|
242
|
|
- va_list args;
|
243
|
238
|
int rc;
|
244
|
239
|
|
245
|
240
|
/* Allocate and initialise structure */
|
|
@@ -252,21 +247,18 @@ int create_downloader ( struct interface *job, struct image *image,
|
252
|
247
|
intf_init ( &downloader->xfer, &downloader_xfer_desc,
|
253
|
248
|
&downloader->refcnt );
|
254
|
249
|
downloader->image = image_get ( image );
|
255
|
|
- va_start ( args, type );
|
256
|
250
|
|
257
|
251
|
/* Instantiate child objects and attach to our interfaces */
|
258
|
|
- if ( ( rc = xfer_vopen ( &downloader->xfer, type, args ) ) != 0 )
|
|
252
|
+ if ( ( rc = xfer_open_uri ( &downloader->xfer, image->uri ) ) != 0 )
|
259
|
253
|
goto err;
|
260
|
254
|
|
261
|
255
|
/* Attach parent interface, mortalise self, and return */
|
262
|
256
|
intf_plug_plug ( &downloader->job, job );
|
263
|
257
|
ref_put ( &downloader->refcnt );
|
264
|
|
- va_end ( args );
|
265
|
258
|
return 0;
|
266
|
259
|
|
267
|
260
|
err:
|
268
|
261
|
downloader_finished ( downloader, rc );
|
269
|
262
|
ref_put ( &downloader->refcnt );
|
270
|
|
- va_end ( args );
|
271
|
263
|
return rc;
|
272
|
264
|
}
|