~serge-hallyn/ubuntu/raring/libvirt/libvirt-hugepages

« back to all changes in this revision

Viewing changes to src/uml/uml_driver.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-07-11 12:37:49 UTC
  • mfrom: (1.2.14)
  • Revision ID: package-import@ubuntu.com-20120711123749-gt314clvb7840c6p
Tags: 0.9.13-0ubuntu1
* New upstream version: 
* debian/rules: Remove .la files
* debian/control: Dropped debian vcs info.
* Dropped:
  - debian/paches/9022-pass-the-virt-driver-name-into-security-drivers:
    Already applied upstream.
  - debian/patches/9023-dont-enable-apparmor-driver-with-lxc
    Already applied upstream.
  - debian/patches/9024-initialize-random-generator-in-lxc:
    Already applied upstream.
* Re-diffed:
  - debian/patches/9002-better_default_uri_virsh.patch
* Added:
  - debian/patches/add-libvirt-highbank-support.patch: Add highbank 
    CPU detection support.
  - debian/patches/fix-lxc-container-unmounting.patch: Fix container
    mounting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
#include "virnetdevtap.h"
65
65
#include "virnodesuspend.h"
66
66
#include "viruri.h"
 
67
#include "virdomainlist.h"
67
68
 
68
69
#define VIR_FROM_THIS VIR_FROM_UML
69
70
 
392
393
static int
393
394
umlStartup(int privileged)
394
395
{
395
 
    uid_t uid = geteuid();
396
396
    char *base = NULL;
397
397
    char *userdir = NULL;
398
398
 
418
418
    if (!uml_driver->domainEventState)
419
419
        goto error;
420
420
 
421
 
    userdir = virGetUserDirectory(uid);
 
421
    userdir = virGetUserDirectory();
422
422
    if (!userdir)
423
423
        goto error;
424
424
 
434
434
                        "%s/run/libvirt/uml-guest", LOCALSTATEDIR) == -1)
435
435
            goto out_of_memory;
436
436
    } else {
 
437
        base = virGetUserConfigDirectory();
 
438
        if (!base)
 
439
            goto error;
437
440
 
438
441
        if (virAsprintf(&uml_driver->logDir,
439
 
                        "%s/.libvirt/uml/log", userdir) == -1)
440
 
            goto out_of_memory;
441
 
 
442
 
        if (virAsprintf(&base, "%s/.libvirt", userdir) == -1)
 
442
                        "%s/uml/log", base) == -1)
443
443
            goto out_of_memory;
444
444
 
445
445
        if (virAsprintf(&uml_driver->monitorDir,
447
447
            goto out_of_memory;
448
448
    }
449
449
 
450
 
    /* Configuration paths are either ~/.libvirt/uml/... (session) or
 
450
    /* Configuration paths are either $XDG_CONFIG_HOME/libvirt/uml/... (session) or
451
451
     * /etc/libvirt/uml/... (system).
452
452
     */
453
453
    if (virAsprintf(&uml_driver->configDir, "%s/uml", base) == -1)
1188
1188
    struct uml_driver *driver = conn->privateData;
1189
1189
 
1190
1190
    umlDriverLock(driver);
1191
 
    virDomainEventStateDeregisterConn(conn,
1192
 
                                      driver->domainEventState);
1193
1191
    umlProcessAutoDestroyRun(driver, conn);
1194
1192
    umlDriverUnlock(driver);
1195
1193
 
2522
2520
    virDomainEventStateQueue(driver->domainEventState, event);
2523
2521
}
2524
2522
 
 
2523
static int umlListAllDomains(virConnectPtr conn,
 
2524
                             virDomainPtr **domains,
 
2525
                             unsigned int flags)
 
2526
{
 
2527
    struct uml_driver *driver = conn->privateData;
 
2528
    int ret = -1;
 
2529
 
 
2530
    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, -1);
 
2531
 
 
2532
    umlDriverLock(driver);
 
2533
    ret = virDomainList(conn, driver->domains.objs, domains, flags);
 
2534
    umlDriverUnlock(driver);
 
2535
 
 
2536
    return ret;
 
2537
}
 
2538
 
2525
2539
 
2526
2540
 
2527
2541
static virDriver umlDriver = {
2536
2550
    .getCapabilities = umlGetCapabilities, /* 0.5.0 */
2537
2551
    .listDomains = umlListDomains, /* 0.5.0 */
2538
2552
    .numOfDomains = umlNumDomains, /* 0.5.0 */
 
2553
    .listAllDomains = umlListAllDomains, /* 0.9.13 */
2539
2554
    .domainCreateXML = umlDomainCreate, /* 0.5.0 */
2540
2555
    .domainLookupByID = umlDomainLookupByID, /* 0.5.0 */
2541
2556
    .domainLookupByUUID = umlDomainLookupByUUID, /* 0.5.0 */