virsh: Correctly detect inserted media in change-media command
virsh: Correctly detect inserted media in change-media command

https://bugzilla.redhat.com/show_bug.cgi?id=1250331

It all works like this. The change-media command dumps domain
XML, finds the corresponding cdrom device we want to change media
in and returns it in the xmlNodePtr form. This way we don't have
to bother with keeping all the subelements or attributes that we
don't care about in the XML that is fed back to libvirt for the
update API.

Now, the problem is we try to be clever here and detect if disk
already has a source (indicated by <source/> subelement).
However, bare fact that the element is there does not mean disk
has source. Make our clever check better.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

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