virttest.utils_test: Add two functions for cdrom attach and eject

Several libvirt cases need attach/eject CDROM, so extract these two common functions here.

Signed-off-by: Yanbing Du <ydu@redhat.com>
Why 1M? I am curious about how will you use this function in your test case.