~ubuntu-branches/ubuntu/precise/libvirt/precise-proposed

« back to all changes in this revision

Viewing changes to src/qemu/qemu_process.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn, Adam Conrad, Serge Hallyn, Andres Lagar-Cavilla, Kirill Zaborsky
  • Date: 2013-02-21 08:38:35 UTC
  • mfrom: (206.1.1 precise-security)
  • Revision ID: package-import@ubuntu.com-20130221083835-g9lf8y87ko2k36v9
Tags: 0.9.8-2ubuntu17.8
[ Adam Conrad ]
* libvirt-bin.postinst: also put admin group members into the libvirtd
  group, to support systems installed before precise.  (LP: #1124127)
* libvirt-bin.postinst: use getent group instead of grep /etc/group

[ Serge Hallyn ]
* Update README.Debian:
  - we use libvirtd, not libvirt group (LP: #1095140)
  - we add users from sudo, not admin group, to libvirtd.
* Handle two usb devices with same vendor/id (LP: #1082213)
  - ubuntu/qemu-Keep-list-of-USB-devices-attached-to-domains
  - ubuntu/usb-create-functions-to-search-usb-device
  - ubuntu/qemu-call-usb-search-function-for-hostdev

[ Andres Lagar-Cavilla ]
* Add RESUME event listener to qemu monitor (LP: #1097824)
  - ubuntu/handle_resume.patch

[ Kirill Zaborsky ]
* Add proper handling for EINTR signal (LP: #1092826)
  - ubuntu/fix-poll.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
556
556
 
557
557
 
558
558
static int
 
559
qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
 
560
                        virDomainObjPtr vm)
 
561
{
 
562
    struct qemud_driver *driver = qemu_driver;
 
563
    virDomainEventPtr event = NULL;
 
564
 
 
565
    virDomainObjLock(vm);
 
566
    if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
 
567
        qemuDomainObjPrivatePtr priv = vm->privateData;
 
568
 
 
569
        if (priv->gotShutdown) {
 
570
            VIR_DEBUG("Ignoring RESUME event after SHUTDOWN");
 
571
            goto unlock;
 
572
        }
 
573
 
 
574
        VIR_DEBUG("Transitioned guest %s out of paused into resumed state",
 
575
                  vm->def->name);
 
576
 
 
577
        virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
 
578
                                 VIR_DOMAIN_RUNNING_UNPAUSED);
 
579
        event = virDomainEventNewFromObj(vm,
 
580
                                         VIR_DOMAIN_EVENT_RESUMED,
 
581
                                         VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
 
582
 
 
583
        VIR_DEBUG("Using lock state '%s' on resume event", NULLSTR(priv->lockState));
 
584
        if (virDomainLockProcessResume(driver->lockManager, vm,
 
585
                                       priv->lockState) < 0) {
 
586
            /* Don't free priv->lockState on error, because we need
 
587
             * to make sure we have state still present if the user
 
588
             * tries to resume again
 
589
             */
 
590
            goto unlock;
 
591
        }
 
592
        VIR_FREE(priv->lockState);
 
593
 
 
594
        if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) {
 
595
            VIR_WARN("Unable to save status on vm %s after state change",
 
596
                     vm->def->name);
 
597
        }
 
598
    }
 
599
 
 
600
unlock:
 
601
    virDomainObjUnlock(vm);
 
602
 
 
603
    if (event) {
 
604
        qemuDriverLock(driver);
 
605
        qemuDomainEventQueue(driver, event);
 
606
        qemuDriverUnlock(driver);
 
607
    }
 
608
 
 
609
    return 0;
 
610
}
 
611
 
 
612
 
 
613
static int
559
614
qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
560
615
                           virDomainObjPtr vm,
561
616
                           long long offset)
857
912
    .diskSecretLookup = qemuProcessFindVolumeQcowPassphrase,
858
913
    .domainShutdown = qemuProcessHandleShutdown,
859
914
    .domainStop = qemuProcessHandleStop,
 
915
    .domainResume = qemuProcessHandleResume,
860
916
    .domainReset = qemuProcessHandleReset,
861
917
    .domainRTCChange = qemuProcessHandleRTCChange,
862
918
    .domainWatchdog = qemuProcessHandleWatchdog,