xend: Don't crash in virDomainXMLDevID
xend: Don't crash in virDomainXMLDevID

The function is called from all {Attach,Update,Detach}Device APIs to
create config strings that are later passed to the xend to perform the
desired action. The function is intended to handle all supported
devices. However, as of 5b05358abacb1029fa0d61f72decacf0d4fd8ffb we
are trying to get disk driver of the device without checking if the
device really is a disk. This leads to an segmentation fault:

  #0 0x00007ffff7571815 in virDomainDiskGetDriver () from /usr/lib/libvirt.so.0
  #1 0x00007fffeb9ad471 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
  #2 0x00007fffeb9b1062 in xenDaemonAttachDeviceFlags () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
  #3 0x00007fffeb9a8a86 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
  #4 0x00007ffff7609266 in virDomainAttachDevice () from /usr/lib/libvirt.so.0
  #5 0x0000555555593c9d in ?? ()
  #6 0x00007ffff76743c9 in virNetServerProgramDispatch () from /usr/lib/libvirt.so.0
  #7 0x00005555555a678d in ?? ()
  #8 0x00007ffff755460e in ?? () from /usr/lib/libvirt.so.0
  #9 0x00007ffff7553b06 in ?? () from /usr/lib/libvirt.so.0
  #10 0x00007ffff4998b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
  #11 0x00007ffff46e30ed in clone () from /lib/x86_64-linux-gnu/libc.so.6
  #12 0x0000000000000000 in ?? ()

Reported-by: Xiaolin Su <37114c867478f97be5cdf184c02666e897bd2941@126.com>
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

zippy2/libvirt,taget/libvirt,nertpinx/libvirt,VenkatDatta/libvirt,rlaager/libvirt,rlaager/libvirt,taget/libvirt,shugaoye/libvirt,crobinso/libvirt,agx/libvirt,rlaager/libvirt,VenkatDatta/libvirt,andreabolognani/libvirt,datto/libvirt,jardasgit/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,datto/libvirt,shugaoye/libvirt,datto/libvirt,eskultety/libvirt,agx/libvirt,datto/libvirt,olafhering/libvirt,jardasgit/libvirt,olafhering/libvirt,nertpinx/libvirt,shugaoye/libvirt,jfehlig/libvirt,taget/libvirt,fabianfreyer/libvirt,rlaager/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,crobinso/libvirt,nertpinx/libvirt,taget/libvirt,zippy2/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,olafhering/libvirt,eskultety/libvirt,crobinso/libvirt,zippy2/libvirt,agx/libvirt,libvirt/libvirt,libvirt/libvirt,jardasgit/libvirt,rlaager/libvirt,agx/libvirt,shugaoye/libvirt,jfehlig/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,datto/libvirt,crobinso/libvirt,jardasgit/libvirt,eskultety/libvirt,shugaoye/libvirt,andreabolognani/libvirt,taget/libvirt,agx/libvirt,jfehlig/libvirt,jardasgit/libvirt,andreabolognani/libvirt,eskultety/libvirt,eskultety/libvirt,VenkatDatta/libvirt,jfehlig/libvirt,libvirt/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,nertpinx/libvirt