[libvirt] listing domains on Fedora 8 XEN kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having a problem being able to get domain information in an Fedora
8 XEN environment.The code does not receive an error status on the XEN
kernel and does not get any information.

The same code running on the non XEN kernel works fine.

I am running default configuration files.  

Is this a known issue?
Do I need to tweak the configuration files?

Is there anything else I need to do get the code to work on the XEN
kernel?  Please point me in the right direction.

If any other information is required to assist in answering my question,
please let me know.

Thank you in advance for your help.

Steven Oliphant

Software installed:

rpm -qa | grep kernel 

kernel-headers-2.6.25.9-40.fc8
kernel-devel-2.6.23.1-42.fc8
kernel-2.6.23.1-42.fc8
kernel-xen-2.6.21-2950.fc8
kernel-2.6.25.9-40.fc8
kernel-devel-2.6.25.9-40.fc8
kernel-xen-2.6.21.7-3.fc8

rpm -qa | grep xen

xen-devel-3.1.2-2.fc8
xenwatch-0.5.2-2.fc8
kernel-xen-2.6.21-2950.fc8
xen-debuginfo-3.1.2-2.fc8
kernel-xen-2.6.21.7-3.fc8
xen-libs-3.1.2-2.fc8
xen-3.1.2-2.fc8

rpm -qa | grep virt

libvirt-devel-0.4.4-1.fc8
ruby-libvirt-0.0.7-1.fc8
libvirt-python-0.4.4-1.fc8
python-virtinst-0.300.2-4.fc8
virt-manager-0.5.3-2.fc8
libvirt-debuginfo-0.4.4-1.fc8
libvirt-0.4.4-1.fc8

Non XEN kernel:

uname -a
Linux steve-1.verizon.net 2.6.25.9-40.fc8 #1 SMP Fri Jun 27 16:25:53 EDT
2008 i686 athlon i386 GNU/Linux

XEN kernel

uname -a
Linux steve-1.verizon.net 2.6.21.7-3.fc8xen #1 SMP Thu Mar 20 14:57:53
EDT 2008 i686 athlon i386 GNU/Linux

Code sample:

#include <stdio.h>
#include <libvirt/libvirt.h>

#define DOMAIN_COUNT   10

/**
 * getInfo:
 *
 * extract the virtual machine information
 */
static void
getInfo(void) {
    virConnectPtr conn = NULL; /* the hypervisor connection */
    virDomainPtr dom = NULL;   /* the domain being checked */

    int ret;
    int id;
    int i, j, k, ids[DOMAIN_COUNT];
    
    char *names[DOMAIN_COUNT];

    /* NULL means connect to local Xen hypervisor */
    
    conn = virConnectOpen(NULL);
    if (conn == NULL) {
      fprintf(stderr, "Failed to connect to hypervisor\n");
      goto error;
    }

    /* Get the active domain list */
	  
    i = virConnectListDomains(conn, &ids[0], DOMAIN_COUNT);
	  if (i < 0) {
	    fprintf(stderr, "Failed to list the domains\n");
	    goto error;
	  }
	  for (j = 0;j < i;j++) {
	    if (ids[j] != 0) {
	      id = ids[j];
		    fprintf(stdout, "Active Domain: %d\n", id);
        /* Get the information */

	    }

    }
    /* Get defined Domain Names */

    ret = virConnectListDefinedDomains (conn, names, DOMAIN_COUNT);
    if (ret < 0) {
      fprintf(stderr, "Failed to get Domain Names\n");
	    goto error;
    }

    for (k = 0;k < ret;k++) {
      printf("Inactive Domain Name: %s\n", names[k]);
    }


error:
    if (dom != NULL)
      virDomainFree(dom);
    if (conn != NULL)
      virConnectClose(conn);
}

int main() {

    getInfo();

    return(0);
}


--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]