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

Eric Blake eblake at redhat.com
Thu May 5 22:33:06 UTC 2011


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 ask because it would be a shame if there is ever a system which
supports more than 2G simultaneous processes [pid_t is signed, but
negative pids are groups rather than processes], yet we locked ourselves
in to a capped pid size.

Or, it is quite conceivable for a platform that represents pid_t as the
same size as void* (basically, the pointer to the physical memory
address in the kernel where the process information is stored), and if
such a platform is 64-bits, then even if you can't have 2G simultaneous
processes, you still can have large pids.

But my guess is that it is not a problem in practice (64-bit Linux uses
4-byte pid_t, and changing that now would be a major ABI change, and
most systems, even if they randomize pids rather than assigning the
sequentially, still return pids as an index into a kernel array, rather
than as an actual kernel pointer).

So I guess I'm okay with:

ACK.

-- 
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/20110505/e46bdc38/attachment-0001.sig>


More information about the libvir-list mailing list