<div dir="ltr"><div><div><div><div>As we know that Libvirt translates a device name of the form (regex) /^[fhv]d[a-z]+[0-9]*$/ into the corresponding index (e.g. sda => 0, hdz => 25, vdaa => 26) such that any trailing string of digits is simply ignored. Thus disk names like vda2 after attaching vda1 will error out like this:<br><br>2017-02-16 10:31:05.214+0000: 10668: error : qemuMonitorJSONCheckError:387 : internal error: unable to execute QEMU command 'device_add': Duplicate ID 'virtio-disk7' for device<br>error: Failed to attach disk<br>error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'virtio-disk7' for device<br><br></div>Thus, should we document this (trailing digits are ignored) in virsh manpage for attach-disk or is the user  expected to know?<br></div>Also shd the error message reported be better in such cases or this one is fine?<br><br></div>Thanks,<br></div>Nitesh.<br><div><div><br><br><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 16, 2017 at 2:30 PM, Michal Privoznik <span dir="ltr"><<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 02/15/2017 12:14 PM, Nitesh Konkar wrote:<br>
> Currently disk names do not follow the<br>
> (regex) /^[fhv]d[a-z]+[0-9]*$/ completely<br>
> and hence one can assign disk names like<br>
> vd2 etc. This patch ensures that the<br>
> disk names follow the regex mentioned.<br>
> This patch also adds a testcase.<br>
><br>
> Signed-off-by: Nitesh Konkar <<a href="mailto:nitkon12@linux.vnet.ibm.com">nitkon12@linux.vnet.ibm.com</a>><br>
> ---<br>
>  src/util/virutil.c | 2 +-<br>
>  tests/utiltest.c   | 3 ++-<br>
>  2 files changed, 3 insertions(+), 2 deletions(-)<br>
><br>
<br>
</span>ACKed and pushed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Michal<br>
</font></span></blockquote></div><br></div>