[libvirt] [PATCH 1/4] Define a QEMU specific API to attach to a running QEMU process

Eric Blake eblake at redhat.com
Wed May 11 22:02:24 UTC 2011


On 05/11/2011 07:09 AM, Daniel P. Berrange wrote:
> On Thu, May 05, 2011 at 04:33:06PM -0600, Eric Blake wrote:
>> On 05/05/2011 11:26 AM, Daniel P. Berrange wrote:
>>> Introduce a new API in libvirt-qemu.so
>>>
>>>  virDomainPtr virDomainQemuAttach(virConnectPtr domain,
>>>                                   int pid,
>>>                                   unsigned int flags);
>>
>> Do we want pid_t instead of pid?  Or are we guaranteed that this only
>> works on platforms with /proc/nnn, and that all such platforms already
>> have sizeof(pid_t)<=sizeof(int)?
> 
> I didn't want to use pid_t, since that doesn't exist on Windows
> and we can't assume app developers are using gnulib for portability.

Ah, I see - while pid_t is fine internally to libvirt, it is not a good
idea to expose it in a public header since we can't expose gnulib's
substitute types.

We may want to add a verify(sizeof(pid_t) <= sizeof(int)) somewhere in
our source code, to ensure we get a compile error if our assumption is
ever violated.

> Does anything think is it remotely likely that any common
> platform will use a 64-bit PID ? I'm sceptical,

As am I.

Using 'int' should be fine, then.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110511/a31df2ea/attachment-0001.sig>


More information about the libvir-list mailing list