• M
    lib: Format PCI address differently · 9b332820
    Michal Privoznik 提交于
    Currently, the way we format PCI address is using printf-s
    precision, e.g. "%.4x". This works if we don't want to print any
    value outside of bounds (which is usually the case). However,
    turns out, PCI domain can be 0x10000 which doesn't work well with
    our format strings. However, if we change the format string to
    "%04x" then we still pad small values with zeroes but also we are
    able to print values that are larger than four digits. In fact,
    this format string used by kernel to print a PCI address:
    
      "%04x:%02x:%02x.%d"
    
    The other three format strings (for bus, device and function) are
    changed too, so that we use the same format string as kernel.
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    Reviewed-by: NJán Tomko <jtomko@redhat.com>
    9b332820
virsh-domain.c 412.0 KB