trace-cmd: Do not return zero length name for guest by name

The function trace_get_guest() will first look for a guest by name, and
if it finds one, it will return it. But if the guest added did not have
a name (but had an empty string), it would return any guest that also
did not have a name (but just an empty string). If two guests did not
have a name, and the CID was used, then the first guest would be
returned for the second guest, breaking the creating of two guests where
both were without names.

Link: https://lore.kernel.org/linux-trace-devel/20220922002348.3302169-4-rostedt@goodmis.org

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed