[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block
From: |
David Woodhouse |
Subject: |
Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices |
Date: |
Fri, 27 Oct 2023 09:45:39 +0100 |
User-agent: |
Evolution 3.44.4-0ubuntu2 |
On Fri, 2023-10-27 at 08:30 +0100, Durrant, Paul wrote:
>
> > + if (blockdev->props.vdev.type == XEN_BLOCK_VDEV_TYPE_INVALID) {
> > + XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev)));
> > + char fe_path[XENSTORE_ABS_PATH_MAX + 1];
> > + char *value;
> > + int disk = 0;
> > + unsigned long idx;
> > +
> > + /* Find an unoccupied device name */
>
> Not sure this is going to work is it? What happens if 'hda' or 'sda', or
> 'd0' exists? I think you need to use the core of the code in
> xen_block_set_vdev() to generate names and search all possible encodings
> for each disk.
Do we care? You're allowed to have *all* of "hda", "sda" and "xvda" at
the same time. If a user explicitly provides "sda" and then provides
another disk without giving it a name, we're allowed to use "xvda".
Hell, you can also have *separate* backing stores provided as "hda1",
"sda1" and "xvda1". I *might* have tolerated a heckle that this
function should check for at least the latter of those, but when I was
first coding it up I was more inclined to argue "Don't Do That Then".
smime.p7s
Description: S/MIME cryptographic signature
- [PATCH v3 25/28] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot(), (continued)
- [PATCH v3 25/28] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot(), David Woodhouse, 2023/10/25
- [PATCH v3 17/28] hw/xen: add support for Xen primary console in emulated mode, David Woodhouse, 2023/10/25
- [PATCH v3 06/28] hw/xen: take iothread mutex in xen_evtchn_reset_op(), David Woodhouse, 2023/10/25
- [PATCH v3 08/28] i386/xen: Ignore VCPU_SSHOTTMR_future flag in set_singleshot_timer(), David Woodhouse, 2023/10/25
- [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, David Woodhouse, 2023/10/25
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, Durrant, Paul, 2023/10/27
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices,
David Woodhouse <=
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, Durrant, Paul, 2023/10/27
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, David Woodhouse, 2023/10/27
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, Durrant, Paul, 2023/10/27
- Re: [PATCH v3 13/28] hw/xen: automatically assign device index to block devices, David Woodhouse, 2023/10/27
[PATCH v3 11/28] i386/xen: advertise XEN_HVM_CPUID_UPCALL_VECTOR in CPUID, David Woodhouse, 2023/10/25
[PATCH v3 05/28] hw/xen: fix XenStore watch delivery to guest, David Woodhouse, 2023/10/25
[PATCH v3 16/28] hw/xen: update Xen console to XenDevice model, David Woodhouse, 2023/10/25
[PATCH v3 03/28] hw/xen: select kernel mode for per-vCPU event channel upcall vector, David Woodhouse, 2023/10/25
[PATCH v3 24/28] net: add qemu_create_nic_bus_devices(), David Woodhouse, 2023/10/25