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

[libvirt] there is a mistake in "libvirt development guide, chapter 4.1: list domains"



int i;
int numDomains;
char **inactiveDomains;

numDomains = virConnectNumOfDefinedDomains(conn);

inactiveDomains = malloc(sizeof(char *) * numDomains);
numDomains = virConnectListDomains(conn, inactiveDomains, numDomains);

printf("Inactive domain names:\n");
for (i = 0 ; i < numDomains ; i++) {
    printf("  %s\n", inactiveDomains[i]);
    free(inactiveDomains[i]);
}
free(inactiveDomains);
Example 4.5. Listing inactive domains


There should use "virConnectListDefinedDomains" for inactive domains.  

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