On Mon, Sep 10, 2018 at 08:00:16PM -0700, Carlos Cardenas wrote:
> Attached patch allows vmd to fail fast on unknown disk format along with
> some minor clean up on logging.
OK kn with the following adjustment:

> @@ -1756,7 +1756,7 @@ virtio_init_disk(struct virtio_backing *
>       case VMDF_RAW:          return virtio_init_raw(file, sz, fd);
>       case VMDF_QCOW2:        return virtio_init_qcow2(file, sz, fd);
>       }
> -     log_warnx("%s: invalid disk format", __progname);
> +     log_warnx("%s: invalid disk format", __func__);

> @@ -1838,8 +1838,11 @@ virtio_init(struct vmd_vm *vm, int child
>                       vioblk[i].vm_id = vcp->vcp_id;
>                       vioblk[i].irq = pci_get_dev_irq(id);
>                       if (virtio_init_disk(&vioblk[i].file, &vioblk[i].sz,
> -                         child_disks[i], vmc->vmc_disktypes[i]) == -1)
> -                             continue;
> +                         child_disks[i], vmc->vmc_disktypes[i]) == -1) {
> +                             log_warnx("%s: unable to determine disk fmt",
> +                                 __func__);
Please stay consistent, use "format" not "fmt" throught all messages.

Reply via email to