diff --git a/generator/actions_core_deprecated.ml b/generator/actions_core_deprecated.ml index 00dde3d2a..f1040a0e9 100644 --- a/generator/actions_core_deprecated.ml +++ b/generator/actions_core_deprecated.ml @@ -73,7 +73,9 @@ of C." }; shortdesc = "add a drive specifying the QEMU block emulation to use"; longdesc = "\ This is the same as C but it allows you -to specify the QEMU interface emulation to use at run time." }; +to specify the QEMU interface emulation to use at run time. +The libvirt backend rejects a non-empty C argument. +The direct backend ignores C." }; { defaults with name = "add_drive_ro_with_if"; added = (1, 0, 84); @@ -83,7 +85,9 @@ to specify the QEMU interface emulation to use at run time." }; shortdesc = "add a drive read-only specifying the QEMU block emulation to use"; longdesc = "\ This is the same as C but it allows you -to specify the QEMU interface emulation to use at run time." }; +to specify the QEMU interface emulation to use at run time. +The libvirt backend rejects a non-empty C argument. +The direct backend ignores C." }; { defaults with name = "lstatlist"; added = (1, 0, 77); diff --git a/lib/launch-direct.c b/lib/launch-direct.c index 5c91822fb..c07a8d78f 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -296,52 +296,19 @@ static int add_drive (guestfs_h *g, struct backend_direct_data *data, struct qemuopts *qopts, size_t i, struct drive *drv) { - /* If there's an explicit 'iface', use it. Otherwise default to - * virtio-scsi. - */ - if (drv->iface && STREQ (drv->iface, "virtio")) { /* virtio-blk */ - start_list ("-drive") { - if (add_drive_standard_params (g, data, qopts, i, drv) == -1) - return -1; - append_list ("if=none"); - } end_list (); - start_list ("-device") { - append_list (VIRTIO_DEVICE_NAME ("virtio-blk")); - append_list_format ("drive=hd%zu", i); - if (drv->disk_label) - append_list_format ("serial=%s", drv->disk_label); - if (add_device_blocksize_params (g, qopts, drv) == -1) - return -1; - } end_list (); - } -#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) - else if (drv->iface && STREQ (drv->iface, "ide")) { - error (g, "'ide' interface does not work on ARM or PowerPC"); - return -1; - } -#endif - else if (drv->iface) { - start_list ("-drive") { - if (add_drive_standard_params (g, data, qopts, i, drv) == -1) - return -1; - append_list_format ("if=%s", drv->iface); - } end_list (); - } - else /* default case: virtio-scsi */ { - start_list ("-drive") { - if (add_drive_standard_params (g, data, qopts, i, drv) == -1) - return -1; - append_list ("if=none"); - } end_list (); - start_list ("-device") { - append_list ("scsi-hd"); - append_list_format ("drive=hd%zu", i); - if (drv->disk_label) - append_list_format ("serial=%s", drv->disk_label); - if (add_device_blocksize_params (g, qopts, drv) == -1) - return -1; - } end_list (); - } + start_list ("-drive") { + if (add_drive_standard_params (g, data, qopts, i, drv) == -1) + return -1; + append_list ("if=none"); + } end_list (); + start_list ("-device") { + append_list ("scsi-hd"); + append_list_format ("drive=hd%zu", i); + if (drv->disk_label) + append_list_format ("serial=%s", drv->disk_label); + if (add_device_blocksize_params (g, qopts, drv) == -1) + return -1; + } end_list (); return 0;