Commit 04470fa5 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Fix error handling for virNodeDeviceGetParent()

It is valid for virNodeDeviceGetParent() to return NULL in the
case where there is no parent device present.
Signed-off-by: 's avatarDaniel P. Berrange <>
parent 3cbba2b2
......@@ -5275,8 +5275,10 @@ const char *
virNodeDevicePtr dev;
if (!(RETVAL = virNodeDeviceGetParent(dev)))
if (!(RETVAL = virNodeDeviceGetParent(dev))) {
if (virGetLastError() != NULL)
use Sys::Virt;
my $conn = Sys::Virt->new();
my @nodelist = $conn->list_all_node_devices();
foreach my $dev (@nodelist){
my $parent = $dev->get_parent();
printf "%s: < %s\n", $dev->get_name(), $parent;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment