[libvirt] [PATCH 1/2] libvirt/qemu - support updating inactive domains (take 2)

Hu Tao hutao at cn.fujitsu.com
Thu Feb 24 07:29:46 UTC 2011


> > > +
> > > +    driver = dom->conn->privateData;
> > > +    qemuDriverLock(driver);
> > > +    vm = virDomainFindByUUID(&driver->domains, dom->uuid);
> > > +    if (!vm) {
> > > +        qemuReportError(VIR_ERR_NO_DOMAIN, _("cannot find domain '%s'"),
> > > +                        dom->name);
> > > +        goto unlock_out;
> > > +    }
> > > +
> > > +    if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0) {
> > > +        /*
> > > +         * For now, just allow updating inactive domains. Further development
> > > +         * will allow updating both active domain and its config file at
> > > +         * the same time.
> > > +         */
> > > +        qemuReportError(VIR_ERR_INVALID_ARG,
> > > +                        _("cannot update alive domain : %s"),  __FUNCTION__);
> > 
> > I think we can silently fail here. Currently this function (qemuDomainModifyDevicePersistent)
> > is called only for modifying inactive domains.
> > 
> It seems...."virDomainObjIsActive(vm) check" is lacked..

Yes. What about checking for flag VIR_DOMAIN_DEVICE_MODIFY_LIVE? This
flag is set if domain is active, for example, see cmdAttachDisk().

> 
> Above 'if' returns true only when timeout..
> 

-- 
Thanks,
Hu Tao




More information about the libvir-list mailing list