search for: virdomainisactive

Displaying 5 results from an estimated 5 matches for "virdomainisactive".

2020 Apr 13
2
what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...D , my process as follow: cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); above code write in thread loop ,then in the same loop : while (1) { mission = vnf_mission_queue_get(task); if (mission == NULL) {...
2020 Apr 07
0
why virConnectDomainEventRegisterAny can't alway trigger the callback ,how can i get a stable callback ?
...llowing process: int vnf_control_del_network(void *arg) { 。。。。。 call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); // detach a nic from vm guest os 。。。。 } void vnf_control_del_network_cb(virConnectPtr conn, virDomainPtr dom, const char *dev,void * opaque) //this callback can't alrea...
2020 Apr 14
0
Re: what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...gt; cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); > > > > flags |= VIR_DOMAIN_AFFECT_CONFIG; > if (virDomainIsActive(dom) == 1) { > flags |= VIR_DOMAIN_AFFECT_LIVE; > } > > ret = virDomainDetachDeviceFlags(dom, xml, flags); > > > > > above code write in thread loop ,then in the same loop : > > > > while (1) { > > mission...
2020 Apr 07
0
when virEventAddTimeout trigger timeout ,should in the callback call virConnectDomainEventDeregisterAny ?
...= conn; cb_para->time_out = 20*1000;//20s cb_para->call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } cb_para->timer_id = virEventAddTimeout(cb_para->time_out, vnf_control_del_network_timeout_cb, cb_para, vnf_control_del_network_cb_free); ret = virDomainDetachDeviceFlags(dom, xml, flags); //above run in a thread function...
2010 May 21
2
Better error codes when stopping a VM that is already stopped
Hi, Sometimes when stopping a virtual domain using virDomainDestroy(), I come across a domain that is already stopped. (For example when someone already stopped the domain manually using virsh or because the guest OS issued a shutdown.) This is a special case that I absolutely need to catch and handle. Unfortunately, when this happens, and I call virGetLastError() afterwards, I always just